本文整理汇总了Java中com.sun.xml.internal.xsom.XSType.RESTRICTION属性的典型用法代码示例。如果您正苦于以下问题:Java XSType.RESTRICTION属性的具体用法?Java XSType.RESTRICTION怎么用?Java XSType.RESTRICTION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.sun.xml.internal.xsom.XSType
的用法示例。
在下文中一共展示了XSType.RESTRICTION属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLastRestrictedType
/**
* Looks for the derivation chain t_1 > t_2 > ... > t
* and find t_i such that t_i derives by restriction but
* for every j>i, t_j derives by extension.
*
* @return null
* If there's no such t_i or if t_i is any type.
*/
protected XSComplexType getLastRestrictedType(XSComplexType t) {
if (t.getBaseType() == schemas.getAnyType()) {
return null; // we don't count the restriction from anyType
}
if (t.getDerivationMethod() == XSType.RESTRICTION) {
return t;
}
XSComplexType baseType = t.getBaseType().asComplexType();
if (baseType != null) {
return getLastRestrictedType(baseType);
} else {
return null;
}
}
示例2: updateSubstitutabilityMap
public void updateSubstitutabilityMap() {
ElementDecl parent = this;
XSType type = this.getType();
boolean rused = false;
boolean eused = false;
while( (parent=(ElementDecl)parent.getSubstAffiliation())!=null ) {
if(parent.isSubstitutionDisallowed(XSType.SUBSTITUTION))
continue;
boolean rd = parent.isSubstitutionDisallowed(XSType.RESTRICTION);
boolean ed = parent.isSubstitutionDisallowed(XSType.EXTENSION);
if( (rd && rused) || ( ed && eused ) ) continue;
XSType parentType = parent.getType();
while (type!=parentType) {
if(type.getDerivationMethod()==XSType.RESTRICTION) rused = true;
else eused = true;
type = type.getBaseType();
if(type==null) // parentType and type doesn't share the common base type. a bug in the schema.
break;
if( type.isComplexType() ) {
rd |= type.asComplexType().isSubstitutionProhibited(XSType.RESTRICTION);
ed |= type.asComplexType().isSubstitutionProhibited(XSType.EXTENSION);
}
if (getRoot().getAnyType().equals(type)) break;
}
if( (rd && rused) || ( ed && eused ) ) continue;
// this element can substitute "parent"
parent.addSubstitutable(this);
}
}
示例3: isApplicable
public boolean isApplicable(XSComplexType ct) {
XSType baseType = ct.getBaseType();
return baseType!=schemas.getAnyType()
&& baseType.isComplexType()
&& ct.getDerivationMethod()==XSType.RESTRICTION;
}
示例4: getDerivationMethod
public int getDerivationMethod() { return XSType.RESTRICTION; }
示例5: getDerivationMethod
public final int getDerivationMethod() { return XSType.RESTRICTION; }