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

Java XSModelGroup类代码示例

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

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



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

示例1: dumpParticle

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

import org.apache.xerces.xs.XSModelGroup; //导入依赖的package包/类
private void appendCompositor(Path path){
    if(buff.length()>0 && buff.charAt(buff.length()-1)!='('){
        XSModelGroup modelGroup = (XSModelGroup)path.getParentPath(XSModelGroup.class).getElement();
        switch(modelGroup.getCompositor()){
            case XSModelGroup.COMPOSITOR_SEQUENCE:
                buff.append(" , ");
                break;
            case XSModelGroup.COMPOSITOR_ALL:
                buff.append(" ; ");
                break;
            case XSModelGroup.COMPOSITOR_CHOICE:
                buff.append(" | ");
                break;
        }
    }
}
 
开发者ID:santhosh-tekuri,项目名称:jlibs,代码行数:17,代码来源:XSContentModel.java


示例3: collectChildElements

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


示例4: findMultipleOccurringChildElements

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


示例5: findReferenceInParticle

import org.apache.xerces.xs.XSModelGroup; //导入依赖的package包/类
/**
 * Finds all the element and complexType references for a particle element and populates a map entry with element
 * names referenced by the element.
 * 
 * @param context the context.
 * @param particle the particle.
 */
private void findReferenceInParticle(String context,
                                     XSParticle particle) {
   if (null != particle) {
      XSTerm term = particle.getTerm();
      if (term instanceof XSModelGroup) {
         XSObjectList xsObjectList = ((XSModelGroup) term).getParticles();
         for (int i = 0; i < xsObjectList.getLength(); i++) {
            XSObject xsObject = xsObjectList.item(i);
            if (xsObject instanceof XSParticle) {
               findReferenceInParticle(context, (XSParticle) xsObject);
            }
         }
      }
      else if (term instanceof XSElementDeclaration) {
         String tName = term.getName();
         addToSchemaMap(context, tName);
         context = tName;
         if (currentNodeNames.contains(tName)) {
            // cyclic reference
            currentNodeNames.add(tName);
            findElementReference(context, (XSElementDeclaration) term);
         }
         else {
            currentNodeNames.add(tName);
            findElementReference(context, (XSElementDeclaration) term);
         }
      }
      // else { // XSWildcard
      // String tName = term.getName();
      // if (tName != null) {
      // addToSchemaTable(aContext, tName);
      // }
      // }
   }
}
 
开发者ID:mqsysadmin,项目名称:dpdirect,代码行数:43,代码来源:SchemaHelper.java


示例6: getValidSubTags

import org.apache.xerces.xs.XSModelGroup; //导入依赖的package包/类
private Map<QName,XSParticle> getValidSubTags(XSElementDeclaration elmt) {
    if (!(elmt.getTypeDefinition() instanceof XSComplexTypeDefinition)) {
        return HashMap.empty();
    }
    
    XSComplexTypeDefinition type = (XSComplexTypeDefinition) elmt.getTypeDefinition();
    if (type.getParticle() == null || !(type.getParticle().getTerm() instanceof XSModelGroup)) {
        return HashMap.empty();
    }
    
    XSModelGroup group = (XSModelGroup) type.getParticle().getTerm();
    if (group.getCompositor() != XSModelGroup.COMPOSITOR_SEQUENCE && group.getCompositor() != XSModelGroup.COMPOSITOR_CHOICE) {
        return HashMap.empty();
    }
    
    // We don't care whether it's SEQUENCE or CHOICE, we only want to know what are the valid sub-elements at this level.
    XSObjectList particles = group.getParticles();
    Map<QName,XSParticle> content = HashMap.empty();
    for (int j = 0; j < particles.getLength(); j++) {
        XSParticle sub = (XSParticle) particles.get(j);
        if (sub.getTerm() instanceof XSElementDeclaration) {
            XSElementDeclaration term = (XSElementDeclaration) sub.getTerm();
            content = content.put(new QName(term.getNamespace(), term.getName()), sub);
        }
    }
    return content;
}
 
