Package com.sun.xml.xsom.impl
Class SchemaImpl
java.lang.Object
com.sun.xml.xsom.impl.SchemaImpl
- All Implemented Interfaces:
XSComponent,XSSchema
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttGroupDecl(XSAttGroupDecl newDecl, boolean overwrite) voidaddAttributeDecl(XSAttributeDecl newDecl) voidaddComplexType(XSComplexType newDecl, boolean overwrite) voidaddElementDecl(XSElementDecl newDecl) voidprotected voidvoidaddModelGroupDecl(XSModelGroupDecl newDecl, boolean overwrite) voidaddNotation(XSNotation newDecl) voidaddSimpleType(XSSimpleType newDecl, boolean overwrite) apply(XSFunction function) Accepts a functor.Gets the annotation associated to this component, if any.getAnnotation(boolean createIfNotExist) Works likeXSComponent.getAnnotation(), but allow a new emptyXSAnnotationto be created if not exist.getAttGroupDecl(String name) Gets all theXSAttGroupDecls in this schema.getAttributeDecl(String name) Gets all theXSAttributeDecls in this schema keyed by their local names.getComplexType(String name) Gets all theXSComplexTypes in this schema.getElementDecl(String name) Gets all theXSElementDecls in this schema.getForeignAttribute(String nsUri, String localName) Gets the foreign attribute of the given name, or null if not found.Gets the foreign attributes on this schema component.getIdentityConstraint(String localName) Gets the identity constraint of the given name, or null if not found.Gets all theXSIdentityConstraints in this schema, keyed by their names.Gets the locator that indicates the source location where this component is created from, or null if no information is available.getModelGroupDecl(String name) Gets all theXSModelGroupDecls in this schema.getNotation(String name) Gets all theXSNotations in this schema.Gets a reference to theXSSchemaobject to which this component belongs.getRoot()Gets the root schema set that includes this schema.getSimpleType(String name) Gets all theXSSimpleTypes in this schema.Sine anXSSchemais not necessarily defined in one schema document (for example one schema can span across many documents through <xs:include>s.), so this method always returns null.Gets the target namespace of the schema.getTypes()Gets all theXSTypes in this schema (union ofXSSchema.getSimpleTypes()andXSSchema.getComplexTypes()select(String scd, NamespaceContext nsContext) Evaluates a schema component designator against this schema component and returns the resulting schema components.selectSingle(String scd, NamespaceContext nsContext) Evaluates a schema component designator against this schema component and returns the first resulting schema component.voidvoidAccepts a visitor.
-
Field Details
-
parent
-
-
Constructor Details
-
SchemaImpl
-
-
Method Details
-
getSourceDocument
Description copied from interface:XSSchemaSine anXSSchemais not necessarily defined in one schema document (for example one schema can span across many documents through <xs:include>s.), so this method always returns null.- Specified by:
getSourceDocumentin interfaceXSComponent- Specified by:
getSourceDocumentin interfaceXSSchema- Returns:
- null for components that are built-in to XML Schema, such
as anyType, or "empty"
XSContentType. This method also returns null forXSSchema. For all other user-defined components this method returns non-null, even if they are local.
-
getRoot
Description copied from interface:XSSchemaGets the root schema set that includes this schema.- Specified by:
getRootin interfaceXSComponent- Specified by:
getRootin interfaceXSSchema- Returns:
- never null.
-
getTargetNamespace
Description copied from interface:XSSchemaGets the target namespace of the schema.- Specified by:
getTargetNamespacein interfaceXSSchema- Returns:
- can be empty, but never be null.
-
getOwnerSchema
Description copied from interface:XSComponentGets a reference to theXSSchemaobject to which this component belongs.In case of
XSEmptycomponent, this method returns null since there is no owner component.- Specified by:
getOwnerSchemain interfaceXSComponent
-
setAnnotation
-
getAnnotation
Description copied from interface:XSComponentGets the annotation associated to this component, if any.- Specified by:
getAnnotationin interfaceXSComponent
-
getAnnotation
Description copied from interface:XSComponentWorks likeXSComponent.getAnnotation(), but allow a new emptyXSAnnotationto be created if not exist.- Specified by:
getAnnotationin interfaceXSComponent- Parameters:
createIfNotExist- true to create a newXSAnnotationif it doesn't exist already. false to make this method behavel likeXSComponent.getAnnotation().- Returns:
- null if
createIfNotExist==falseand annotation didn't exist. Otherwise non-null.
-
getLocator
Description copied from interface:XSComponentGets the locator that indicates the source location where this component is created from, or null if no information is available.- Specified by:
getLocatorin interfaceXSComponent
-
addAttributeDecl
-
getAttributeDecls
Description copied from interface:XSSchemaGets all theXSAttributeDecls in this schema keyed by their local names.- Specified by:
getAttributeDeclsin interfaceXSSchema
-
getAttributeDecl
- Specified by:
getAttributeDeclin interfaceXSSchema
-
iterateAttributeDecls
- Specified by:
iterateAttributeDeclsin interfaceXSSchema
-
addElementDecl
-
getElementDecls
Description copied from interface:XSSchemaGets all theXSElementDecls in this schema.- Specified by:
getElementDeclsin interfaceXSSchema
-
getElementDecl
- Specified by:
getElementDeclin interfaceXSSchema
-
iterateElementDecls
- Specified by:
iterateElementDeclsin interfaceXSSchema
-
addAttGroupDecl
-
getAttGroupDecls
Description copied from interface:XSSchemaGets all theXSAttGroupDecls in this schema.- Specified by:
getAttGroupDeclsin interfaceXSSchema
-
getAttGroupDecl
- Specified by:
getAttGroupDeclin interfaceXSSchema
-
iterateAttGroupDecls
- Specified by:
iterateAttGroupDeclsin interfaceXSSchema
-
addNotation
-
getNotations
Description copied from interface:XSSchemaGets all theXSNotations in this schema.- Specified by:
getNotationsin interfaceXSSchema
-
getNotation
- Specified by:
getNotationin interfaceXSSchema
-
iterateNotations
- Specified by:
iterateNotationsin interfaceXSSchema
-
addModelGroupDecl
-
getModelGroupDecls
Description copied from interface:XSSchemaGets all theXSModelGroupDecls in this schema.- Specified by:
getModelGroupDeclsin interfaceXSSchema
-
getModelGroupDecl
- Specified by:
getModelGroupDeclin interfaceXSSchema
-
iterateModelGroupDecls
- Specified by:
iterateModelGroupDeclsin interfaceXSSchema
-
addIdentityConstraint
-
getIdentityConstraints
Description copied from interface:XSSchemaGets all theXSIdentityConstraints in this schema, keyed by their names.- Specified by:
getIdentityConstraintsin interfaceXSSchema
-
getIdentityConstraint
Description copied from interface:XSSchemaGets the identity constraint of the given name, or null if not found.- Specified by:
getIdentityConstraintin interfaceXSSchema
-
addSimpleType
-
getSimpleTypes
Description copied from interface:XSSchemaGets all theXSSimpleTypes in this schema.- Specified by:
getSimpleTypesin interfaceXSSchema
-
getSimpleType
- Specified by:
getSimpleTypein interfaceXSSchema
-
iterateSimpleTypes
- Specified by:
iterateSimpleTypesin interfaceXSSchema
-
addComplexType
-
getComplexTypes
Description copied from interface:XSSchemaGets all theXSComplexTypes in this schema.- Specified by:
getComplexTypesin interfaceXSSchema
-
getComplexType
- Specified by:
getComplexTypein interfaceXSSchema
-
iterateComplexTypes
- Specified by:
iterateComplexTypesin interfaceXSSchema
-
getTypes
Description copied from interface:XSSchemaGets all theXSTypes in this schema (union ofXSSchema.getSimpleTypes()andXSSchema.getComplexTypes() -
getType
-
iterateTypes
- Specified by:
iterateTypesin interfaceXSSchema
-
visit
Description copied from interface:XSComponentAccepts a visitor.- Specified by:
visitin interfaceXSComponent
-
apply
Description copied from interface:XSComponentAccepts a functor.- Specified by:
applyin interfaceXSComponent
-
addForeignAttributes
-
getForeignAttributes
Description copied from interface:XSComponentGets the foreign attributes on this schema component.In general, a schema component may match multiple elements in a schema document, and those elements can individually carry foreign attributes.
This method returns a list of
ForeignAttributes, where eachForeignAttributesobject represent foreign attributes on one element.- Specified by:
getForeignAttributesin interfaceXSComponent- Returns:
- can be an empty list but never be null.
-
getForeignAttribute
Description copied from interface:XSComponentGets the foreign attribute of the given name, or null if not found.If multiple occurences of the same attribute is found, this method returns the first one.
- Specified by:
getForeignAttributein interfaceXSComponent- See Also:
-
select
Description copied from interface:XSComponentEvaluates a schema component designator against this schema component and returns the resulting schema components.- Specified by:
selectin interfaceXSComponent- Parameters:
scd- Schema component designator. SeeSCDfor more details.nsContext- The namespace context in which SCD is evaluated. Cannot be null.- Returns:
- Can be empty but never null.
-
selectSingle
Description copied from interface:XSComponentEvaluates a schema component designator against this schema component and returns the first resulting schema component.- Specified by:
selectSinglein interfaceXSComponent- Parameters:
scd- Schema component designator. SeeSCDfor more details.nsContext- The namespace context in which SCD is evaluated. Cannot be null.- Returns:
- null if the SCD didn't match anything. If the SCD matched more than one node, the first one will be returned.
-