org.apache.xmlbeans.impl.schema
Class SchemaTypeSystemImpl

java.lang.Object
  extended by org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase
      extended by org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl
All Implemented Interfaces:
SchemaTypeLoader, SchemaTypeSystem

public class SchemaTypeSystemImpl
extends SchemaTypeLoaderBase
implements SchemaTypeSystem


Field Summary
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 java.lang.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
SchemaTypeSystemImpl(java.lang.Class indexclass)
           
SchemaTypeSystemImpl(ResourceLoader resourceLoader, java.lang.String name, SchemaTypeLoader linker)
           
SchemaTypeSystemImpl(java.lang.String nameForSystem)
           
 
Method Summary
 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 java.lang.String crackPointer(java.io.InputStream stream)
           
 SchemaType[] documentTypes()
          Returns the document types defined in this loader.
static boolean fileContainsTypeSystem(java.io.File file, java.lang.String name)
           
 SchemaAttributeGroup.Ref findAttributeGroupRef(javax.xml.namespace.QName name)
          Used for on-demand loading.
 SchemaGlobalAttribute.Ref findAttributeRef(javax.xml.namespace.QName name)
          Used for on-demand loading.
 SchemaType.Ref findAttributeTypeRef(javax.xml.namespace.QName name)
          Used for on-demand loading.
 SchemaType.Ref findDocumentTypeRef(javax.xml.namespace.QName name)
          Used for on-demand loading.
 SchemaGlobalElement.Ref findElementRef(javax.xml.namespace.QName name)
          Used for on-demand loading.
 SchemaIdentityConstraint.Ref findIdentityConstraintRef(javax.xml.namespace.QName name)
          Used for on-demand loading.
 SchemaModelGroup.Ref findModelGroupRef(javax.xml.namespace.QName name)
          Used for on-demand loading.
 SchemaType.Ref findTypeRef(javax.xml.namespace.QName name)
          Used for on-demand loading.
static SchemaTypeSystemImpl forName(java.lang.String name, java.lang.ClassLoader loader)
           
 java.lang.ClassLoader getClassLoader()
          Returns the classloader used by this loader for resolving types.
protected  java.lang.String getMetadataPath()
          Provide method to be overriden by user typesystems using a different metadata path
 java.lang.String getName()
          Returns the name of this loader.
 java.io.InputStream getSourceAsStream(java.lang.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.
 java.lang.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(java.lang.String namespace)
          True if the typeloader contains any definitions in the given namespace.
 void loadFromBuilder(SchemaGlobalElement[] globalElements, SchemaGlobalAttribute[] globalAttributes, SchemaType[] globalTypes, SchemaType[] documentTypes, SchemaType[] attributeTypes)
           
 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(java.lang.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(java.io.File classDir)
          Saves this type system to a directory.
 SchemaType typeForClassname(java.lang.String classname)
          Finds a type for a given fully-qualified XML Bean classname
 SchemaType typeForHandle(java.lang.String handle)
          Locates a type, element, or attribute using the handle.
 SchemaTypeSystem typeSystemForName(java.lang.String name)
           
 
Methods inherited from class org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase
compilePath, compilePath, compileQuery, compileQuery, findAttribute, findAttributeGroup, findAttributeType, findDocumentType, findElement, findModelGroup, findType, newDomImplementation, newInstance, newValidatingXMLInputStream, newXmlSaxHandler, parse, 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, newValidatingXMLInputStream, newXmlSaxHandler, parse, 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 java.lang.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

public SchemaTypeSystemImpl(java.lang.Class indexclass)

SchemaTypeSystemImpl

public SchemaTypeSystemImpl(ResourceLoader resourceLoader,
                            java.lang.String name,
                            SchemaTypeLoader linker)

SchemaTypeSystemImpl

public SchemaTypeSystemImpl(java.lang.String nameForSystem)
Method Detail

fileContainsTypeSystem

public static boolean fileContainsTypeSystem(java.io.File file,
                                             java.lang.String name)

forName

public static SchemaTypeSystemImpl forName(java.lang.String name,
                                           java.lang.ClassLoader loader)

loadFromBuilder

public void loadFromBuilder(SchemaGlobalElement[] globalElements,
                            SchemaGlobalAttribute[] globalAttributes,
                            SchemaType[] globalTypes,
                            SchemaType[] documentTypes,
                            SchemaType[] attributeTypes)

loadFromStscState

public void loadFromStscState(StscState state)

isIncomplete

public boolean isIncomplete()

saveToDirectory

public void saveToDirectory(java.io.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 java.lang.String crackPointer(java.io.InputStream stream)

typeForHandle

public SchemaType typeForHandle(java.lang.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(java.lang.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(java.lang.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(java.lang.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(javax.xml.namespace.QName name)
Description copied from interface: SchemaTypeLoader
Used for on-demand loading.

Specified by:
findTypeRef in interface SchemaTypeLoader

findDocumentTypeRef

public SchemaType.Ref findDocumentTypeRef(javax.xml.namespace.QName name)
Description copied from interface: SchemaTypeLoader
Used for on-demand loading.

Specified by:
findDocumentTypeRef in interface SchemaTypeLoader

findAttributeTypeRef

public SchemaType.Ref findAttributeTypeRef(javax.xml.namespace.QName name)
Description copied from interface: SchemaTypeLoader
Used for on-demand loading.

Specified by:
findAttributeTypeRef in interface SchemaTypeLoader

findElementRef

public SchemaGlobalElement.Ref findElementRef(javax.xml.namespace.QName name)
Description copied from interface: SchemaTypeLoader
Used for on-demand loading.

Specified by:
findElementRef in interface SchemaTypeLoader

findAttributeRef

public SchemaGlobalAttribute.Ref findAttributeRef(javax.xml.namespace.QName name)
Description copied from interface: SchemaTypeLoader
Used for on-demand loading.

Specified by:
findAttributeRef in interface SchemaTypeLoader

findModelGroupRef

public SchemaModelGroup.Ref findModelGroupRef(javax.xml.namespace.QName name)
Description copied from interface: SchemaTypeLoader
Used for on-demand loading.

Specified by:
findModelGroupRef in interface SchemaTypeLoader

findAttributeGroupRef

public SchemaAttributeGroup.Ref findAttributeGroupRef(javax.xml.namespace.QName name)
Description copied from interface: SchemaTypeLoader
Used for on-demand loading.

Specified by:
findAttributeGroupRef in interface SchemaTypeLoader

findIdentityConstraintRef

public SchemaIdentityConstraint.Ref findIdentityConstraintRef(javax.xml.namespace.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 java.io.InputStream getSourceAsStream(java.lang.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 java.lang.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 java.lang.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 java.lang.String getName()
Description copied from interface: SchemaTypeSystem
Returns the name of this loader.

Specified by:
getName in interface SchemaTypeSystem

typeSystemForName

public SchemaTypeSystem typeSystemForName(java.lang.String name)

getMetadataPath

protected java.lang.String getMetadataPath()
Provide method to be overriden by user typesystems using a different metadata path

Returns:
the metadata directory
Since:
XmlBeans 3.1.0