本文整理汇总了Java中mf.org.apache.xerces.xs.XSConstants类的典型用法代码示例。如果您正苦于以下问题:Java XSConstants类的具体用法?Java XSConstants怎么用?Java XSConstants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XSConstants类属于mf.org.apache.xerces.xs包,在下文中一共展示了XSConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: XSSimpleTypeDecl
import mf.org.apache.xerces.xs.XSConstants; //导入依赖的package包/类
protected XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, boolean isImmutable,
XSObjectList annotations) {
fBase = fAnySimpleType;
fTypeName = name;
fTargetNamespace = uri;
fFinalSet = finalSet;
fAnnotations = annotations;
fVariety = VARIETY_LIST;
fItemType = (XSSimpleTypeDecl)itemType;
fValidationDV = DV_LIST;
fFacetsDefined = FACET_WHITESPACE;
fFixedFacet = FACET_WHITESPACE;
fWhiteSpace = WS_COLLAPSE;
//setting fundamental facets
calcFundamentalFacets();
fIsImmutable = isImmutable;
// Values of this type are lists
fBuiltInKind = XSConstants.LIST_DT;
}
示例2: setListValues
import mf.org.apache.xerces.xs.XSConstants; //导入依赖的package包/类
protected XSSimpleTypeDecl setListValues(String name, String uri, short finalSet, XSSimpleTypeDecl itemType,
XSObjectList annotations) {
//decline to do anything if the object is immutable.
if(fIsImmutable) return null;
fBase = fAnySimpleType;
fAnonymous = false;
fTypeName = name;
fTargetNamespace = uri;
fFinalSet = finalSet;
fAnnotations = annotations;
fVariety = VARIETY_LIST;
fItemType = (XSSimpleTypeDecl)itemType;
fValidationDV = DV_LIST;
fFacetsDefined = FACET_WHITESPACE;
fFixedFacet = FACET_WHITESPACE;
fWhiteSpace = WS_COLLAPSE;
//setting fundamental facets
calcFundamentalFacets();
// Values of this type are lists
fBuiltInKind = XSConstants.LIST_DT;
return this;
}
示例3: convertToPrimitiveKind
import mf.org.apache.xerces.xs.XSConstants; //导入依赖的package包/类
private short convertToPrimitiveKind(short valueType) {
/** Primitive datatypes. */
if (valueType <= XSConstants.NOTATION_DT) {
return valueType;
}
/** Types derived from string. */
if (valueType <= XSConstants.ENTITY_DT) {
return XSConstants.STRING_DT;
}
/** Types derived from decimal. */
if (valueType <= XSConstants.POSITIVEINTEGER_DT) {
return XSConstants.DECIMAL_DT;
}
/** Other types. */
return valueType;
}
示例4: convertToPrimitiveKind
import mf.org.apache.xerces.xs.XSConstants; //导入依赖的package包/类
/**
* Returns the primitive type of the given type.
* @param valueType A value type as defined in XSConstants.
* @return The primitive type from which valueType was derived.
*/
private static short convertToPrimitiveKind(short valueType) {
/** Primitive datatypes. */
if (valueType <= XSConstants.NOTATION_DT) {
return valueType;
}
/** Types derived from string. */
if (valueType <= XSConstants.ENTITY_DT) {
return XSConstants.STRING_DT;
}
/** Types derived from decimal. */
if (valueType <= XSConstants.POSITIVEINTEGER_DT) {
return XSConstants.DECIMAL_DT;
}
/** Other types. */
return valueType;
}
示例5: getDBMethods
import mf.org.apache.xerces.xs.XSConstants; //导入依赖的package包/类
private boolean getDBMethods(XSTypeDefinition typed, XSTypeDefinition typeb,
OneSubGroup methods) {
short dMethod = 0, bMethod = 0;
while (typed != typeb && typed != SchemaGrammar.fAnyType) {
if (typed.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE)
dMethod |= ((XSComplexTypeDecl)typed).fDerivedBy;
else
dMethod |= XSConstants.DERIVATION_RESTRICTION;
typed = typed.getBaseType();
// type == null means the current type is anySimpleType,
// whose base type should be anyType
if (typed == null)
typed = SchemaGrammar.fAnyType;
if (typed.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE)
bMethod |= ((XSComplexTypeDecl)typed).fBlock;
}
// No derivation relation, or blocked, return false
if (typed != typeb || (dMethod & bMethod) != 0)
return false;
// Remember the derivation methods and blocks, return true.
methods.dMethod = dMethod;
methods.bMethod = bMethod;
return true;
}
示例6: errorType
import mf.org.apache.xerces.xs.XSConstants; //导入依赖的package包/类
private XSSimpleType errorType(String name, String namespace, short refType) {
XSSimpleType stringType = (XSSimpleType)SchemaGrammar.SG_SchemaNS.getTypeDefinition("string");
switch (refType) {
case XSConstants.DERIVATION_RESTRICTION:
return fSchemaHandler.fDVFactory.createTypeRestriction(name, namespace, (short)0,
stringType, null);
case XSConstants.DERIVATION_LIST:
return fSchemaHandler.fDVFactory.createTypeList(name, namespace, (short)0,
stringType, null);
case XSConstants.DERIVATION_UNION:
return fSchemaHandler.fDVFactory.createTypeUnion(name, namespace, (short)0,
new XSSimpleType[]{stringType}, null);
}
return null;
}
示例7: expandRelatedComponents
import mf.org.apache.xerces.xs.XSConstants; //导入依赖的package包/类
private void expandRelatedComponents(XSObject component, Vector componentList, Hashtable dependencies) {
short componentType = component.getType();
switch (componentType) {
case XSConstants.TYPE_DEFINITION :
expandRelatedTypeComponents((XSTypeDefinition) component, componentList, component.getNamespace(), dependencies);
break;
case XSConstants.ATTRIBUTE_DECLARATION :
expandRelatedAttributeComponents((XSAttributeDeclaration) component, componentList, component.getNamespace(), dependencies);
break;
case XSConstants.ATTRIBUTE_GROUP :
expandRelatedAttributeGroupComponents((XSAttributeGroupDefinition) component, componentList, component.getNamespace(), dependencies);
case XSConstants.ELEMENT_DECLARATION :
expandRelatedElementComponents((XSElementDeclaration) component, componentList, component.getNamespace(), dependencies);
break;
case XSConstants.MODEL_GROUP_DEFINITION :
expandRelatedModelGroupDefinitionComponents((XSModelGroupDefinition) component, componentList, component.getNamespace(), dependencies);
case XSConstants.ATTRIBUTE_USE :
//expandRelatedAttributeUseComponents((XSAttributeUse)component, componentList, dependencies);
case XSConstants.NOTATION_DECLARATION :
case XSConstants.IDENTITY_CONSTRAINT :
default :
break;
}
}
示例8: reset
import mf.org.apache.xerces.xs.XSConstants; //导入依赖的package包/类
public void reset(){
fName = null;
fTargetNamespace = null;
fBaseType = null;
fDerivedBy = XSConstants.DERIVATION_RESTRICTION;
fFinal = XSConstants.DERIVATION_NONE;
fBlock = XSConstants.DERIVATION_NONE;
fMiscFlags = 0;
// reset attribute group
fAttrGrp.reset();
fContentType = CONTENTTYPE_EMPTY;
fXSSimpleType = null;
fParticle = null;
fCMValidator = null;
fUPACMValidator = null;
if(fAnnotations != null) {
// help out the garbage collector
fAnnotations.clearXSObjectList();
}
fAnnotations = null;
}
示例9: buildSubGroups_Org
import mf.org.apache.xerces.xs.XSConstants; //导入依赖的package包/类
private SymbolHash buildSubGroups_Org() {
SubstitutionGroupHandler sgHandler = new SubstitutionGroupHandler(null);
for (int i = 0 ; i < fGrammarCount; i++) {
sgHandler.addSubstitutionGroup(fGrammarList[i].getSubstitutionGroups());
}
final XSNamedMap elements = getComponents(XSConstants.ELEMENT_DECLARATION);
final int len = elements.getLength();
final SymbolHash subGroupMap = new SymbolHash(len*2);
XSElementDecl head;
XSElementDeclaration[] subGroup;
for (int i = 0; i < len; i++) {
head = (XSElementDecl)elements.item(i);
subGroup = sgHandler.getSubstitutionGroup(head);
subGroupMap.put(head, subGroup.length > 0 ?
new XSObjectListImpl(subGroup, subGroup.length) : XSObjectListImpl.EMPTY_LIST);
}
return subGroupMap;
}
示例10: reset
import mf.org.apache.xerces.xs.XSConstants; //导入依赖的package包/类
/**
* Reset current element declaration
*/
public void reset(){
fScope = XSConstants.SCOPE_ABSENT;
fName = null;
fTargetNamespace = null;
fType = null;
fUnresolvedTypeName = null;
fMiscFlags = 0;
fBlock = XSConstants.DERIVATION_NONE;
fFinal = XSConstants.DERIVATION_NONE;
fDefault = null;
fAnnotations = null;
fSubGroup = null;
// reset identity constraints
for (int i=0;i<fIDCPos;i++) {
fIDConstraints[i] = null;
}
fIDCPos = 0;
}
示例11: setUnionValues
import mf.org.apache.xerces.xs.XSConstants; //导入依赖的package包/类
protected XSSimpleTypeDecl setUnionValues(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes,
XSObjectList annotations) {
//decline to do anything if the object is immutable.
if(fIsImmutable) return null;
fBase = fAnySimpleType;
fAnonymous = false;
fTypeName = name;
fTargetNamespace = uri;
fFinalSet = finalSet;
fAnnotations = annotations;
fVariety = VARIETY_UNION;
fMemberTypes = memberTypes;
fValidationDV = DV_UNION;
// even for union, we set whitespace to something
// this will never be used, but we can use fFacetsDefined to check
// whether applyFacets() is allwwed: it's not allowed
// if fFacetsDefined != 0
fFacetsDefined = FACET_WHITESPACE;
fWhiteSpace = WS_COLLAPSE;
//setting fundamental facets
calcFundamentalFacets();
// No value can be of this type, so it's unavailable.
fBuiltInKind = XSConstants.UNAVAILABLE_DT;
return this;
}
示例12: reset
import mf.org.apache.xerces.xs.XSConstants; //导入依赖的package包/类
/**
* reset the state of this object
*/
public void reset() {
this.normalizedValue = null;
this.actualValue = null;
this.actualValueType = XSConstants.UNAVAILABLE_DT;
this.actualType = null;
this.memberType = null;
this.memberTypes = null;
this.itemValueTypes = null;
}
示例13: isComparable
import mf.org.apache.xerces.xs.XSConstants; //导入依赖的package包/类
/**
* Returns true if the two ValidatedInfo objects can be compared in the same
* value space.
*/
public static boolean isComparable(ValidatedInfo info1, ValidatedInfo info2) {
final short primitiveType1 = convertToPrimitiveKind(info1.actualValueType);
final short primitiveType2 = convertToPrimitiveKind(info2.actualValueType);
if (primitiveType1 != primitiveType2) {
return (primitiveType1 == XSConstants.ANYSIMPLETYPE_DT && primitiveType2 == XSConstants.STRING_DT ||
primitiveType1 == XSConstants.STRING_DT && primitiveType2 == XSConstants.ANYSIMPLETYPE_DT);
}
else if (primitiveType1 == XSConstants.LIST_DT || primitiveType1 == XSConstants.LISTOFUNION_DT) {
final ShortList typeList1 = info1.itemValueTypes;
final ShortList typeList2 = info2.itemValueTypes;
final int typeList1Length = typeList1 != null ? typeList1.getLength() : 0;
final int typeList2Length = typeList2 != null ? typeList2.getLength() : 0;
if (typeList1Length != typeList2Length) {
return false;
}
for (int i = 0; i < typeList1Length; ++i) {
final short primitiveItem1 = convertToPrimitiveKind(typeList1.item(i));
final short primitiveItem2 = convertToPrimitiveKind(typeList2.item(i));
if (primitiveItem1 != primitiveItem2) {
if (primitiveItem1 == XSConstants.ANYSIMPLETYPE_DT && primitiveItem2 == XSConstants.STRING_DT ||
primitiveItem1 == XSConstants.STRING_DT && primitiveItem2 == XSConstants.ANYSIMPLETYPE_DT) {
continue;
}
return false;
}
}
}
return true;
}
示例14: copyFrom
import mf.org.apache.xerces.xs.XSConstants; //导入依赖的package包/类
public void copyFrom(XSValue o) {
if (o == null) {
reset();
}
else if (o instanceof ValidatedInfo) {
ValidatedInfo other = (ValidatedInfo)o;
normalizedValue = other.normalizedValue;
actualValue = other.actualValue;
actualValueType = other.actualValueType;
actualType = other.actualType;
memberType = other.memberType;
memberTypes = other.memberTypes;
itemValueTypes = other.itemValueTypes;
}
else {
normalizedValue = o.getNormalizedValue();
actualValue = o.getActualValue();
actualValueType = o.getActualValueType();
actualType = (XSSimpleType)o.getTypeDefinition();
memberType = (XSSimpleType)o.getMemberTypeDefinition();
XSSimpleType realType = memberType == null ? actualType : memberType;
if (realType != null && realType.getBuiltInKind() == XSConstants.LISTOFUNION_DT) {
XSObjectList members = o.getMemberTypeDefinitions();
memberTypes = new XSSimpleType[members.getLength()];
for (int i = 0; i < members.getLength(); i++) {
memberTypes[i] = (XSSimpleType)members.get(i);
}
}
else {
memberTypes = null;
}
itemValueTypes = o.getListValueTypes();
}
}
示例15: getMatchingElemDecl
import mf.org.apache.xerces.xs.XSConstants; //导入依赖的package包/类
public XSElementDecl getMatchingElemDecl(QName element, XSElementDecl exemplar) {
if (element.localpart == exemplar.fName &&
element.uri == exemplar.fTargetNamespace) {
return exemplar;
}
// if the exemplar is not a global element decl, then it's not possible
// to be substituted by another element.
if (exemplar.fScope != XSConstants.SCOPE_GLOBAL) {
return null;
}
// if the decl blocks substitution, return false
if ((exemplar.fBlock & XSConstants.DERIVATION_SUBSTITUTION) != 0) {
return null;
}
// get the decl for the element
XSElementDecl eDecl = fXSElementDeclHelper.getGlobalElementDecl(element);
if (eDecl == null) {
return null;
}
// and check by using substitutionGroup information
if (substitutionGroupOK(eDecl, exemplar, exemplar.fBlock)) {
return eDecl;
}
return null;
}