public final class TLcdXMLSchemaTypeIdentifier extends Object
axis
, specifying the semantic
meaning of the step (e.g. an attribute or element), and an associated value (e.g. the name of the attribute or element).
<xsd:simpleType name="GlobalType">
<xsd:restriction>
<xsd:simpleType>
<xsd:list itemType="xsd:string"/>
</xsd:simpleType>
</xsd:restriction>
</xsd:simpleType>
The schema type identifier for the global type can be built as follows:
TLcdXMLSchemaTypeIdentifier.newBuilder()
.step(GLOBAL_TYPE, new QName(ns, "GlobalType"))
.build();
The schema type identifier of the anonymous base type of the global type can be built as follows:
TLcdXMLSchemaTypeIdentifier.newBuilder()
.step(GLOBAL_TYPE, new QName(ns, "GlobalType"))
.step(ANONYMOUS_BASE_TYPE, null)
.build();
<xsd:attribute name="GlobalAttribute">
<xsd:simpleType>
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
The schema type identifier can be built as follows:
TLcdXMLSchemaTypeIdentifier.newBuilder()
.step(ANONYMOUS_ATTRIBUTE_TYPE, new QName(ns, "GlobalAttribute"))
.build();
<xsd:complexType name="GlobalType">
<xsd:sequence>
<xsd:element name="FirstLocalElement">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="SecondLocalElement">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
The schema type identifier can be built as follows:
TLcdXMLSchemaTypeIdentifier.newBuilder()
.step(GLOBAL_TYPE, new QName(ns, "GlobalType"))
.step(ANONYMOUS_ELEMENT_TYPE, new QName(ns, "FirstLocalElement"))
.step(ANONYMOUS_ELEMENT_TYPE, new QName(ns, "SecondLocalElement"))
.build();
<xsd:element name="GlobalElement">
<xsd:complexType>
<xsd:attribute name="LocalAttribute">
<xsd:simpleType>
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
The schema type identifier can be built as follows:
TLcdXMLSchemaTypeIdentifier.newBuilder()
.step(ANONYMOUS_ELEMENT_TYPE, new QName(ns, "GlobalElement"))
.step(ANONYMOUS_ATTRIBUTE_TYPE, new QName(ns, "LocalAttribute"))
.build();
Modifier and Type | Class and Description |
---|---|
static class |
TLcdXMLSchemaTypeIdentifier.Builder
Builder to easily add steps to create schema type identifiers.
|
static class |
TLcdXMLSchemaTypeIdentifier.StepAxis
The semantic meaning of a schema type identifier step (e.g. an attribute, an element group, a union).
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
QName |
getAttributeName()
Returns the attribute name of this XML schema type identifier, or
null if this identifier
does not have an attribute name. |
QName[] |
getElementNames()
Returns the element name stack of this XML schema type identifier, or
null if this identifier
does not have an element name stack. |
QName |
getGroupName()
Returns the global group name of this XML schema type identifier, or
null if this identifier
does not have a global group name. |
TLcdXMLSchemaTypeIdentifier.StepAxis[] |
getStepAxes()
Returns all the step axes.
|
Object[] |
getStepIdentifiers()
Returns all the step identifiers associated with the step axes.
|
QName |
getTypeName()
Returns the global type name of this XML schema type identifier, or
null if this identifier
does not have a global type name. |
int |
getUnionIndex()
Returns
-1 in case the identifier does not refer to an anonymous type that
is defined within a union type. |
int |
hashCode() |
boolean |
isAnonymousListItemType()
Returns
true if the type identified by this type identifier is an anonymous list type,
false otherwise. |
boolean |
isGlobal()
Returns
true if the type identified by this type identifier is global, false
otherwise. |
static TLcdXMLSchemaTypeIdentifier.Builder |
newBuilder()
Creates an empty builder without any steps.
|
static TLcdXMLSchemaTypeIdentifier.Builder |
newBuilder(TLcdXMLSchemaTypeIdentifier aParentTypeId)
Creates a new builder pre-configured with the steps of the given identifier.
|
static TLcdXMLSchemaTypeIdentifier |
newGlobalTypeInstance(QName aTypeName)
Returns an instance of a
TLcdXMLSchemaTypeIdentifier representing the specified XML global schema type. |
static TLcdXMLSchemaTypeIdentifier |
newInstance(QName aTypeName,
QName[] aElementNames,
QName aAttributeName)
Returns an instance of a
TLcdXMLSchemaTypeIdentifier representing the specified XML schema type. |
static TLcdXMLSchemaTypeIdentifier |
newInstance(QName aTypeName,
QName aGroupName,
QName[] aElementNames,
QName aAttributeName,
int aUnionIndex)
Returns an instance of a
TLcdXMLSchemaTypeIdentifier representing the specified XML schema type. |
String |
toString()
Returns a general description of this schema type identifier, containing the global type name,
element name stack and attribute name of this type identifier.
|
public static TLcdXMLSchemaTypeIdentifier.Builder newBuilder()
public static TLcdXMLSchemaTypeIdentifier.Builder newBuilder(TLcdXMLSchemaTypeIdentifier aParentTypeId)
aParentTypeId
- the identifier whose steps to build uponpublic static TLcdXMLSchemaTypeIdentifier newInstance(QName aTypeName, QName[] aElementNames, QName aAttributeName)
TLcdXMLSchemaTypeIdentifier
representing the specified XML schema type.
Builder
instead.aTypeName
- a global type nameaElementNames
- a stack of element namesaAttributeName
- an attribute nameTLcdXMLSchemaTypeIdentifier
representing the specified XML schema type.NullPointerException
- if all arguments are null
.public static TLcdXMLSchemaTypeIdentifier newInstance(QName aTypeName, QName aGroupName, QName[] aElementNames, QName aAttributeName, int aUnionIndex)
TLcdXMLSchemaTypeIdentifier
representing the specified XML schema type.
Builder
instead.aTypeName
- a global type nameaGroupName
- a global group nameaElementNames
- a stack of element namesaAttributeName
- an attribute nameaUnionIndex
- the index of the type in the list of locally defined types within a unionTLcdXMLSchemaTypeIdentifier
representing the specified XML schema type.NullPointerException
- if all arguments are null
.public static TLcdXMLSchemaTypeIdentifier newGlobalTypeInstance(QName aTypeName)
TLcdXMLSchemaTypeIdentifier
representing the specified XML global schema type.aTypeName
- a global type nameTLcdXMLSchemaTypeIdentifier
representing the specified XML schema type.NullPointerException
- if all arguments are null
.public final QName getTypeName()
null
if this identifier
does not have a global type name.null
if this identifier
does not have a global type name.public final QName getGroupName()
null
if this identifier
does not have a global group name.null
if this identifier
does not have a global group name.public final QName[] getElementNames()
null
if this identifier
does not have an element name stack.null
if this identifier
does not have an element name stack.public QName getAttributeName()
null
if this identifier
does not have an attribute name.null
if this identifier
does not have an attribute name.public boolean isGlobal()
true
if the type identified by this type identifier is global, false
otherwise.true
if the type identified by this type identifier is global, false
otherwise.public boolean isAnonymousListItemType()
true
if the type identified by this type identifier is an anonymous list type,
false
otherwise.true
if the last step axis is an TLcdXMLSchemaTypeIdentifier.StepAxis.ANONYMOUS_LIST_ITEM_TYPE
public TLcdXMLSchemaTypeIdentifier.StepAxis[] getStepAxes()
public Object[] getStepIdentifiers()
public String toString()
public int getUnionIndex()
-1
in case the identifier does not refer to an anonymous type that
is defined within a union type. Otherwise, returns the index of this type in the
list of anonymous types defined in the type identified by a type identifier that is
equal to this identifier but with a union index equal to -1
.