当前位置: 首页>>代码示例>>Java>>正文


Java XSSimpleType类代码示例

本文整理汇总了Java中com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType的典型用法代码示例。如果您正苦于以下问题:Java XSSimpleType类的具体用法?Java XSSimpleType怎么用?Java XSSimpleType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


XSSimpleType类属于com.sun.org.apache.xerces.internal.impl.dv包,在下文中一共展示了XSSimpleType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processAttributePSVI

import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType; //导入依赖的package包/类
/** Returns whether the given attribute is an ID type. **/
private boolean processAttributePSVI(AttrImpl attr, AttributePSVI attrPSVI) {
    if (fStorePSVI) {
        ((PSVIAttrNSImpl) attr).setPSVI (attrPSVI);
    }
    Object type = attrPSVI.getMemberTypeDefinition ();
    if (type == null) {
        type = attrPSVI.getTypeDefinition ();
        if (type != null) {
            attr.setType(type);
            return ((XSSimpleType) type).isIDType();
        }
    }
    else {
        attr.setType(type);
        return ((XSSimpleType) type).isIDType();
    }
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:DOMResultAugmentor.java

示例2: setNumeric

import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType; //导入依赖的package包/类
private void setNumeric(){
    if(fVariety == VARIETY_ATOMIC){
        this.fNumeric = fBase.fNumeric;
    }
    else if(fVariety == VARIETY_LIST){
        this.fNumeric = false;
    }
    else if(fVariety == VARIETY_UNION){
        XSSimpleType[] memberTypes = fMemberTypes;
        for(int i = 0 ; i < memberTypes.length ; i++){
            if(!memberTypes[i].getNumeric() ){
                this.fNumeric = false;
                return;
            }
        }
        this.fNumeric = true;
    }

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:XSSimpleTypeDecl.java

示例3: createBuiltInTypes

import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType; //导入依赖的package包/类
static void createBuiltInTypes() {
    final String ANYATOMICTYPE     = "anyAtomicType";
    final String DURATION          = "duration";
    final String YEARMONTHDURATION = "yearMonthDuration";
    final String DAYTIMEDURATION   = "dayTimeDuration";

    createBuiltInTypes(fBuiltInTypes, XSSimpleTypeDecl.fAnyAtomicType);

    // add anyAtomicType
    fBuiltInTypes.put(ANYATOMICTYPE, XSSimpleTypeDecl.fAnyAtomicType);

    // add 2 duration types
    XSSimpleTypeDecl durationDV = (XSSimpleTypeDecl)fBuiltInTypes.get(DURATION);
    fBuiltInTypes.put(YEARMONTHDURATION, new XSSimpleTypeDecl(durationDV, YEARMONTHDURATION, XSSimpleTypeDecl.DV_YEARMONTHDURATION, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSSimpleTypeDecl.YEARMONTHDURATION_DT));
    fBuiltInTypes.put(DAYTIMEDURATION, new XSSimpleTypeDecl(durationDV, DAYTIMEDURATION, XSSimpleTypeDecl.DV_DAYTIMEDURATION, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSSimpleTypeDecl.DAYTIMEDURATION_DT));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:ExtendedSchemaDVFactoryImpl.java

示例4: errorType

import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType; //导入依赖的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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:XSDSimpleTypeTraverser.java

示例5: contentRestore

import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType; //导入依赖的package包/类
private void contentRestore() {
    fAnnotations = (XSAnnotationImpl [])fGlobalStore[--fGlobalStorePos];
    fXSSimpleType = (XSSimpleType)fGlobalStore[--fGlobalStorePos];
    fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];
    fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos];
    fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos];
    int i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fBlock = (short)(i >> 16);
    fContentType = (short)i;
    i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fDerivedBy = (short)(i >> 16);
    fFinal = (short)i;
    fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos];
    fName = (String)fGlobalStore[--fGlobalStorePos];
    fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]).booleanValue();
    fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos];
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:XSDComplexTypeTraverser.java

示例6: containsQName

