本文整理汇总了Java中com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition类的典型用法代码示例。如果您正苦于以下问题:Java XSSimpleTypeDefinition类的具体用法?Java XSSimpleTypeDefinition怎么用?Java XSSimpleTypeDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XSSimpleTypeDefinition类属于com.sun.org.apache.xerces.internal.xs包,在下文中一共展示了XSSimpleTypeDefinition类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isDerivedByList
import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
/**
* Checks if a type is derived from another by list. See:
* http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom
*
* @param ancestorNS
* The namspace of the ancestor type declaration
* @param ancestorName
* The name of the ancestor type declaration
* @param type
* The reference type definition
*
* @return boolean True if the type is derived by list for the reference type
*/
private boolean isDerivedByList (String ancestorNS, String ancestorName, XSTypeDefinition type) {
// If the variety is union
if (type !=null && ((XSSimpleTypeDefinition)type).getVariety() == VARIETY_LIST) {
// get the {item type}
XSTypeDefinition itemType = ((XSSimpleTypeDefinition)type).getItemType();
// T2 is the {item type definition}
if (itemType != null) {
// T2 is derived from the other type definition by DERIVATION_RESTRICTION
if (isDerivedByRestriction(ancestorNS, ancestorName, itemType)) {
return true;
}
}
}
return false;
}
示例2: isDerivedByUnion
import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
/**
* Checks if a type is derived from another by union. See:
* http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom
*
* @param ancestorNS
* The namspace of the ancestor type declaration
* @param ancestorName
* The name of the ancestor type declaration
* @param type
* The reference type definition
*
* @return boolean True if the type is derived by union for the reference type
*/
private boolean isDerivedByUnion (String ancestorNS, String ancestorName, XSTypeDefinition type) {
// If the variety is union
if (type !=null && ((XSSimpleTypeDefinition)type).getVariety() == VARIETY_UNION) {
// get member types
XSObjectList memberTypes = ((XSSimpleTypeDefinition)type).getMemberTypes();
for (int i = 0; i < memberTypes.getLength(); i++) {
// One of the {member type definitions} is T2.
if (memberTypes.item(i) != null) {
// T2 is derived from the other type definition by DERIVATION_RESTRICTION
if (isDerivedByRestriction(ancestorNS, ancestorName,(XSSimpleTypeDefinition)memberTypes.item(i))) {
return true;
}
}
}
}
return false;
}
示例3: expandRelatedSimpleTypeComponents
import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
private void expandRelatedSimpleTypeComponents(XSSimpleTypeDefinition type, Vector componentList, String namespace, Map<String, Vector> dependencies) {
final XSTypeDefinition baseType = type.getBaseType();
if (baseType != null) {
addRelatedType(baseType, componentList, namespace, dependencies);
}
final XSTypeDefinition itemType = type.getItemType();
if (itemType != null) {
addRelatedType(itemType, componentList, namespace, dependencies);
}
final XSTypeDefinition primitiveType = type.getPrimitiveType();
if (primitiveType != null) {
addRelatedType(primitiveType, componentList, namespace, dependencies);
}
final XSObjectList memberTypes = type.getMemberTypes();
if (memberTypes.size() > 0) {
for (int i=0; i<memberTypes.size(); i++) {
addRelatedType((XSTypeDefinition)memberTypes.item(i), componentList, namespace, dependencies);
}
}
}
示例4: facetKindToString
import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
public static String facetKindToString(short facetKind) {
switch(facetKind) {
case XSSimpleTypeDefinition.FACET_MINLENGTH: return "minLength";
case XSSimpleTypeDefinition.FACET_MAXLENGTH: return "maxLength";
case XSSimpleTypeDefinition.FACET_PATTERN: return "pattern";
case XSSimpleTypeDefinition.FACET_MAXINCLUSIVE: return "maximum";
case XSSimpleTypeDefinition.FACET_MININCLUSIVE: return "minimum";
//
// case XSSimpleTypeDefinition.FACET_NONE: return "none";
// case XSSimpleTypeDefinition.FACET_LENGTH: return "length";
// case XSSimpleTypeDefinition.FACET_WHITESPACE: return "whitespace";
// case XSSimpleTypeDefinition.FACET_MAXEXCLUSIVE: return "maxExclusive";
// case XSSimpleTypeDefinition.FACET_MINEXCLUSIVE: return "minExclusive";
// case XSSimpleTypeDefinition.FACET_TOTALDIGITS: return "totalDigits";
// case XSSimpleTypeDefinition.FACET_FRACTIONDIGITS: return "fractionDigits";
// case XSSimpleTypeDefinition.FACET_ENUMERATION: return "enumeration";
// default: return "unknown facet kind";
default: return null;
}
}
示例5: iterateComplexType
import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
private List<JSElement> iterateComplexType(final XSComplexTypeDefinition complexType) {
final List<JSElement> result = new ArrayList<>();
final XSParticle xsParticle = complexType.getParticle();
if (xsParticle != null) {
result.addAll(iterateParticle(xsParticle));
} else {
final XSSimpleTypeDefinition xsSimpleType = complexType.getSimpleType();
if (xsSimpleType != null) {
result.add(iterateSimpleType(xsSimpleType));
}
}
iterateComplexAttributes(complexType, result);
return result;
}
示例6: getPrimitiveType
import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
/**
* If variety is <code>atomic</code> the primitive type definition (a
* built-in primitive datatype definition or the simple ur-type
* definition) is available, otherwise <code>null</code>.
*/
public XSSimpleTypeDefinition getPrimitiveType() {
if (fVariety == VARIETY_ATOMIC && fValidationDV != DV_ANYSIMPLETYPE) {
XSSimpleTypeDecl pri = this;
// recursively get base, until we reach anySimpleType
while (pri.fBase != fAnySimpleType)
pri = pri.fBase;
return pri;
}
else {
// REVISIT: error situation. runtime exception?
return null;
}
}
示例7: getItemType
import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
/**
* If variety is <code>list</code> the item type definition (an atomic or
* union simple type definition) is available, otherwise
* <code>null</code>.
*/
public XSSimpleTypeDefinition getItemType() {
if (fVariety == VARIETY_LIST) {
return fItemType;
}
else {
// REVISIT: error situation. runtime exception?
return null;
}
}
示例8: expandRelatedTypeComponents
import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
private void expandRelatedTypeComponents(XSTypeDefinition type, Vector componentList, String namespace, Map<String, Vector> dependencies) {
if (type instanceof XSComplexTypeDecl) {
expandRelatedComplexTypeComponents((XSComplexTypeDecl) type, componentList, namespace, dependencies);
}
else if (type instanceof XSSimpleTypeDecl) {
expandRelatedSimpleTypeComponents((XSSimpleTypeDefinition) type, componentList, namespace, dependencies);
}
}
示例9: getSchemaTypeName
import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
public static String getSchemaTypeName(XSTypeDefinition typeDefn) {
String typeNameStr;
if (typeDefn instanceof XSSimpleTypeDefinition) {
typeNameStr = ((XSSimpleTypeDecl) typeDefn).getTypeName();
}
else {
typeNameStr = ((XSComplexTypeDecl) typeDefn).getTypeName();
}
return typeNameStr;
}