org.apache.xmlbeans.impl.schema

## Class SchemaTypeSystemImpl

- java.lang.Object
- - org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase
  - - org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl

All Implemented Interfaces:
  SchemaTypeLoader, SchemaTypeSystem

Direct Known Subclasses:
  TypeSystemHolder, TypeSystemHolder, TypeSystemHolder, TypeSystemHolder, TypeSystemHolder

    public class SchemaTypeSystemImpl
    extends SchemaTypeLoaderBase
    implements SchemaTypeSystem

### Field Summary

Fields
`static int` `DATA_BABE`
`static int` `FIELD_GLOBAL`
`static int` `FIELD_LOCALATTR`
`static int` `FIELD_LOCALELT`
`static int` `FIELD_NONE`
`static int` `FILETYPE_SCHEMAATTRIBUTE`
`static int` `FILETYPE_SCHEMAATTRIBUTEGROUP`
`static int` `FILETYPE_SCHEMAELEMENT`
`static int` `FILETYPE_SCHEMAIDENTITYCONSTRAINT`
`static int` `FILETYPE_SCHEMAINDEX`
`static int` `FILETYPE_SCHEMAMODELGROUP`
`static int` `FILETYPE_SCHEMAPOINTER`
`static int` `FILETYPE_SCHEMATYPE`
`static int` `FLAG_PART_ABSTRACT`
`static int` `FLAG_PART_BLOCKEXT`
`static int` `FLAG_PART_BLOCKREST`
`static int` `FLAG_PART_BLOCKSUBST`
`static int` `FLAG_PART_FINALEXT`
`static int` `FLAG_PART_FINALREST`
`static int` `FLAG_PART_FIXED`
`static int` `FLAG_PART_NILLABLE`
`static int` `FLAG_PART_SKIPPABLE`
`static int` `FLAG_PROP_ISATTR`
`static int` `FLAG_PROP_JAVAARRAY`
`static int` `FLAG_PROP_JAVAOPTIONAL`
`static int` `FLAG_PROP_JAVASINGLETON`
`static int` `MAJOR_VERSION`
`static String` `METADATA_PACKAGE_GEN` This is to support the feature of a separate/private XMLBeans distribution that will not colide with the public org apache xmlbeans one.
`static int` `MINOR_VERSION`
`static int` `RELEASE_NUMBER`

### Constructor Summary

