public abstract class ComponentImpl extends Object implements XSComponent
Modifier and Type | Field and Description |
---|---|
protected SchemaDocumentImpl |
ownerDocument |
Modifier | Constructor and Description |
---|---|
protected |
ComponentImpl(SchemaDocumentImpl _owner,
AnnotationImpl _annon,
Locator _loc,
ForeignAttributesImpl fa) |
Modifier and Type | Method and Description |
---|---|
XSAnnotation |
getAnnotation()
Gets the annotation associated to this component, if any.
|
XSAnnotation |
getAnnotation(boolean createIfNotExist)
Works like
XSComponent.getAnnotation() , but allow a new empty XSAnnotation to be created
if not exist. |
String |
getForeignAttribute(String nsUri,
String localName)
Gets the foreign attribute of the given name, or null if not found.
|
List<ForeignAttributesImpl> |
getForeignAttributes()
Gets the foreign attributes on this schema component.
|
Locator |
getLocator()
Gets the locator that indicates the source location where
this component is created from, or null if no information is
available.
|
SchemaImpl |
getOwnerSchema()
Gets a reference to the
XSSchema object to which this component
belongs. |
XSSchemaSet |
getRoot()
Gets the root schema set that includes this component.
|
SchemaDocument |
getSourceDocument()
Gets the
SchemaDocument that indicates which document this component
was defined in. |
Collection<XSComponent> |
select(String scd,
NamespaceContext nsContext)
Evaluates a schema component designator against this schema component
and returns the resulting schema components.
|
XSComponent |
selectSingle(String scd,
NamespaceContext nsContext)
Evaluates a schema component designator against this schema component
and returns the first resulting schema component.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
apply, visit
protected final SchemaDocumentImpl ownerDocument
protected ComponentImpl(SchemaDocumentImpl _owner, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl fa)
public SchemaImpl getOwnerSchema()
XSComponent
XSSchema
object to which this component
belongs.
In case of XSEmpty
component, this method
returns null since there is no owner component.
getOwnerSchema
in interface XSComponent
public XSSchemaSet getRoot()
XSComponent
In case of XSEmpty
component, this method
returns null since there is no owner component.
getRoot
in interface XSComponent
public SchemaDocument getSourceDocument()
XSComponent
SchemaDocument
that indicates which document this component
was defined in.getSourceDocument
in interface XSComponent
XSContentType
. This method also
returns null for XSSchema
.
For all other user-defined
components this method returns non-null, even if they are local.public final XSAnnotation getAnnotation()
XSComponent
getAnnotation
in interface XSComponent
public XSAnnotation getAnnotation(boolean createIfNotExist)
XSComponent
XSComponent.getAnnotation()
, but allow a new empty XSAnnotation
to be created
if not exist.getAnnotation
in interface XSComponent
createIfNotExist
- true to create a new XSAnnotation
if it doesn't exist already.
false to make this method behavel like XSComponent.getAnnotation()
.createIfNotExist==false
and annotation didn't exist.
Otherwise non-null.public final Locator getLocator()
XSComponent
getLocator
in interface XSComponent
public List<ForeignAttributesImpl> getForeignAttributes()
XSComponent
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
each ForeignAttributes
object represent foreign attributes
on one element.
getForeignAttributes
in interface XSComponent
public String getForeignAttribute(String nsUri, String localName)
XSComponent
If multiple occurences of the same attribute is found, this method returns the first one.
getForeignAttribute
in interface XSComponent
XSComponent.getForeignAttributes()
public Collection<XSComponent> select(String scd, NamespaceContext nsContext)
XSComponent
select
in interface XSComponent
scd
- Schema component designator. See SCD
for more details.nsContext
- The namespace context in which SCD is evaluated. Cannot be null.public XSComponent selectSingle(String scd, NamespaceContext nsContext)
XSComponent
selectSingle
in interface XSComponent
scd
- Schema component designator. See SCD
for more details.nsContext
- The namespace context in which SCD is evaluated. Cannot be null.Copyright © 2021 JBoss by Red Hat. All rights reserved.