Package com.sun.xml.xsom.impl
Class ComponentImpl
java.lang.Object
com.sun.xml.xsom.impl.ComponentImpl
- All Implemented Interfaces:
XSComponent
- Direct Known Subclasses:
AttributeDeclImpl,AttributesHolder,AttributeUseImpl,ElementDecl,EmptyImpl,FacetImpl,IdentityConstraintImpl,ModelGroupDeclImpl,ModelGroupImpl,NotationImpl,ParticleImpl,SimpleTypeImpl,WildcardImpl,XPathImpl
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedComponentImpl(SchemaDocumentImpl _owner, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl fa) -
Method Summary
Modifier and TypeMethodDescriptionfinal XSAnnotationGets the annotation associated to this component, if any.getAnnotation(boolean createIfNotExist) Works likeXSComponent.getAnnotation(), but allow a new emptyXSAnnotationto be created if not exist.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.final LocatorGets the locator that indicates the source location where this component is created from, or null if no information is available.Gets a reference to theXSSchemaobject to which this component belongs.getRoot()Gets the root schema set that includes this component.Gets theSchemaDocumentthat indicates which document this component was defined in.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.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.sun.xml.xsom.XSComponent
apply, visit
-
Field Details
-
ownerDocument
-
-
Constructor Details
-
ComponentImpl
protected ComponentImpl(SchemaDocumentImpl _owner, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl fa)
-
-
Method Details
-
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
-
getRoot
Description copied from interface:XSComponentGets the root schema set that includes this component.In case of
XSEmptycomponent, this method returns null since there is no owner component.- Specified by:
getRootin interfaceXSComponent
-
getSourceDocument
Description copied from interface:XSComponentGets theSchemaDocumentthat indicates which document this component was defined in.- Specified by:
getSourceDocumentin interfaceXSComponent- 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.
-
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
-
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.
-
toString
-