com.sun.tools.xjc.reader.xmlschema.ct
abstract class AbstractExtendedComplexTypeBuilder extends CTBuilder
Field Summary | |
---|---|
protected Map<XSComplexType,NameClass[]> | characteristicNameClasses
Map from XSComplexType to NameClass[2] that
represents the names used in its child elements [0] and
attributes [1]. |
protected XSTermFunction<NameClass> | contentModelNameClassBuilder
Computes a name class that represents everything in a given content model. |
Method Summary | |
---|---|
protected boolean | checkCollision(NameClass anc, NameClass enc, XSComplexType type)
Checks if the particles/attributes defined in the type parameter
collides with the name classes of anc/enc.
|
protected boolean | checkIfExtensionSafe(XSComplexType baseType, XSComplexType thisType)
Checks if this new extension is safe.
|
protected XSComplexType | getLastRestrictedType(XSComplexType t)
Looks for the derivation chain t_1 > t_2 > ... |
Returns: true if there's a collision.
If you have ctA extending ctB and ctB restricting ctC, our Java classes will look like CtAImpl extending CtBImpl extending CtCImpl.
Since a derived class unmarshaller uses the base class unmarshaller, this could potentially result in incorrect unmarshalling. We used to just reject such a case, but then we found that there are schemas that are using it.
One generalized observation that we reached is that if the extension is only adding new elements/attributes which has never been used in any of its base class (IOW, if none of the particle / attribute use / attribute wildcard can match the name of newly added elements/attributes) then it is safe to add them.
This function checks if the derivation chain to this type is not using restriction, and if it is, then checks if it is safe according to the above condition.
Returns: false If this complex type needs to be rejected.
Returns: null If there's no such t_i or if t_i is any type.