Package com.sun.xml.xsom.impl
Class SchemaImpl
java.lang.Object
com.sun.xml.xsom.impl.SchemaImpl
- All Implemented Interfaces:
XSComponent
,XSSchema
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttGroupDecl
(XSAttGroupDecl newDecl, boolean overwrite) void
addAttributeDecl
(XSAttributeDecl newDecl) void
addComplexType
(XSComplexType newDecl, boolean overwrite) void
addElementDecl
(XSElementDecl newDecl) void
protected void
void
addModelGroupDecl
(XSModelGroupDecl newDecl, boolean overwrite) void
addNotation
(XSNotation newDecl) void
addSimpleType
(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 emptyXSAnnotation
to be created if not exist.getAttGroupDecl
(String name) Gets all theXSAttGroupDecl
s in this schema.getAttributeDecl
(String name) Gets all theXSAttributeDecl
s in this schema keyed by their local names.getComplexType
(String name) Gets all theXSComplexType
s in this schema.getElementDecl
(String name) Gets all theXSElementDecl
s 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 theXSIdentityConstraint
s 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 theXSModelGroupDecl
s in this schema.getNotation
(String name) Gets all theXSNotation
s in this schema.Gets a reference to theXSSchema
object to which this component belongs.getRoot()
Gets the root schema set that includes this schema.getSimpleType
(String name) Gets all theXSSimpleType
s in this schema.Sine anXSSchema
is 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 theXSType
s 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.void
void
Accepts a visitor.
-
Field Details
-
parent
-
-
Constructor Details
-
SchemaImpl
-
-
Method Details
-
getSourceDocument
Description copied from interface:XSSchema
Sine anXSSchema
is 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:
getSourceDocument
in interfaceXSComponent
- Specified by:
getSourceDocument
in 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:XSSchema
Gets the root schema set that includes this schema.- Specified by:
getRoot
in interfaceXSComponent
- Specified by:
getRoot
in interfaceXSSchema
- Returns:
- never null.
-
getTargetNamespace
Description copied from interface:XSSchema
Gets the target namespace of the schema.- Specified by:
getTargetNamespace
in interfaceXSSchema
- Returns:
- can be empty, but never be null.
-
getOwnerSchema
Description copied from interface:XSComponent
Gets a reference to theXSSchema
object to which this component belongs.In case of
XSEmpty
component, this method returns null since there is no owner component.- Specified by:
getOwnerSchema
in interfaceXSComponent
-
setAnnotation
-
getAnnotation
Description copied from interface:XSComponent
Gets the annotation associated to this component, if any.- Specified by:
getAnnotation
in interfaceXSComponent
-
getAnnotation
Description copied from interface:XSComponent
Works likeXSComponent.getAnnotation()
, but allow a new emptyXSAnnotation
to be created if not exist.- Specified by:
getAnnotation
in interfaceXSComponent
- Parameters:
createIfNotExist
- true to create a newXSAnnotation
if it doesn't exist already. false to make this method behavel likeXSComponent.getAnnotation()
.- Returns:
- null if
createIfNotExist==false
and annotation didn't exist. Otherwise non-null.
-
getLocator
Description copied from interface:XSComponent
Gets the locator that indicates the source location where this component is created from, or null if no information is available.- Specified by:
getLocator
in interfaceXSComponent
-
addAttributeDecl
-
getAttributeDecls
Description copied from interface:XSSchema
Gets all theXSAttributeDecl
s in this schema keyed by their local names.- Specified by:
getAttributeDecls
in interfaceXSSchema
-
getAttributeDecl
- Specified by:
getAttributeDecl
in interfaceXSSchema
-
iterateAttributeDecls
- Specified by:
iterateAttributeDecls
in interfaceXSSchema
-
addElementDecl
-
getElementDecls
Description copied from interface:XSSchema
Gets all theXSElementDecl
s in this schema.- Specified by:
getElementDecls
in interfaceXSSchema
-
getElementDecl
- Specified by:
getElementDecl
in interfaceXSSchema
-
iterateElementDecls
- Specified by:
iterateElementDecls
in interfaceXSSchema
-
addAttGroupDecl
-
getAttGroupDecls
Description copied from interface:XSSchema
Gets all theXSAttGroupDecl
s in this schema.- Specified by:
getAttGroupDecls
in interfaceXSSchema
-
getAttGroupDecl
- Specified by:
getAttGroupDecl
in interfaceXSSchema
-
iterateAttGroupDecls
- Specified by:
iterateAttGroupDecls
in interfaceXSSchema
-
addNotation
-
getNotations
Description copied from interface:XSSchema
Gets all theXSNotation
s in this schema.- Specified by:
getNotations
in interfaceXSSchema
-
getNotation
- Specified by:
getNotation
in interfaceXSSchema
-
iterateNotations
- Specified by:
iterateNotations
in interfaceXSSchema
-
addModelGroupDecl
-
getModelGroupDecls
Description copied from interface:XSSchema
Gets all theXSModelGroupDecl
s in this schema.- Specified by:
getModelGroupDecls
in interfaceXSSchema
-
getModelGroupDecl
- Specified by:
getModelGroupDecl
in interfaceXSSchema
-
iterateModelGroupDecls
- Specified by:
iterateModelGroupDecls
in interfaceXSSchema
-
addIdentityConstraint
-
getIdentityConstraints
Description copied from interface:XSSchema
Gets all theXSIdentityConstraint
s in this schema, keyed by their names.- Specified by:
getIdentityConstraints
in interfaceXSSchema
-
getIdentityConstraint
Description copied from interface:XSSchema
Gets the identity constraint of the given name, or null if not found.- Specified by:
getIdentityConstraint
in interfaceXSSchema
-
addSimpleType
-
getSimpleTypes
Description copied from interface:XSSchema
Gets all theXSSimpleType
s in this schema.- Specified by:
getSimpleTypes
in interfaceXSSchema
-
getSimpleType
- Specified by:
getSimpleType
in interfaceXSSchema
-
iterateSimpleTypes
- Specified by:
iterateSimpleTypes
in interfaceXSSchema
-
addComplexType
-
getComplexTypes
Description copied from interface:XSSchema
Gets all theXSComplexType
s in this schema.- Specified by:
getComplexTypes
in interfaceXSSchema
-
getComplexType
- Specified by:
getComplexType
in interfaceXSSchema
-
iterateComplexTypes
- Specified by:
iterateComplexTypes
in interfaceXSSchema
-
getTypes
Description copied from interface:XSSchema
Gets all theXSType
s in this schema (union ofXSSchema.getSimpleTypes()
andXSSchema.getComplexTypes()
-
getType
-
iterateTypes
- Specified by:
iterateTypes
in interfaceXSSchema
-
visit
Description copied from interface:XSComponent
Accepts a visitor.- Specified by:
visit
in interfaceXSComponent
-
apply
Description copied from interface:XSComponent
Accepts a functor.- Specified by:
apply
in interfaceXSComponent
-
addForeignAttributes
-
getForeignAttributes
Description copied from interface:XSComponent
Gets 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 eachForeignAttributes
object represent foreign attributes on one element.- Specified by:
getForeignAttributes
in interfaceXSComponent
- Returns:
- can be an empty list but never be null.
-
getForeignAttribute
Description copied from interface:XSComponent
Gets 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:
getForeignAttribute
in interfaceXSComponent
- See Also:
-
select
Description copied from interface:XSComponent
Evaluates a schema component designator against this schema component and returns the resulting schema components.- Specified by:
select
in interfaceXSComponent
- Parameters:
scd
- Schema component designator. SeeSCD
for 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:XSComponent
Evaluates a schema component designator against this schema component and returns the first resulting schema component.- Specified by:
selectSingle
in interfaceXSComponent
- Parameters:
scd
- Schema component designator. SeeSCD
for 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.
-