开发者ID:Tradeshift,项目名称:ts-reaktive,代码行数:28,代码来源:XMLToJSON.java


示例7: processParticle

import org.apache.xerces.xs.XSModelGroup; //导入依赖的package包/类
private Path processParticle(Path parent, String path, XSParticle xsParticle, Map<String, List<XSElementDeclaration>> substitutions,
		List<XSElementDeclaration> parents) throws BagriException {
	
	if (xsParticle == null) {
		return parent;
	}
	
    XSTerm xsTerm = xsParticle.getTerm();
    
    Path particle = parent;
    switch (xsTerm.getType()) {
      case XSConstants.ELEMENT_DECLARATION:

    	  particle = processElement(parent, path, (XSElementDeclaration) xsTerm, substitutions, parents, xsParticle.getMinOccurs(), xsParticle.getMaxOccurs());
    	  break;

      case XSConstants.MODEL_GROUP:

    	  // this is one of the globally defined groups 
    	  // (found in top-level declarations)

    	  XSModelGroup xsGroup = (XSModelGroup) xsTerm;

	      // it also consists of particles
	      XSObjectList xsParticleList = xsGroup.getParticles();
	      for (int i = 0; i < xsParticleList.getLength(); i ++) {
	    	  XSParticle xsp = (XSParticle) xsParticleList.item(i);
	    	  particle = processParticle(parent, path, xsp, substitutions, parents);
	      }

	      //...
	      break;

      case XSConstants.WILDCARD:

          //...
          break;
    }
    return particle;
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:41,代码来源:XmlModeler.java


示例8: expandRelatedParticleComponents

import org.apache.xerces.xs.XSModelGroup; //导入依赖的package包/类
private void expandRelatedParticleComponents(XSParticle component, Vector componentList,
        String namespace, Hashtable dependencies) {
    XSTerm term = component.getTerm();
    switch (term.getType()) {
    case XSConstants.ELEMENT_DECLARATION :
        addRelatedElement((XSElementDeclaration) term, componentList, namespace, dependencies);
        break;
    case XSConstants.MODEL_GROUP :
        expandRelatedModelGroupComponents((XSModelGroup) term, componentList, namespace, dependencies);
        break;
    default:
        break;
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:15,代码来源:XSDHandler.java


示例9: expandRelatedModelGroupComponents

import org.apache.xerces.xs.XSModelGroup; //导入依赖的package包/类
private void expandRelatedModelGroupComponents(XSModelGroup modelGroup, Vector componentList,
        String namespace, Hashtable dependencies) {
    XSObjectList particles = modelGroup.getParticles();
    final int length = (particles == null) ? 0 : particles.getLength();
    for (int i=0; i<length; i++) {
        expandRelatedParticleComponents((XSParticle)particles.item(i), componentList, namespace, dependencies);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:9,代码来源:XSDHandler.java


示例10: getCompositor

import org.apache.xerces.xs.XSModelGroup; //导入依赖的package包/类
/**
 * {compositor} One of all, choice or sequence. The valid constants values
 * are: ALL, CHOICE, SEQUENCE.
 */
public short getCompositor() {
    if (fCompositor == MODELGROUP_CHOICE)
        return XSModelGroup.COMPOSITOR_CHOICE;
    else if (fCompositor == MODELGROUP_SEQUENCE)
        return XSModelGroup.COMPOSITOR_SEQUENCE;
    else
        return XSModelGroup.COMPOSITOR_ALL;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:13,代码来源:XSModelGroupImpl.java


示例11: processPSVIModelGroup

import org.apache.xerces.xs.XSModelGroup; //导入依赖的package包/类
private void processPSVIModelGroup(XSModelGroup mg) {
    if (mg == null) {
        sendElementEvent("psv:modelGroup");
    }
    else {
        sendIndentedElement("psv:modelGroup");
        sendElementEvent(
            "psv:compositor",
            this.translateCompositor(mg.getCompositor()));
        processPSVIParticles(mg.getParticles());
        processPSVIAnnotation(mg.getAnnotation());
        sendUnIndentedElement("psv:modelGroup");
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:15,代码来源:PSVIWriter.java


示例12: processPSVIParticle

import org.apache.xerces.xs.XSModelGroup; //导入依赖的package包/类
private void processPSVIParticle(XSParticle part) {
    if (part == null) {
        sendElementEvent("psv:particle");
    }
    else {
        sendIndentedElement("psv:particle");
        sendElementEvent(
            "psv:minOccurs",
            String.valueOf(part.getMinOccurs()));
        sendElementEvent(
            "psv:maxOccurs",
            part.getMaxOccurs() == SchemaSymbols.OCCURRENCE_UNBOUNDED
                ? "unbounded"
                : String.valueOf(part.getMaxOccurs()));
        sendIndentedElement("psv:term");
        switch (part.getTerm().getType()) {
            case XSConstants.ELEMENT_DECLARATION :
                processPSVIElementDeclarationOrRef(
                    (XSElementDeclaration)part.getTerm());
                break;
            case XSConstants.MODEL_GROUP :
                processPSVIModelGroup((XSModelGroup)part.getTerm());
                break;
            case XSConstants.WILDCARD :
                processPSVIWildcard((XSWildcard)part.getTerm());
                break;
        }
        sendUnIndentedElement("psv:term");
        sendUnIndentedElement("psv:particle");
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:32,代码来源:PSVIWriter.java


示例13: translateCompositor

import org.apache.xerces.xs.XSModelGroup; //导入依赖的package包/类
private String translateCompositor(short comp) {
    switch (comp) {
        case XSModelGroup.COMPOSITOR_SEQUENCE :
            return SchemaSymbols.ELT_SEQUENCE;
        case XSModelGroup.COMPOSITOR_CHOICE :
            return SchemaSymbols.ELT_CHOICE;
        case XSModelGroup.COMPOSITOR_ALL :
            return SchemaSymbols.ELT_ALL;
        default :
            return "unknown";
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:13,代码来源:PSVIWriter.java


示例14: processGroup

import org.apache.xerces.xs.XSModelGroup; //导入依赖的package包/类
private TypeDesc processGroup(
    XSModelGroup modelGroup,
    List<XSModel> models,
    Map<String, TypeDesc> jtMap,
    Map<String, NamespaceDesc> nsdMap
) {
    XSModelGroupDefinition def = null;
    for (XSModel xsModel : models) {
        XSNamedMap map = xsModel.getComponents(XSConstants.MODEL_GROUP_DEFINITION);
        for (int i = 0; i < map.getLength(); i++) {
            XSModelGroupDefinition mg = (XSModelGroupDefinition) map.item(i);
            final XSModelGroup xsModelGroup = mg.getModelGroup();
            if (xsModelGroup == modelGroup || xsModelGroup.toString().equals(modelGroup.toString())) {
                def = mg;
                break;
            }
        }
    }
    if (def == null) {
        return null;
    }
    if (!nsdMap.containsKey(def.getNamespace())) {
        Util.log("Namespace desc not found for: " + def);
    }
    String typeName = toJavaTypeName(def, nsdMap);
    final String typeQName = model.toJavaQualifiedTypeName(def, nsdMap, false);
    TypeDesc td = jtMap.get(typeQName);
    if (td != null) {
        if (td.type == TypeDesc.TypeEnum.GROUP_INTERFACE) {
            return td;
        } else {
            Util.logerr("type-group conflict: " + typeName);
            return null;
        }
    } else {
        td = new TypeDesc(def.getName(), def.getNamespace(), typeName, TypeDesc.TypeEnum.GROUP_INTERFACE);
    }

    XSAnnotation ann = def.getAnnotation();
    td.documentation = parseAnnotationString(
        "Type " + def.getNamespace() + ":" + def.getName() + " documentation",
        ann == null ? null : ann.getAnnotationString()
    );
    td.type = TypeDesc.TypeEnum.GROUP_INTERFACE;
    LinkedList<PEntry> plist = new LinkedList<PEntry>();
    for (int i = 0; i < def.getModelGroup().getParticles().getLength(); i++) {
        XSParticle p = (XSParticle) def.getModelGroup().getParticles().item(i);
        plist.add(new PEntry(p, false));
    }
    processParticles(def, plist, nsdMap, jtMap, td, models, null, null);
    jtMap.put(typeQName, td);
    return td;
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:54,代码来源:XSDModelLoader.java


示例15: processXSParticle

import org.apache.xerces.xs.XSModelGroup; //导入依赖的package包/类
/**
 * Processes an XSParticle.
 * 
 * @param particle the particle to process.
 * @param contentElem the DOM element to be populated.
 */
protected void processXSParticle(XSParticle particle,
                                 Element contentElem) throws Exception {
   if (null != particle && null != contentElem) {
      XSTerm term = particle.getTerm();
      if (term instanceof XSModelGroup) {
         processXSGroup((XSModelGroup) term, contentElem);
      }
      else if (term instanceof XSElementDeclaration) {
         String termName = term.getName();
         int numOccurs = getOccurances(particle, contentElem);
         if ((0 < numOccurs) || sampleXML) {
            Node currentNode = parseXSObject((XSElementDeclaration) term, contentElem);
            for (int i = 0; i < numOccurs - 1; i++) {
               Node newElem = currentNode.cloneNode(true);
               if (!(currentNode.getParentNode() instanceof Document)) {
                  currentNode.getParentNode().appendChild(newElem);
               }
               NamedNodeMap attributes = newElem.getAttributes();
               for (int j = 0; j < attributes.getLength(); j++) {
                  String attributeValue = getAttributeValue(attributes.item(j).getNodeName(), newElem);
                  if (attributeValue != null) {
                     attributes.item(j).setNodeValue(attributeValue);
                  }
               }
               assignNodeValue(newElem);
            }
         }

      }
      else if (term instanceof XSWildcard) {
         if (soapEnv && xsRootElement.getName().equals("Envelope")
             && getNodeName(contentElem).equals("Body")) {
            // soapEnv == true, and we have traversed down to the 'Body' element.
            // Now change xsRootSchemaElement and build payload.
            XSElementDeclaration newRoot = stripSoapEnv();
            if (null != newRoot){
         	   parseXSObject(newRoot, contentElem);
            }
         }
      }
      else {
         log.warn("Unprocessed term case:" + ((null == term) ? "" : term.getClass().toString()));
      }
   }
}
 
开发者ID:mqsysadmin,项目名称:dpdirect,代码行数:52,代码来源:SchemaLoader.java


示例16: process

import org.apache.xerces.xs.XSModelGroup; //导入依赖的package包/类
protected boolean process(XSModelGroup modelGroup){
    return modelGroup.getCompositor()!=XSModelGroup.COMPOSITOR_SEQUENCE;
}
 
开发者ID:santhosh-tekuri,项目名称:jlibs,代码行数:4,代码来源:XSDisplayFilter.java


示例17: process

import org.apache.xerces.xs.XSModelGroup; //导入依赖的package包/类
protected Processor process(XSModelGroup modelGroup){
    return modelGroupProcessor;
}
 
开发者ID:santhosh-tekuri,项目名称:jlibs,代码行数:4,代码来源:XSContentModel.java


示例18: preProcess

import org.apache.xerces.xs.XSModelGroup; //导入依赖的package包/类
@Override
public boolean preProcess(XSModelGroup modelGroup, Path path){
    appendCompositor(path);
    buff.append('(');
    return true;
}
 
开发者ID:santhosh-tekuri,项目名称:jlibs,代码行数:7,代码来源:XSContentModel.java


示例19: postProcess

import org.apache.xerces.xs.XSModelGroup; //导入依赖的package包/类
@Override
public void postProcess(XSModelGroup modelGroup, Path path){
    buff.append(')');
    appendCardinality(path);
}
 
开发者ID:santhosh-tekuri,项目名称:jlibs,代码行数:6,代码来源:XSContentModel.java


示例20: getModelGroup

import org.apache.xerces.xs.XSModelGroup; //导入依赖的package包/类
/**
 * {model group} A model group.
 */
public XSModelGroup getModelGroup() {
    return fModelGroup;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:7,代码来源:XSGroupDecl.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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