Package 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
public class SchemaTypeSystemImpl extends SchemaTypeLoaderBase implements SchemaTypeSystem
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description SchemaTypeSystemImpl(Class indexclass)SchemaTypeSystemImpl(String nameForSystem)SchemaTypeSystemImpl(ResourceLoader resourceLoader, String name, SchemaTypeLoader linker)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SchemaAnnotation[]annotations()Returns the top-level annotationsSchemaAttributeGroup[]attributeGroups()Returns the attribute groups defined in this loader.SchemaType[]attributeTypes()Returns the attribute types defined in this loader.static StringcrackPointer(InputStream stream)SchemaType[]documentTypes()Returns the document types defined in this loader.static booleanfileContainsTypeSystem(File file, String name)SchemaAttributeGroup.ReffindAttributeGroupRef(QName name)Used for on-demand loading.SchemaGlobalAttribute.ReffindAttributeRef(QName name)Used for on-demand loading.SchemaType.ReffindAttributeTypeRef(QName name)Used for on-demand loading.SchemaType.ReffindDocumentTypeRef(QName name)Used for on-demand loading.SchemaGlobalElement.ReffindElementRef(QName name)Used for on-demand loading.SchemaIdentityConstraint.ReffindIdentityConstraintRef(QName name)Used for on-demand loading.SchemaModelGroup.ReffindModelGroupRef(QName name)Used for on-demand loading.SchemaType.ReffindTypeRef(QName name)Used for on-demand loading.static SchemaTypeSystemImplforName(String name, ClassLoader loader)ClassLoadergetClassLoader()Returns the classloader used by this loader for resolving types.StringgetName()Returns the name of this loader.InputStreamgetSourceAsStream(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.StringhandleForType(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()booleanisIncomplete()booleanisNamespaceDefined(String namespace)True if the typeloader contains any definitions in the given namespace.voidloadFromBuilder(SchemaGlobalElement[] globalElements, SchemaGlobalAttribute[] globalAttributes, SchemaType[] globalTypes, SchemaType[] documentTypes, SchemaType[] attributeTypes)voidloadFromStscState(StscState state)SchemaModelGroup[]modelGroups()Returns the model groups defined in this loader.SchemaAttributeGroup[]redefinedAttributeGroups()SchemaType[]redefinedGlobalTypes()SchemaModelGroup[]redefinedModelGroups()voidresolve()Initializes a type system (resolves all handles within the type system).SchemaComponentresolveHandle(String handle)Locates a type, element, or attribute using the handle.voidsave(Filer filer)Saves this type system using a FilervoidsaveAttributeGroup(SchemaAttributeGroup grp)voidsaveAttributeGroups(SchemaAttributeGroup[] groups)voidsaveGlobalAttribute(SchemaGlobalAttribute attr)voidsaveGlobalAttributes(SchemaGlobalAttribute[] attrs)voidsaveGlobalElement(SchemaGlobalElement elt)voidsaveGlobalElements(SchemaGlobalElement[] elts)voidsaveIdentityConstraint(SchemaIdentityConstraint idc)voidsaveIdentityConstraints(SchemaIdentityConstraint[] idcs)voidsaveModelGroup(SchemaModelGroup grp)voidsaveModelGroups(SchemaModelGroup[] groups)voidsaveToDirectory(File classDir)Saves this type system to a directory.SchemaTypetypeForClassname(String classname)Finds a type for a given fully-qualified XML Bean classnameSchemaTypetypeForHandle(String handle)Locates a type, element, or attribute using the handle.SchemaTypeSystemtypeSystemForName(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
equals, 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 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(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)
-
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(File classDir)
Description copied from interface:SchemaTypeSystemSaves this type system to a directory.- Specified by:
saveToDirectoryin interfaceSchemaTypeSystem
-
save
public void save(Filer filer)
Description copied from interface:SchemaTypeSystemSaves this type system using a Filer- Specified by:
savein interfaceSchemaTypeSystem
-
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:SchemaTypeSystemLocates a type, element, or attribute using the handle.- Specified by:
typeForHandlein interfaceSchemaTypeSystem
-
typeForClassname
public SchemaType typeForClassname(String classname)
Description copied from interface:SchemaTypeLoaderFinds a type for a given fully-qualified XML Bean classname- Specified by:
typeForClassnamein interfaceSchemaTypeLoader
-
resolveHandle
public SchemaComponent resolveHandle(String handle)
Description copied from interface:SchemaTypeSystemLocates a type, element, or attribute using the handle.- Specified by:
resolveHandlein interfaceSchemaTypeSystem
-
resolve
public void resolve()
Description copied from interface:SchemaTypeSystemInitializes a type system (resolves all handles within the type system).- Specified by:
resolvein interfaceSchemaTypeSystem
-
isNamespaceDefined
public boolean isNamespaceDefined(String namespace)
Description copied from interface:SchemaTypeLoaderTrue if the typeloader contains any definitions in the given namespace.- Specified by:
isNamespaceDefinedin interfaceSchemaTypeLoader
-
findTypeRef
public SchemaType.Ref findTypeRef(QName name)
Description copied from interface:SchemaTypeLoaderUsed for on-demand loading.- Specified by:
findTypeRefin interfaceSchemaTypeLoader
-
findDocumentTypeRef
public SchemaType.Ref findDocumentTypeRef(QName name)
Description copied from interface:SchemaTypeLoaderUsed for on-demand loading.- Specified by:
findDocumentTypeRefin interfaceSchemaTypeLoader
-
findAttributeTypeRef
public SchemaType.Ref findAttributeTypeRef(QName name)
Description copied from interface:SchemaTypeLoaderUsed for on-demand loading.- Specified by:
findAttributeTypeRefin interfaceSchemaTypeLoader
-
findElementRef
public SchemaGlobalElement.Ref findElementRef(QName name)
Description copied from interface:SchemaTypeLoaderUsed for on-demand loading.- Specified by:
findElementRefin interfaceSchemaTypeLoader
-
findAttributeRef
public SchemaGlobalAttribute.Ref findAttributeRef(QName name)
Description copied from interface:SchemaTypeLoaderUsed for on-demand loading.- Specified by:
findAttributeRefin interfaceSchemaTypeLoader
-
findModelGroupRef
public SchemaModelGroup.Ref findModelGroupRef(QName name)
Description copied from interface:SchemaTypeLoaderUsed for on-demand loading.- Specified by:
findModelGroupRefin interfaceSchemaTypeLoader
-
findAttributeGroupRef
public SchemaAttributeGroup.Ref findAttributeGroupRef(QName name)
Description copied from interface:SchemaTypeLoaderUsed for on-demand loading.- Specified by:
findAttributeGroupRefin interfaceSchemaTypeLoader
-
findIdentityConstraintRef
public SchemaIdentityConstraint.Ref findIdentityConstraintRef(QName name)
Description copied from interface:SchemaTypeLoaderUsed for on-demand loading.- Specified by:
findIdentityConstraintRefin interfaceSchemaTypeLoader
-
globalTypes
public SchemaType[] globalTypes()
Description copied from interface:SchemaTypeSystemReturns the global types defined in this loader.- Specified by:
globalTypesin interfaceSchemaTypeSystem
-
redefinedGlobalTypes
public SchemaType[] redefinedGlobalTypes()
-
getSourceAsStream
public InputStream getSourceAsStream(String sourceName)
Description copied from interface:SchemaTypeLoaderLoads original XSD source as a stream. SeeSchemaComponent.getSourceName().- Specified by:
getSourceAsStreamin interfaceSchemaTypeLoader
-
documentTypes
public SchemaType[] documentTypes()
Description copied from interface:SchemaTypeSystemReturns the document types defined in this loader.- Specified by:
documentTypesin interfaceSchemaTypeSystem
-
attributeTypes
public SchemaType[] attributeTypes()
Description copied from interface:SchemaTypeSystemReturns the attribute types defined in this loader.- Specified by:
attributeTypesin interfaceSchemaTypeSystem
-
globalElements
public SchemaGlobalElement[] globalElements()
Description copied from interface:SchemaTypeSystemReturns the global elements defined in this loader.- Specified by:
globalElementsin interfaceSchemaTypeSystem
-
globalAttributes
public SchemaGlobalAttribute[] globalAttributes()
Description copied from interface:SchemaTypeSystemReturns the global attributes defined in this loader.- Specified by:
globalAttributesin interfaceSchemaTypeSystem
-
modelGroups
public SchemaModelGroup[] modelGroups()
Description copied from interface:SchemaTypeSystemReturns the model groups defined in this loader.- Specified by:
modelGroupsin interfaceSchemaTypeSystem
-
redefinedModelGroups
public SchemaModelGroup[] redefinedModelGroups()
-
attributeGroups
public SchemaAttributeGroup[] attributeGroups()
Description copied from interface:SchemaTypeSystemReturns the attribute groups defined in this loader.- Specified by:
attributeGroupsin interfaceSchemaTypeSystem
-
redefinedAttributeGroups
public SchemaAttributeGroup[] redefinedAttributeGroups()
-
annotations
public SchemaAnnotation[] annotations()
Description copied from interface:SchemaTypeSystemReturns the top-level annotations- Specified by:
annotationsin interfaceSchemaTypeSystem
-
identityConstraints
public SchemaIdentityConstraint[] identityConstraints()
-
getClassLoader
public ClassLoader getClassLoader()
Description copied from interface:SchemaTypeSystemReturns the classloader used by this loader for resolving types.- Specified by:
getClassLoaderin interfaceSchemaTypeSystem
-
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:SchemaTypeSystemReturns the name of this loader.- Specified by:
getNamein interfaceSchemaTypeSystem
-
typeSystemForName
public SchemaTypeSystem typeSystemForName(String name)
-
-