Constructors
`protected` `SchemaTypeSystemImpl()`
`` `SchemaTypeSystemImpl(Class<?> indexclass)`
`` `SchemaTypeSystemImpl(ResourceLoader resourceLoader, String name, SchemaTypeLoader linker)`
`` `SchemaTypeSystemImpl(String nameForSystem)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`SchemaAnnotation[]` `annotations()` Returns the top-level annotations
`SchemaAttributeGroup[]` `attributeGroups()` Returns the attribute groups defined in this loader.
`SchemaType[]` `attributeTypes()` Returns the attribute types defined in this loader.
`static String` `crackPointer(InputStream stream)`
`SchemaType[]` `documentTypes()` Returns the document types defined in this loader.
`SchemaAttributeGroup.Ref` `findAttributeGroupRef(QName name)` Used for on-demand loading.
`SchemaGlobalAttribute.Ref` `findAttributeRef(QName name)` Used for on-demand loading.
`SchemaType.Ref` `findAttributeTypeRef(QName name)` Used for on-demand loading.
`SchemaType.Ref` `findDocumentTypeRef(QName name)` Used for on-demand loading.
`SchemaGlobalElement.Ref` `findElementRef(QName name)` Used for on-demand loading.
`SchemaIdentityConstraint.Ref` `findIdentityConstraintRef(QName name)` Used for on-demand loading.
`SchemaModelGroup.Ref` `findModelGroupRef(QName name)` Used for on-demand loading.
`SchemaType.Ref` `findTypeRef(QName name)` Used for on-demand loading.
`static SchemaTypeSystemImpl` `forName(String name, ClassLoader loader)`
`ClassLoader` `getClassLoader()` Returns the classloader used by this loader for resolving types.
`String` `getMetadataPath()` Provide method to be overridden by user typesystems using a different metadata path
`String` `getName()` Returns the name of this loader.
`InputStream` `getSourceAsStream(String sourceName)` Loads original XSD source as a stream.
`SchemaGlobalAttribute[]` `globalAttributes()` Returns the global attributes defined in this loader.
`SchemaGlobalElement[]` `globalElements()` Returns the global elements defined in this loader.
`SchemaType[]` `globalTypes()` Returns the global types defined in this loader.
`String` `handleForType(SchemaType type)` Used INTERNALLY ONLY by the code output AFTER the type system has been saved and a handle has been established for each type.
`SchemaIdentityConstraint[]` `identityConstraints()`
`boolean` `isIncomplete()`
`boolean` `isNamespaceDefined(String namespace)` True if the typeloader contains any definitions in the given namespace.
`void` `loadFromStscState(StscState state)`
`SchemaModelGroup[]` `modelGroups()` Returns the model groups defined in this loader.
`SchemaAttributeGroup[]` `redefinedAttributeGroups()`
`SchemaType[]` `redefinedGlobalTypes()`
`SchemaModelGroup[]` `redefinedModelGroups()`
`void` `resolve()` Initializes a type system (resolves all handles within the type system).
`SchemaComponent` `resolveHandle(String handle)` Locates a type, element, or attribute using the handle.
`void` `save(Filer filer)` Saves this type system using a Filer
`void` `saveAttributeGroup(SchemaAttributeGroup grp)`
`void` `saveAttributeGroups(SchemaAttributeGroup[] groups)`
`void` `saveGlobalAttribute(SchemaGlobalAttribute attr)`
`void` `saveGlobalAttributes(SchemaGlobalAttribute[] attrs)`
`void` `saveGlobalElement(SchemaGlobalElement elt)`
`void` `saveGlobalElements(SchemaGlobalElement[] elts)`
`void` `saveIdentityConstraint(SchemaIdentityConstraint idc)`
`void` `saveIdentityConstraints(SchemaIdentityConstraint[] idcs)`
`void` `saveModelGroup(SchemaModelGroup grp)`
`void` `saveModelGroups(SchemaModelGroup[] groups)`
`void` `saveToDirectory(File classDir)` Saves this type system to a directory.
`SchemaType` `typeForClassname(String classname)` Finds a type for a given fully-qualified XML Bean classname
`SchemaType` `typeForHandle(String handle)` Locates a type, element, or attribute using the handle.

### Methods inherited from class org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase

`compilePath, compilePath, compileQuery, compileQuery, findAttribute, findAttributeGroup, findAttributeType, findDocumentType, findElement, findModelGroup, findType, newDomImplementation, newInstance, newXmlSaxHandler, parse, parse, parse, parse, parse, parse, parse, typeForSignature`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.xmlbeans.SchemaTypeLoader

`compilePath, compileQuery, findAttribute, findAttributeGroup, findAttributeType, findDocumentType, findElement, findModelGroup, findType, newDomImplementation, newInstance, newXmlSaxHandler, parse, parse, parse, parse, parse, parse, parse, typeForSignature`

### Field Detail

#### DATA_BABE

    public static final int DATA_BABE

See Also:
  Constant Field Values

#### MAJOR_VERSION

    public static final int MAJOR_VERSION

See Also:
  Constant Field Values

#### MINOR_VERSION

    public static final int MINOR_VERSION

See Also:
  Constant Field Values

#### RELEASE_NUMBER

    public static final int RELEASE_NUMBER

See Also:
  Constant Field Values

#### FILETYPE_SCHEMAINDEX

    public static final int FILETYPE_SCHEMAINDEX

See Also:
  Constant Field Values

#### FILETYPE_SCHEMATYPE

    public static final int FILETYPE_SCHEMATYPE

See Also:
  Constant Field Values

#### FILETYPE_SCHEMAELEMENT

    public static final int FILETYPE_SCHEMAELEMENT

See Also:
  Constant Field Values

#### FILETYPE_SCHEMAATTRIBUTE

    public static final int FILETYPE_SCHEMAATTRIBUTE

See Also:
  Constant Field Values

#### FILETYPE_SCHEMAPOINTER

    public static final int FILETYPE_SCHEMAPOINTER

See Also:
  Constant Field Values

#### FILETYPE_SCHEMAMODELGROUP

    public static final int FILETYPE_SCHEMAMODELGROUP

See Also:
  Constant Field Values

#### FILETYPE_SCHEMAATTRIBUTEGROUP

    public static final int FILETYPE_SCHEMAATTRIBUTEGROUP

See Also:
  Constant Field Values

#### FILETYPE_SCHEMAIDENTITYCONSTRAINT

    public static final int FILETYPE_SCHEMAIDENTITYCONSTRAINT

See Also:
  Constant Field Values

#### FLAG_PART_SKIPPABLE

    public static final int FLAG_PART_SKIPPABLE

See Also:
  Constant Field Values

#### FLAG_PART_FIXED

    public static final int FLAG_PART_FIXED

See Also:
  Constant Field Values

#### FLAG_PART_NILLABLE

    public static final int FLAG_PART_NILLABLE

See Also:
  Constant Field Values

#### FLAG_PART_BLOCKEXT

    public static final int FLAG_PART_BLOCKEXT

See Also:
  Constant Field Values

#### FLAG_PART_BLOCKREST

    public static final int FLAG_PART_BLOCKREST

See Also:
  Constant Field Values

#### FLAG_PART_BLOCKSUBST

    public static final int FLAG_PART_BLOCKSUBST

See Also:
  Constant Field Values

#### FLAG_PART_ABSTRACT

    public static final int FLAG_PART_ABSTRACT

See Also:
  Constant Field Values

#### FLAG_PART_FINALEXT

    public static final int FLAG_PART_FINALEXT

See Also:
  Constant Field Values

#### FLAG_PART_FINALREST

    public static final int FLAG_PART_FINALREST

See Also:
  Constant Field Values

#### FLAG_PROP_ISATTR

    public static final int FLAG_PROP_ISATTR

See Also:
  Constant Field Values

#### FLAG_PROP_JAVASINGLETON

    public static final int FLAG_PROP_JAVASINGLETON

See Also:
  Constant Field Values

#### FLAG_PROP_JAVAOPTIONAL

    public static final int FLAG_PROP_JAVAOPTIONAL

See Also:
  Constant Field Values

#### FLAG_PROP_JAVAARRAY

    public static final int FLAG_PROP_JAVAARRAY

See Also:
  Constant Field Values

#### FIELD_NONE

    public static final int FIELD_NONE

See Also:
  Constant Field Values

#### FIELD_GLOBAL

    public static final int FIELD_GLOBAL

See Also:
  Constant Field Values

#### FIELD_LOCALATTR

    public static final int FIELD_LOCALATTR

See Also:
  Constant Field Values

#### FIELD_LOCALELT

    public static final int FIELD_LOCALELT

See Also:
  Constant Field Values

#### METADATA_PACKAGE_GEN

    public static String METADATA_PACKAGE_GEN

This is to support the feature of a separate/private XMLBeans distribution that will not colide with the public org apache xmlbeans one. METADATA_PACKAGE_GEN will be "" for the original and something like com.mycompany.private.xmlbeans for a private distribution of XMLBeans.

There are two properties: METADATA_PACKAGE_GEN - used for generating metadata and METADATA_PACKAGE_LOAD - used for loading the metadata. Most of the time they have the same value, with one exception, during the repackage process scomp needs to load from old package and generate into a new package.

### Constructor Detail

#### SchemaTypeSystemImpl

    protected SchemaTypeSystemImpl()

#### SchemaTypeSystemImpl

    public SchemaTypeSystemImpl(Class<?> indexclass)

#### SchemaTypeSystemImpl

    public SchemaTypeSystemImpl(ResourceLoader resourceLoader,
                                String name,
                                SchemaTypeLoader linker)

#### SchemaTypeSystemImpl

    public SchemaTypeSystemImpl(String nameForSystem)

### Method Detail

#### forName

    public static SchemaTypeSystemImpl forName(String name,
                                               ClassLoader loader)

#### loadFromStscState

    public void loadFromStscState(StscState state)

#### isIncomplete

    public boolean isIncomplete()

#### saveToDirectory

    public void saveToDirectory(File classDir)

Description copied from interface: `SchemaTypeSystem`
Saves this type system to a directory.

Specified by:
  `saveToDirectory` in interface `SchemaTypeSystem`

#### save

    public void save(Filer filer)

Description copied from interface: `SchemaTypeSystem`
Saves this type system using a Filer

Specified by:
  `save` in interface `SchemaTypeSystem`

#### saveGlobalElements

    public void saveGlobalElements(SchemaGlobalElement[] elts)

#### saveGlobalAttributes

    public void saveGlobalAttributes(SchemaGlobalAttribute[] attrs)

#### saveModelGroups

    public void saveModelGroups(SchemaModelGroup[] groups)

#### saveAttributeGroups

    public void saveAttributeGroups(SchemaAttributeGroup[] groups)

#### saveIdentityConstraints

    public void saveIdentityConstraints(SchemaIdentityConstraint[] idcs)

#### saveGlobalElement

    public void saveGlobalElement(SchemaGlobalElement elt)

#### saveGlobalAttribute

    public void saveGlobalAttribute(SchemaGlobalAttribute attr)

#### saveModelGroup

    public void saveModelGroup(SchemaModelGroup grp)

#### saveAttributeGroup

    public void saveAttributeGroup(SchemaAttributeGroup grp)

#### saveIdentityConstraint

    public void saveIdentityConstraint(SchemaIdentityConstraint idc)

#### crackPointer

    public static String crackPointer(InputStream stream)

#### typeForHandle

    public SchemaType typeForHandle(String handle)

Description copied from interface: `SchemaTypeSystem`
Locates a type, element, or attribute using the handle.

Specified by:
  `typeForHandle` in interface `SchemaTypeSystem`

#### typeForClassname

    public SchemaType typeForClassname(String classname)

Description copied from interface: `SchemaTypeLoader`
Finds a type for a given fully-qualified XML Bean classname

Specified by:
  `typeForClassname` in interface `SchemaTypeLoader`

#### resolveHandle

    public SchemaComponent resolveHandle(String handle)

Description copied from interface: `SchemaTypeSystem`
Locates a type, element, or attribute using the handle.

Specified by:
  `resolveHandle` in interface `SchemaTypeSystem`

#### resolve

    public void resolve()

Description copied from interface: `SchemaTypeSystem`
Initializes a type system (resolves all handles within the type system).

Specified by:
  `resolve` in interface `SchemaTypeSystem`

#### isNamespaceDefined

    public boolean isNamespaceDefined(String namespace)

Description copied from interface: `SchemaTypeLoader`
True if the typeloader contains any definitions in the given namespace.

Specified by:
  `isNamespaceDefined` in interface `SchemaTypeLoader`

#### findTypeRef

    public SchemaType.Ref findTypeRef(QName name)

Description copied from interface: `SchemaTypeLoader`
Used for on-demand loading.

Specified by:
  `findTypeRef` in interface `SchemaTypeLoader`

#### findDocumentTypeRef

    public SchemaType.Ref findDocumentTypeRef(QName name)

Description copied from interface: `SchemaTypeLoader`
Used for on-demand loading.

Specified by:
  `findDocumentTypeRef` in interface `SchemaTypeLoader`

#### findAttributeTypeRef

    public SchemaType.Ref findAttributeTypeRef(QName name)

Description copied from interface: `SchemaTypeLoader`
Used for on-demand loading.

Specified by:
  `findAttributeTypeRef` in interface `SchemaTypeLoader`

#### findElementRef

    public SchemaGlobalElement.Ref findElementRef(QName name)

Description copied from interface: `SchemaTypeLoader`
Used for on-demand loading.

Specified by:
  `findElementRef` in interface `SchemaTypeLoader`

#### findAttributeRef

    public SchemaGlobalAttribute.Ref findAttributeRef(QName name)

Description copied from interface: `SchemaTypeLoader`
Used for on-demand loading.

Specified by:
  `findAttributeRef` in interface `SchemaTypeLoader`

#### findModelGroupRef

    public SchemaModelGroup.Ref findModelGroupRef(QName name)

Description copied from interface: `SchemaTypeLoader`
Used for on-demand loading.

Specified by:
  `findModelGroupRef` in interface `SchemaTypeLoader`

#### findAttributeGroupRef

    public SchemaAttributeGroup.Ref findAttributeGroupRef(QName name)

Description copied from interface: `SchemaTypeLoader`
Used for on-demand loading.

Specified by:
  `findAttributeGroupRef` in interface `SchemaTypeLoader`

#### findIdentityConstraintRef

    public SchemaIdentityConstraint.Ref findIdentityConstraintRef(QName name)

Description copied from interface: `SchemaTypeLoader`
Used for on-demand loading.

Specified by:
  `findIdentityConstraintRef` in interface `SchemaTypeLoader`

#### globalTypes

    public SchemaType[] globalTypes()

Description copied from interface: `SchemaTypeSystem`
Returns the global types defined in this loader.

Specified by:
  `globalTypes` in interface `SchemaTypeSystem`

#### redefinedGlobalTypes

    public SchemaType[] redefinedGlobalTypes()

#### getSourceAsStream

    public InputStream getSourceAsStream(String sourceName)

Description copied from interface: `SchemaTypeLoader`
Loads original XSD source as a stream. See `SchemaComponent.getSourceName()`.

Specified by:
  `getSourceAsStream` in interface `SchemaTypeLoader`

#### documentTypes

    public SchemaType[] documentTypes()

Description copied from interface: `SchemaTypeSystem`
Returns the document types defined in this loader.

Specified by:
  `documentTypes` in interface `SchemaTypeSystem`

#### attributeTypes

    public SchemaType[] attributeTypes()

Description copied from interface: `SchemaTypeSystem`
Returns the attribute types defined in this loader.

Specified by:
  `attributeTypes` in interface `SchemaTypeSystem`

#### globalElements

    public SchemaGlobalElement[] globalElements()

Description copied from interface: `SchemaTypeSystem`
Returns the global elements defined in this loader.

Specified by:
  `globalElements` in interface `SchemaTypeSystem`

#### globalAttributes

    public SchemaGlobalAttribute[] globalAttributes()

Description copied from interface: `SchemaTypeSystem`
Returns the global attributes defined in this loader.

Specified by:
  `globalAttributes` in interface `SchemaTypeSystem`

#### modelGroups

    public SchemaModelGroup[] modelGroups()

Description copied from interface: `SchemaTypeSystem`
Returns the model groups defined in this loader.

Specified by:
  `modelGroups` in interface `SchemaTypeSystem`

#### redefinedModelGroups

    public SchemaModelGroup[] redefinedModelGroups()

#### attributeGroups

    public SchemaAttributeGroup[] attributeGroups()

Description copied from interface: `SchemaTypeSystem`
Returns the attribute groups defined in this loader.

Specified by:
  `attributeGroups` in interface `SchemaTypeSystem`

#### redefinedAttributeGroups

    public SchemaAttributeGroup[] redefinedAttributeGroups()

#### annotations

    public SchemaAnnotation[] annotations()

Description copied from interface: `SchemaTypeSystem`
Returns the top-level annotations

Specified by:
  `annotations` in interface `SchemaTypeSystem`

#### identityConstraints

    public SchemaIdentityConstraint[] identityConstraints()

#### getClassLoader

    public ClassLoader getClassLoader()

Description copied from interface: `SchemaTypeSystem`
Returns the classloader used by this loader for resolving types.

Specified by:
  `getClassLoader` in interface `SchemaTypeSystem`

#### handleForType

    public String handleForType(SchemaType type)

Used INTERNALLY ONLY by the code output AFTER the type system has been saved and a handle has been established for each type.

#### getName

    public String getName()

Description copied from interface: `SchemaTypeSystem`
Returns the name of this loader.

Specified by:
  `getName` in interface `SchemaTypeSystem`

#### getMetadataPath

    public String getMetadataPath()

Provide method to be overridden by user typesystems using a different metadata path

Returns:
  the metadata directory
Since:
  XmlBeans 3.1.0