public class ComplexTypeExp extends XMLSchemaTypeExp
the body
field contains the expression that exactly matches
to the declared content model (without any substitutable types).
the exp
field contains the reference to the body field,
if this complex type is not abstract. If abstract, then nullSet is set.
You shouldn't directly manipulate the exp field. Instead, you should use
the setAbstract(boolean)
method to do it.
Note: The runtime type substitution
(the use of xsi:type
attribute)
is implemented at the VGM layer. Therefore, AGMs of XML Schema does NOT
precisely represent what are actually allowed and what are not.
This table shows the mapping between "complex type definition schema component properties" (which is defined in the spec) and corresponding method/field of this class.
Property of the spec | method/field of this class |
name |
The ReferenceExp.name field.
|
target namespace |
the getTargetNamespace() method.
|
abstract |
the isAbstract() method.
|
base type definition |
simpleBaseType or complexBaseType field,
depending on whether the base type is a simple type or a complex type.
|
derivation method |
the derivationMethod field.
|
final |
the finalValue field.
|
prohibited substitutions |
the block field.
|
attribtue uses attribute wildcard content type |
Not directly accessible. Can be found by walking
the children of the body field.
|
annotation | Unaccessible. This information is removed during the parsing phase. |
The exp
field and the self
field are very similar.
In fact, the only difference is that the former is affected by the abstract
property, while the latter isn't.
So if it has to be affected by the
abstract property (like referencing a complex type as the element body),
you should use the exp
field.
If you don't want to be affected by the abstract property
(like referencing a complex type as the base type of another complex type),
then you should refer to the body
field.
ElementDeclExp
,
Serialized FormModifier and Type | Field and Description |
---|---|
ReferenceExp |
attWildcard
attribute wildcard as an expression.
|
int |
block
The
block property of this schema component, implemented as a bit field.
|
ReferenceExp |
body
actual content model definition + attribute uses.
|
ComplexTypeExp |
complexBaseType
base type of this complex type.
|
int |
derivationMethod
the derivation method used to derive this complex type from the base type.
|
int |
finalValue
The
final property of this schema component, implemented as a bit field.
|
XMLSchemaSchema |
parent
parent XMLSchemaSchema object to which this object belongs.
|
private static long |
serialVersionUID |
XSDatatypeExp |
simpleBaseType
base type of this complex type.
|
AttributeWildcard |
wildcard
Attribute wild card constraint.
|
EXTENSION, RESTRICTION
exp, name
anyString, epsilon, nullSet, verifierTag
Constructor and Description |
---|
ComplexTypeExp(XMLSchemaSchema schema,
java.lang.String localName) |
Modifier and Type | Method and Description |
---|---|
AttributeWildcard |
getAttributeWildcard() |
int |
getBlock()
Gets the value of the block constraint.
|
RedefinableExp |
getClone()
clone this object.
|
java.lang.String |
getTargetNamespace()
gets the target namespace property of this component as
specified in the spec.
|
boolean |
isAbstract()
checks if this complex type is abstract.
|
boolean |
isDefined()
implementation detail.
|
boolean |
isDerivedTypeOf(ComplexTypeExp baseType,
int constraint)
Checks if this type is a derived type of the specified type.
|
boolean |
isDerivedTypeOf(XMLSchemaTypeExp exp,
int constraint) |
boolean |
isDerivedTypeOf(XSDatatype baseType,
int constraint) |
void |
redefine(RedefinableExp _rhs)
assigns contents of rhs to this object.
|
void |
setAbstract(boolean isAbstract) |
void |
setAttributeWildcard(AttributeWildcard local) |
calcEpsilonReducibility, calcHashCode, equals, visit, visit, visit, visit
getExpandedExp, hashCode, hashCode, hashCode, isEpsilonReducible, peelOccurence, readResolve, visit, visit, visit, visit
public final ReferenceExp body
public final ReferenceExp attWildcard
public final XMLSchemaSchema parent
public AttributeWildcard wildcard
Due to the nasty definition of the interaction between attribute wildcards, we cannot add the expression for validating wildcard until the very last moment.
Until the wrap-up phase of the schema parsing, this field will contain the "local wildcard definition." In the wrap-up phase, this field is replaced by the "complete wildcard definition."
public ComplexTypeExp complexBaseType
simpleBaseType
public XSDatatypeExp simpleBaseType
complexBaseType
public int derivationMethod
#simpleBaseType
public int finalValue
0, RESTRICTION, EXTENSION, or (RESTRICTION|EXTENSION).
public int block
0, RESTRICTION, EXTENSION, or (RESTRICTION|EXTENSION).
private static final long serialVersionUID
public ComplexTypeExp(XMLSchemaSchema schema, java.lang.String localName)
public AttributeWildcard getAttributeWildcard()
public void setAttributeWildcard(AttributeWildcard local)
public final java.lang.String getTargetNamespace()
If the property is absent, then this method returns the empty string.
This method is just a shortcut for parent.targetNamespace
.
public boolean isAbstract()
This method corresponds to the abstract property of the complex type declaration schema component.
public void setAbstract(boolean isAbstract)
public boolean isDerivedTypeOf(ComplexTypeExp baseType, int constraint)
This method is an implementation of "Type Derivation OK (Complex)" test of the spec.
If you are not familiar with the abovementioned part of the spec, don't use this method. This method probably won't give you what you expected.
constraint
- A bit field that represents the restricted derivation. This field
must consists of bitwise and of XMLSchemaTypeExp.EXTENSION
or XMLSchemaTypeExp.RESTRICTION
.public boolean isDerivedTypeOf(XSDatatype baseType, int constraint)
isDerivedTypeOf(ComplexTypeExp,int)
public boolean isDerivedTypeOf(XMLSchemaTypeExp exp, int constraint)
public int getBlock()
getBlock
in class XMLSchemaTypeExp
public RedefinableExp getClone()
getClone
in class RedefinableExp
public void redefine(RedefinableExp _rhs)
RedefinableExp
redefine
in class RedefinableExp
public boolean isDefined()
isDefined
in class ReferenceExp