• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java XSSimpleTypeDefinition类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: checkComplexType

import org.apache.xerces.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
public static boolean checkComplexType(XSTypeDefinition td) {
    if (td.getTypeCategory() != XSTypeDefinition.COMPLEX_TYPE) {
        return false;
    }
    XSComplexTypeDefinition ctd = (XSComplexTypeDefinition) td;
    if (ctd.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_ELEMENT) {
        return true;
    }
    if ((td instanceof XSComplexTypeDecl) && ((XSComplexTypeDecl) td).getAbstract()) {
        return true;
    }
    if (TEXT_ELEMENTS_ARE_COMPLEX) {
        return true;
    }
    if (ctd.getAttributeUses() != null) {
        for (int i = 0; i < ctd.getAttributeUses().getLength(); i++) {
            XSSimpleTypeDefinition xsstd = ((XSAttributeUse) ctd.getAttributeUses().item(i)).getAttrDeclaration()
                                                                                            .getTypeDefinition();
            if ("ID".equals(xsstd.getName())) {
                continue;
            }
            return true;
        }
    }
    return false;
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:27,代码来源:XSDModelLoader.java


示例2: checkBooleanType

import org.apache.xerces.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
private static boolean checkBooleanType(XSTypeDefinition td) {
    if (td.getTypeCategory() != XSTypeDefinition.SIMPLE_TYPE) {
        return false;
    }
    final XSSimpleTypeDefinition st = ((XSSimpleTypeDefinition) td);
    final XSObjectList facets = st.getFacets();
    for (int i = 0; i < facets.getLength(); i++) {
        final XSFacet facet = (XSFacet) facets.item(i);
        if (facet.getFacetKind() == XSSimpleTypeDefinition.FACET_LENGTH) {
            if ("0".equals(facet.getLexicalFacetValue())) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:17,代码来源:XSDModelLoader.java


示例3: getSimpleTypesString

import org.apache.xerces.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
private static String getSimpleTypesString(XSTypeDefinition et) {
    StringBuffer typesHierarchy = new StringBuffer();
    while (et != null && !"anySimpleType".equals(et.getName()) && !"anyType".equals(et.getName()) && et.getNamespace() != null) {
        typesHierarchy.append(et.getNamespace().substring(et.getNamespace().lastIndexOf("/") + 1))
                      .append(":")
                      .append(et.getName())
                      .append(";");
        if (et instanceof XSSimpleType) {
            XSSimpleType simpleType = (XSSimpleType) et;
            if (simpleType.getVariety() == XSSimpleTypeDefinition.VARIETY_LIST
                || simpleType.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION) {
                XSObjectList list = simpleType.getMemberTypes();
                if (list.getLength() > 0) {
                    typesHierarchy.append("{");
                    for (int i = 0; i < list.getLength(); i++) {
                        typesHierarchy.append(getSimpleTypesString((XSTypeDefinition) list.item(i)));
                    }
                    typesHierarchy.append("}");
                }
            }
        }
        et = et.getBaseType();
    }
    return typesHierarchy.toString();
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:26,代码来源:XSDModelLoader.java


示例4: setPSVI

import org.apache.xerces.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
/**
 * Copy PSVI properties from another psvi item.
 * 
 * @param elem  the source of element PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fErrorMessages = elem.getErrorMessages();
    if (fTypeDecl instanceof XSSimpleTypeDefinition ||
            fTypeDecl instanceof XSComplexTypeDefinition &&
            ((XSComplexTypeDefinition)fTypeDecl).getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE) {
        this.fValue.copyFrom(elem.getSchemaValue());
    }
    else {
        this.fValue.reset();
    }
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:27,代码来源:PSVIElementNSImpl.java


示例5: isDerivedByList

import org.apache.xerces.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;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:32,代码来源:XSSimpleTypeDecl.java


示例6: isDerivedByUnion

import org.apache.xerces.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;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:34,代码来源:XSSimpleTypeDecl.java


示例7: expandRelatedSimpleTypeComponents

import org.apache.xerces.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
private void expandRelatedSimpleTypeComponents(XSSimpleTypeDefinition type, Vector componentList, String namespace, Hashtable 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);
        }
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:24,代码来源:XSDHandler.java


示例8: processEnumType

import org.apache.xerces.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
public void processEnumType(
    XSTypeDefinition def,
    Map<String, TypeDesc> jtMap,
    Map<String, NamespaceDesc> nsdMap
) throws Exception {
    boolean complexType = def instanceof XSComplexTypeDefinition;
    if (!nsdMap.containsKey(def.getNamespace())) {
        Util.log("Namespace desc not found for: " + def);
    }
    final String typeName = toJavaTypeName(def, nsdMap);
    final TypeDesc td = new TypeDesc(def.getName(), def.getNamespace(), typeName, TypeDesc.TypeEnum.ENUM);
    final XSComplexTypeDefinition ct = complexType ? (XSComplexTypeDefinition) def : null;
    final XSSimpleTypeDefinition st = (XSSimpleTypeDefinition) (complexType
                                                                    ? ((XSComplexTypeDefinition) def).getSimpleType()
                                                                    : def);
    for (int i = 0; i < st.getLexicalEnumeration().getLength(); i++) {
        final String s = st.getLexicalEnumeration().item(i);
        td.fdMap.put(s, new FieldDesc(Util.computeEnumConstantName(s, td.name), s));
    }

    final XSObjectList anns = complexType ? ct.getAnnotations() : st.getAnnotations();

    td.documentation = parseAnnotationString(
        "Enumeration " + def.getNamespace() + ":" + def.getName() + " documentation",
        anns != null && anns.getLength() > 0
            ? ((XSAnnotation) anns.item(0)).getAnnotationString()
            : null
    );
    jtMap.put(model.toJavaQualifiedTypeName(def, nsdMap, true), td);
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:31,代码来源:XSDModelLoader.java


示例9: getSimpleDatatypeFor

import org.apache.xerces.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
public static Datatype getSimpleDatatypeFor(String schemaAsString,
		String typeName, String typeURI) throws EXIException {
	XSDGrammarsBuilder xsdGB = XSDGrammarsBuilder.newInstance();
	ByteArrayInputStream bais = new ByteArrayInputStream(
			schemaAsString.getBytes());
	xsdGB.loadGrammars(bais);
	xsdGB.toGrammars();

	XSModel xsModel = xsdGB.getXSModel();

	XSTypeDefinition td = xsModel.getTypeDefinition(typeName, typeURI);

	assertTrue("SimpleType expected",
			td.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE);

	Datatype dt = xsdGB.getDatatype((XSSimpleTypeDefinition) td);

	return dt;
}
 
开发者ID:EXIficient,项目名称:exificient,代码行数:20,代码来源:DatatypeMappingTest.java


示例10: manageSimpleTypeElement

import org.apache.xerces.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
private void manageSimpleTypeElement(IXSDNode currentNode, XSParticleDecl fatherParticle, XSElementDecl currentElementDeclaration) {
    XSSimpleTypeDefinition simpleTypeDefinition = (XSSimpleTypeDefinition) currentElementDeclaration.getTypeDefinition();
    if (logger.isDebugEnabled()) logger.debug("Found a simple type: " + currentElementDeclaration.getName() + " with type: " + simpleTypeDefinition.getBuiltInKind());
    SimpleType simpleType = new SimpleType(getLeafType(simpleTypeDefinition.getBuiltInKind()));
    currentNode.addChild(simpleType);
    setCardinality(currentNode, fatherParticle);
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:8,代码来源:GenerateXSDNodeTree.java


示例11: processAttribute

import org.apache.xerces.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
private void processAttribute(Path parent, String path, XSAttributeUse xsAttribute) throws BagriException {
  	
   path += "/@" + xsAttribute.getAttrDeclaration().getName();
   XSSimpleTypeDefinition std = xsAttribute.getAttrDeclaration().getTypeDefinition();
   Occurrence occurrence = Occurrence.getOccurrence(
   		xsAttribute.getRequired() ? 1 : 0,
   		std.getVariety() == XSSimpleTypeDefinition.VARIETY_LIST ? -1 : 1);
Path xp = modelMgr.translatePath(parent.getRoot(), path, NodeKind.attribute, parent.getPathId(), getBaseType(std), occurrence);
logger.trace("processAttribute; attribute: {}; type: {}; got XDMPath: {}", path, std, xp); 
  }
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:11,代码来源:XmlModeler.java


示例12: getPrimitiveType

import org.apache.xerces.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;
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:19,代码来源:XSSimpleTypeDecl.java


示例13: getItemType

import org.apache.xerces.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;
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:15,代码来源:XSSimpleTypeDecl.java


示例14: expandRelatedTypeComponents

import org.apache.xerces.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
private void expandRelatedTypeComponents(XSTypeDefinition type, Vector componentList, String namespace, Hashtable dependencies) {
    if (type instanceof XSComplexTypeDecl) {
        expandRelatedComplexTypeComponents((XSComplexTypeDecl) type, componentList, namespace, dependencies);
    }
    else if (type instanceof XSSimpleTypeDecl) {
        expandRelatedSimpleTypeComponents((XSSimpleTypeDefinition) type, componentList, namespace, dependencies);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:9,代码来源:XSDHandler.java


示例15: processPSVITypeDefinition

import org.apache.xerces.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
private void processPSVITypeDefinition(XSTypeDefinition type) {
    if (type == null)
        return;
    if (type.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
        processPSVIComplexTypeDefinition((XSComplexTypeDefinition)type);
    }
    else if (type.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
        processPSVISimpleTypeDefinition((XSSimpleTypeDefinition)type);
    }
    else {
        throw new IllegalArgumentException(
            "Unknown type definition value: " + type.getType());
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:15,代码来源:PSVIWriter.java


示例16: processPSVIComplexTypeDefinition

import org.apache.xerces.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
private void processPSVIComplexTypeDefinition(XSComplexTypeDefinition type) {
    if (type == null)
        return;
    sendIndentedElementWithID("psv:complexTypeDefinition", type);
    sendElementEvent("psv:name", type.getName());
    sendElementEvent("psv:targetNamespace", type.getNamespace());
    processPSVITypeDefinitionOrRef(
        "psv:baseTypeDefinition",
        type.getBaseType());
    sendElementEvent(
        "psv:derivationMethod",
        this.translateDerivation(type.getDerivationMethod()));
    sendElementEvent("psv:final", this.translateBlockOrFinal(type.getFinal()));
    sendElementEvent("psv:abstract", String.valueOf(type.getAbstract()));
    processPSVIAttributeUses(type.getAttributeUses());
    processPSVIAttributeWildcard(type.getAttributeWildcard());
    sendIndentedElement("psv:contentType");
    sendElementEvent(
        "psv:variety",
        this.translateContentType(type.getContentType()));
    XSSimpleTypeDefinition simpleType = type.getSimpleType();
    if(simpleType == null || (!simpleType.getAnonymous() || fDefined.contains(this.getID(simpleType)))) {
        processPSVIElementRef("psv:simpleTypeDefinition", simpleType);
    }
    else {
        processPSVISimpleTypeDefinition(simpleType);
    }
    processPSVIParticle(type.getParticle());
    sendUnIndentedElement("psv:contentType");
    sendElementEvent(
        "psv:prohibitedSubstitutions",
        this.translateBlockOrFinal(type.getProhibitedSubstitutions()));
    processPSVIAnnotations(type.getAnnotations());
    sendUnIndentedElement("psv:complexTypeDefinition");
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:36,代码来源:PSVIWriter.java


示例17: translateFacetKind

import org.apache.xerces.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
private String translateFacetKind(short kind) {
    switch (kind) {
        case XSSimpleTypeDefinition.FACET_WHITESPACE :
            return SchemaSymbols.ELT_WHITESPACE;
        case XSSimpleTypeDefinition.FACET_LENGTH :
            return SchemaSymbols.ELT_LENGTH;
        case XSSimpleTypeDefinition.FACET_MINLENGTH :
            return SchemaSymbols.ELT_MINLENGTH;
        case XSSimpleTypeDefinition.FACET_MAXLENGTH :
            return SchemaSymbols.ELT_MAXLENGTH;
        case XSSimpleTypeDefinition.FACET_TOTALDIGITS :
            return SchemaSymbols.ELT_TOTALDIGITS;
        case XSSimpleTypeDefinition.FACET_FRACTIONDIGITS :
            return SchemaSymbols.ELT_FRACTIONDIGITS;
        case XSSimpleTypeDefinition.FACET_PATTERN :
            return SchemaSymbols.ELT_PATTERN;
        case XSSimpleTypeDefinition.FACET_ENUMERATION :
            return SchemaSymbols.ELT_ENUMERATION;
        case XSSimpleTypeDefinition.FACET_MAXINCLUSIVE :
            return SchemaSymbols.ELT_MAXINCLUSIVE;
        case XSSimpleTypeDefinition.FACET_MAXEXCLUSIVE :
            return SchemaSymbols.ELT_MAXEXCLUSIVE;
        case XSSimpleTypeDefinition.FACET_MINEXCLUSIVE :
            return SchemaSymbols.ELT_MINEXCLUSIVE;
        case XSSimpleTypeDefinition.FACET_MININCLUSIVE :
            return SchemaSymbols.ELT_MININCLUSIVE;
        default :
            return "unknown";
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:31,代码来源:PSVIWriter.java


示例18: translateVariety

import org.apache.xerces.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
private String translateVariety(short var) {
    switch (var) {
        case XSSimpleTypeDefinition.VARIETY_LIST :
            return "list";
        case XSSimpleTypeDefinition.VARIETY_UNION :
            return "union";
        case XSSimpleTypeDefinition.VARIETY_ATOMIC :
            return "atomic";
        case XSSimpleTypeDefinition.VARIETY_ABSENT :
            return null;
        default :
            return "unknown";
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:15,代码来源:PSVIWriter.java


示例19: translateOrdered

import org.apache.xerces.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
private String translateOrdered(short ordered) {
    switch (ordered) {
        case XSSimpleTypeDefinition.ORDERED_FALSE :
            return "false";
        case XSSimpleTypeDefinition.ORDERED_PARTIAL :
            return "partial";
        case XSSimpleTypeDefinition.ORDERED_TOTAL :
            return "total";
        default :
            return "unknown";
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:13,代码来源:PSVIWriter.java


示例20: setAttribute

import org.apache.xerces.xs.XSSimpleTypeDefinition; //导入依赖的package包/类
@Override
public void setAttribute(String name, String value, XSSimpleTypeDefinition attTypeDefinition) {
	JsonElementContainer attributeContainer = new JsonElementContainer(attributePrefix+name, false, false, false, attributePrefix);
	if (attTypeDefinition.getNumeric()) {
		attributeContainer.setNumber(true);
	}
	attributeContainer.setContent(value);
	addContent(attributeContainer);
}
 
开发者ID:ibissource,项目名称:iaf,代码行数:10,代码来源:JsonElementContainer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HorizontalBarHighlighter类代码示例发布时间:2022-05-23
下一篇:
Java ShadowLocationManager类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap