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


Java XSObjectList类代码示例

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


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

示例1: dumpParticle

import org.apache.xerces.xs.XSObjectList; //导入依赖的package包/类
private static void dumpParticle(String path, XSParticle particle)
{
   XSTerm term = particle.getTerm();

   switch (term.getType())
   {
      case XSConstants.ELEMENT_DECLARATION:
         dumpElement(path, (XSElementDeclaration) term);
         break;
      case XSConstants.MODEL_GROUP:
         XSModelGroup model_group = (XSModelGroup) term;
         final XSObjectList particles = model_group.getParticles();

         for (int ipar = 0; ipar < particles.getLength(); ipar++)
         {
            dumpParticle(path, (XSParticle) particles.item(ipar));
         }
         break;
      default:
         System.err.println(path + " - UNKNOWN");
   }

}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:24,代码来源:SentinelXsdDumpMetadata.java

示例2: checkBooleanType

import org.apache.xerces.xs.XSObjectList; //导入依赖的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.XSObjectList; //导入依赖的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: parseXbrlTaxonomy

import org.apache.xerces.xs.XSObjectList; //导入依赖的package包/类
private XbrlTaxonomy parseXbrlTaxonomy(XSElementDeclaration elementDec) throws XbrlException{
	//should only contain the synthetic annotation for the attributes
	XSObjectList list = elementDec.getAnnotations();
	if(list.getLength() != 1)
		throw new XbrlException("element with ns: " + elementDec.getNamespace() + " name: " + elementDec.getName() + " has unexpected number of annotations:" + list.getLength());
	
	try{
		XSAnnotation attributeObj = (XSAnnotation)list.item(0);

		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
		DocumentBuilder builder = factory.newDocumentBuilder();
		Document doc = builder.newDocument();
		attributeObj.writeAnnotation(doc, XSAnnotation.W3C_DOM_DOCUMENT);
		NamedNodeMap attributes = doc.getFirstChild().getAttributes();
		XbrlTaxonomy xbrlTaxonomy = new XbrlTaxonomy(elementDec, attributes);
		return xbrlTaxonomy;
	}
	catch(Exception e){
		
	}
	return null;
}
 
开发者ID:chen4119,项目名称:tempeh,代码行数:23,代码来源:XbrlElementHandler.java

示例5: analyzeAttributes