import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType; //导入依赖的package包/类
private boolean containsQName(XSSimpleType type) {
    if (type.getVariety() == XSSimpleType.VARIETY_ATOMIC) {
        short primitive = type.getPrimitiveKind();
        return (primitive == XSSimpleType.PRIMITIVE_QNAME ||
                primitive == XSSimpleType.PRIMITIVE_NOTATION);
    }
    else if (type.getVariety() == XSSimpleType.VARIETY_LIST) {
        return containsQName((XSSimpleType)type.getItemType());
    }
    else if (type.getVariety() == XSSimpleType.VARIETY_UNION) {
        XSObjectList members = type.getMemberTypes();
        for (int i = 0; i < members.getLength(); i++) {
            if (containsQName((XSSimpleType)members.item(i)))
                return true;
        }
    }
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:XSDAbstractTraverser.java

示例7: checkSimpleDerivationOk

import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType; //导入依赖的package包/类
/**
 * check whether simple type derived is valid derived from base,
 * given a subset of {restriction, extension}.
 */
public static boolean checkSimpleDerivationOk(XSSimpleType derived, XSTypeDefinition base, short block) {
    // if derived is anySimpleType, then it's valid only if the base
    // is ur-type
    if (derived == SchemaGrammar.fAnySimpleType) {
        return (base == SchemaGrammar.fAnyType ||
                base == SchemaGrammar.fAnySimpleType);
    }

    // if base is complex type
    if (base.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
        // if base is anyType, change base to anySimpleType,
        // otherwise, not valid
        if (base == SchemaGrammar.fAnyType)
            base = SchemaGrammar.fAnySimpleType;
        else
            return false;
    }
    return checkSimpleDerivation((XSSimpleType)derived,
            (XSSimpleType)base, block);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:XSConstraints.java

示例8: setValues

import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType; //导入依赖的package包/类
public void setValues(String name, String targetNamespace,
         XSTypeDefinition baseType, short derivedBy, short schemaFinal,
         short block, short contentType,
         boolean isAbstract, XSAttributeGroupDecl attrGrp,
         XSSimpleType simpleType, XSParticleDecl particle,
         XSObjectListImpl annotations) {
     fTargetNamespace = targetNamespace;
     fBaseType = baseType;
     fDerivedBy = derivedBy;
     fFinal = schemaFinal;
     fBlock = block;
     fContentType = contentType;
     if(isAbstract)
         fMiscFlags |= CT_IS_ABSTRACT;
     fAttrGrp = attrGrp;
     fXSSimpleType = simpleType;
     fParticle = particle;
     fAnnotations = annotations;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:XSComplexTypeDecl.java

示例9: contentRestore

import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType; //导入依赖的package包/类
private void contentRestore() {
    fAnnotations = (XSAnnotationImpl [])fGlobalStore[--fGlobalStorePos];
    fXSSimpleType = (XSSimpleType)fGlobalStore[--fGlobalStorePos];
    fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];
    fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos];
    fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos];
    int i = ((Integer)(fGlobalStore[--fGlobalStorePos]));
    fBlock = (short)(i >> 16);
    fContentType = (short)i;
    i = ((Integer)(fGlobalStore[--fGlobalStorePos]));
    fDerivedBy = (short)(i >> 16);
    fFinal = (short)i;
    fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos];
    fName = (String)fGlobalStore[--fGlobalStorePos];
    fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]);
    fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos];
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:XSDComplexTypeTraverser.java

示例10: checkExtraRules

import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType; //导入依赖的package包/类
private void checkExtraRules(ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException {

        Object ob = validatedInfo.actualValue;

        if (fVariety == VARIETY_ATOMIC) {

            fDVs[fValidationDV].checkExtraRules(ob, context);

        } else if (fVariety == VARIETY_LIST) {

            ListDV.ListData values = (ListDV.ListData)ob;
            XSSimpleType memberType = validatedInfo.memberType;
            int len = values.getLength();
            try {
                if (fItemType.fVariety == VARIETY_UNION) {
                    XSSimpleTypeDecl[] memberTypes = (XSSimpleTypeDecl[])validatedInfo.memberTypes;
                    for (int i = len-1; i >= 0; i--) {
                        validatedInfo.actualValue = values.item(i);
                        validatedInfo.memberType = memberTypes[i];
                        fItemType.checkExtraRules(context, validatedInfo);
                    }
                } else { // (fVariety == VARIETY_ATOMIC)
                    for (int i = len-1; i >= 0; i--) {
                        validatedInfo.actualValue = values.item(i);
                        fItemType.checkExtraRules(context, validatedInfo);
                    }
                }
            }
            finally {
                validatedInfo.actualValue = values;
                validatedInfo.memberType = memberType;
            }

        } else { // (fVariety == VARIETY_UNION)

            ((XSSimpleTypeDecl)validatedInfo.memberType).checkExtraRules(context, validatedInfo);

        }

    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:XSSimpleTypeDecl.java

示例11: createTypeUnion

import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType; //导入依赖的package包/类
/**
 * Create a new simple type which is derived by union from a list of other
 * simple types.
 *
 * @param name              name of the new type, could be null
 * @param targetNamespace   target namespace of the new type, could be null
 * @param finalSet          value of "final"
 * @param memberTypes       member types of the union type
 * @param annotations       set of annotations
 * @return                  the newly created simple type
 */
public XSSimpleType createTypeUnion(String name, String targetNamespace,
                                    short finalSet, XSSimpleType[] memberTypes,
                                    XSObjectList annotations) {
    int typeNum = memberTypes.length;
    XSSimpleTypeDecl[] mtypes = new XSSimpleTypeDecl[typeNum];
    System.arraycopy(memberTypes, 0, mtypes, 0, typeNum);

    if (fDeclPool != null) {
       XSSimpleTypeDecl st= fDeclPool.getSimpleTypeDecl();
       return st.setUnionValues(name, targetNamespace, finalSet, mtypes, annotations);
    }
    return new XSSimpleTypeDecl(name, targetNamespace, finalSet, mtypes, annotations);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:BaseSchemaDVFactory.java

示例12: traverseLocal

import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType; //导入依赖的package包/类
XSSimpleType traverseLocal(Element elmNode,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {

    // General Attribute Checking
    Object[] attrValues = fAttrChecker.checkAttributes(elmNode, false, schemaDoc);
    String name = genAnonTypeName(elmNode);
    XSSimpleType type = getSimpleType (name, elmNode, attrValues, schemaDoc, grammar);
    if (type instanceof XSSimpleTypeDecl) {
        ((XSSimpleTypeDecl)type).setAnonymous(true);
    }
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);

    return type;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:XSDSimpleTypeTraverser.java

示例13: traverseSimpleTypeDecl

import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType; //导入依赖的package包/类
private XSSimpleType traverseSimpleTypeDecl(Element simpleTypeDecl,
        Object[] attrValues,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {

    // get name and final values
    String name = (String)attrValues[XSAttributeChecker.ATTIDX_NAME];
    return getSimpleType(name, simpleTypeDecl, attrValues, schemaDoc, grammar);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:XSDSimpleTypeTraverser.java

示例14: isListDatatype

import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType; //导入依赖的package包/类
private boolean isListDatatype(XSSimpleType validator) {
    if (validator.getVariety() == XSSimpleType.VARIETY_LIST)
        return true;

    if (validator.getVariety() == XSSimpleType.VARIETY_UNION) {
        XSObjectList temp = validator.getMemberTypes();
        for (int i = 0; i < temp.getLength(); i++) {
            if (((XSSimpleType)temp.item(i)).getVariety() == XSSimpleType.VARIETY_LIST) {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:XSDSimpleTypeTraverser.java

示例15: checkNotationType

import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType; //导入依赖的package包/类
/**
 * Element/Attribute traversers call this method to check whether
 * the type is NOTATION without enumeration facet
 */
void checkNotationType(String refName, XSTypeDefinition typeDecl, Element elem) {
    if (typeDecl.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE &&
            ((XSSimpleType)typeDecl).getVariety() == XSSimpleType.VARIETY_ATOMIC &&
            ((XSSimpleType)typeDecl).getPrimitiveKind() == XSSimpleType.PRIMITIVE_NOTATION) {
        if ((((XSSimpleType)typeDecl).getDefinedFacets() & XSSimpleType.FACET_ENUMERATION) == 0) {
            reportSchemaError("enumeration-required-notation", new Object[]{typeDecl.getName(), refName, DOMUtil.getLocalName(elem)}, elem);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:XSDAbstractTraverser.java


注:本文中的com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。