|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.tools.xjc.reader.xmlschema.ct.CTBuilder
com.sun.tools.xjc.reader.xmlschema.ct.AbstractExtendedComplexTypeBuilder
abstract class AbstractExtendedComplexTypeBuilder
Binds a complex type derived from another complex type by extension.
| Field Summary | |
|---|---|
protected java.util.Map<com.sun.xml.xsom.XSComplexType,org.kohsuke.rngom.nc.NameClass[]> |
characteristicNameClasses
Map from XSComplexType to NameClass[2] that
represents the names used in its child elements [0] and
attributes [1]. |
protected com.sun.xml.xsom.visitor.XSTermFunction<org.kohsuke.rngom.nc.NameClass> |
contentModelNameClassBuilder
Computes a name class that represents everything in a given content model. |
| Fields inherited from class com.sun.tools.xjc.reader.xmlschema.ct.CTBuilder |
|---|
bgmBuilder, builder, errorReceiver, green, schemas, selector, simpleTypeBuilder |
| Constructor Summary | |
|---|---|
AbstractExtendedComplexTypeBuilder()
|
|
| Method Summary | |
|---|---|
protected boolean |
checkCollision(org.kohsuke.rngom.nc.NameClass anc,
org.kohsuke.rngom.nc.NameClass enc,
com.sun.xml.xsom.XSComplexType type)
Checks if the particles/attributes defined in the type parameter collides with the name classes of anc/enc. |
protected boolean |
checkIfExtensionSafe(com.sun.xml.xsom.XSComplexType baseType,
com.sun.xml.xsom.XSComplexType thisType)
Checks if this new extension is safe. |
protected com.sun.xml.xsom.XSComplexType |
getLastRestrictedType(com.sun.xml.xsom.XSComplexType t)
Looks for the derivation chain t_1 > t_2 > ... |
| Methods inherited from class com.sun.tools.xjc.reader.xmlschema.ct.CTBuilder |
|---|
build, isApplicable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final java.util.Map<com.sun.xml.xsom.XSComplexType,org.kohsuke.rngom.nc.NameClass[]> characteristicNameClasses
XSComplexType to NameClass[2] that
represents the names used in its child elements [0] and
attributes [1].
protected final com.sun.xml.xsom.visitor.XSTermFunction<org.kohsuke.rngom.nc.NameClass> contentModelNameClassBuilder
| Constructor Detail |
|---|
AbstractExtendedComplexTypeBuilder()
| Method Detail |
|---|
protected boolean checkCollision(org.kohsuke.rngom.nc.NameClass anc,
org.kohsuke.rngom.nc.NameClass enc,
com.sun.xml.xsom.XSComplexType type)
protected com.sun.xml.xsom.XSComplexType getLastRestrictedType(com.sun.xml.xsom.XSComplexType t)
protected boolean checkIfExtensionSafe(com.sun.xml.xsom.XSComplexType baseType,
com.sun.xml.xsom.XSComplexType thisType)
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||