import org.apache.xerces.xs.XSObjectList; //导入依赖的package包/类
private void analyzeAttributes(IXSDNode currentNode, XSElementDecl currentElementDeclaration) {
    XSComplexTypeDefinition complexTypeDefinition = (XSComplexTypeDefinition) currentElementDeclaration.getTypeDefinition();
    XSObjectList listOfAttributes = complexTypeDefinition.getAttributeUses();
    if (listOfAttributes.getLength() != 0) {
        TypeCompositor attList = new TypeCompositor(TypeCompositor.ATTLIST);
        for (int i = 0; i < listOfAttributes.getLength(); i++) {
            XSAttributeUseImpl xsdAttribute = (XSAttributeUseImpl) listOfAttributes.item(i);
            AttributeDeclaration attribute = new AttributeDeclaration(xsdAttribute.getAttrDeclaration().getName());
            if (logger.isDebugEnabled()) logger.debug(" --- AttributeName: " + xsdAttribute.getAttrDeclaration().getName() + " type: " + xsdAttribute.getType());
            if (xsdAttribute.getRequired()) {
                attribute.setMinCardinality(1);
            }
            int leafType = xsdAttribute.getAttrDeclaration().getTypeDefinition().getBuiltInKind();
            attribute.addChild(new SimpleType(getLeafType(leafType)));
            attList.addChild(attribute);
        }
        currentNode.addChild(attList);
    }
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:20,代码来源:GenerateXSDNodeTree.java

示例6: XSSimpleTypeDecl

import org.apache.xerces.xs.XSObjectList; //导入依赖的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;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:23,代码来源:XSSimpleTypeDecl.java

示例7: setListValues

import org.apache.xerces.xs.XSObjectList; //导入依赖的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;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:27,代码来源:XSSimpleTypeDecl.java

示例8: isDerivedByUnion

import org.apache.xerces.xs.XSObjectList; //导入依赖的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

示例9: expandRelatedSimpleTypeComponents

import org.apache.xerces.xs.XSObjectList; //导入依赖的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

示例10: containsQName

import org.apache.xerces.xs.XSObjectList; //导入依赖的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:AaronZhangL,项目名称:SplitCharater,代码行数:19,代码来源:XSDAbstractTraverser.java

示例11: processPSVIAnnotations

import org.apache.xerces.xs.XSObjectList; //导入依赖的package包/类
private void processPSVIAnnotations(XSObjectList annotations) {
    boolean empty = true;
    if (annotations != null && annotations.getLength() > 0) {
        for (int i = 0; i < annotations.getLength(); i++) {
            if (annotations.item(i) != null) {
                empty = false;
                break;
            }
        }
    }

    if (empty) {
        sendElementEvent("psv:annotations");
    }
    else {
        sendIndentedElement("psv:annotations");
        for (int i = 0; i < annotations.getLength(); i++) {
            processPSVIAnnotation((XSAnnotation)annotations.item(i));
        }
        sendUnIndentedElement("psv:annotations");
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:23,代码来源:PSVIWriter.java

示例12: processPSVIAttributeUses

import org.apache.xerces.xs.XSObjectList; //导入依赖的package包/类
private void processPSVIAttributeUses(XSObjectList uses) {
    if (uses == null || uses.getLength() == 0) {
        sendElementEvent("psv:attributeUses");
    }
    else {
        sendIndentedElement("psv:attributeUses");
        for (int i = 0; i < uses.getLength(); i++) {
            XSAttributeUse use = (XSAttributeUse)uses.item(i);
            sendIndentedElement("psv:attributeUse");
            sendElementEvent("psv:required", String.valueOf(use.getRequired()));
            processPSVIAttributeDeclarationOrRef(use.getAttrDeclaration());
            processPSVIValueConstraint(use.getConstraintType(), use.getConstraintValue());
            sendUnIndentedElement("psv:attributeUse");
        }
        sendUnIndentedElement("psv:attributeUses");
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:18,代码来源:PSVIWriter.java

示例13: collectChildElements

import org.apache.xerces.xs.XSObjectList; //导入依赖的package包/类
protected void collectChildElements(XSParticle particle, Set<String> elementNames) {
	if (particle==null) {
		log.warn("collectChildElements() particle is null, is this a problem?");	
		return;
	}
	XSTerm term = particle.getTerm();
	if (term==null) {
		throw new IllegalStateException("collectChildElements particle.term is null");
	} 
	if (term instanceof XSModelGroup) {
		XSModelGroup modelGroup = (XSModelGroup)term;
		XSObjectList particles = modelGroup.getParticles();
		for (int i=0;i<particles.getLength();i++) {
			XSParticle childParticle = (XSParticle)particles.item(i);
			collectChildElements(childParticle, elementNames);
		}
		return;
	} 
	if (term instanceof XSElementDeclaration) {
		XSElementDeclaration elementDeclaration=(XSElementDeclaration)term;
		String elementName=elementDeclaration.getName();
		if (DEBUG) log.debug("collectChildElements() ElementDeclaration name ["+elementName+"]");
		elementNames.add(elementName);
	}
	return;
}
 
开发者ID:ibissource,项目名称:iaf,代码行数:27,代码来源:XmlAligner.java

示例14: findMultipleOccurringChildElements

import org.apache.xerces.xs.XSObjectList; //导入依赖的package包/类
protected Set<String> findMultipleOccurringChildElements(XSParticle particle) {
	Set<String> result=new HashSet<String>();
	if (particle==null) {
		log.warn("findMultipleOccurringChildElements() typeDefinition particle is null, is this a problem?");	
		return result;
	}
	XSTerm term = particle.getTerm();
	if (term==null) {
		throw new IllegalStateException("findMultipleOccurringChildElements particle.term is null");
	} 
	if (DEBUG) log.debug("findMultipleOccurringChildElements() term name ["+term.getName()+"] occurring unbounded ["+particle.getMaxOccursUnbounded()+"] max occur ["+particle.getMaxOccurs()+"] term ["+ToStringBuilder.reflectionToString(term)+"]");
	if (particle.getMaxOccursUnbounded()||particle.getMaxOccurs()>1) {
		collectChildElements(particle,result);
		return result;
	} 
	if (term instanceof XSModelGroup) {
		XSModelGroup modelGroup = (XSModelGroup)term;
		XSObjectList particles = modelGroup.getParticles();
			if (DEBUG) log.debug("findMultipleOccurringChildElements() modelGroup particles ["+ToStringBuilder.reflectionToString(particles)+"]");
			for (int i=0;i<particles.getLength();i++) {
				XSParticle childParticle = (XSParticle)particles.item(i);
				result.addAll(findMultipleOccurringChildElements(childParticle));
			}
	} 
	return result;
}
 
开发者ID:ibissource,项目名称:iaf,代码行数:27,代码来源:XmlAligner.java

示例15: processEnumType

import org.apache.xerces.xs.XSObjectList; //导入依赖的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


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