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


Java XSTypeDefinition.getName方法代码示例

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


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

示例1: findReference

import org.apache.xerces.xs.XSTypeDefinition; //导入方法依赖的package包/类
/**
 * Finds all the element and complexType references for the specified root element and populates a map entry with
 * element names referenced by the element.
 * 
 * @param elementDeclaration XSElementDeclaration : the root element
 */
private void findReference(XSElementDeclaration elementDeclaration) {
   String elemName = elementDeclaration.getName();
   String thisContext = elemName;
   XSTypeDefinition typeDefinition = elementDeclaration.getTypeDefinition();
   if (null != typeDefinition) {
      String typeDefName = typeDefinition.getName();
      currentNodeNames.clear();
      currentNodeNames.add(elementDeclaration.getName());
      if (typeDefinition instanceof XSComplexTypeDefinition) {
         addToSchemaMap(elemName, typeDefName);
         if (null != typeDefName) {
            thisContext = typeDefName;
         }
         XSParticle particle = ((XSComplexTypeDefinition) typeDefinition).getParticle();
         findReferenceInParticle(thisContext, particle);
      }
      else {
         addToSchemaMap(elemName, typeDefName);
         if (null != typeDefName) {
            thisContext = typeDefName;
         }
      }
   }
}
 
开发者ID:mqsysadmin,项目名称:dpdirect,代码行数:31,代码来源:SchemaHelper.java

示例2: processEnumType

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

示例3: findElementReference

import org.apache.xerces.xs.XSTypeDefinition; //导入方法依赖的package包/类
/**
 * Finds all the element and complexType references for the specified element and populates a map entry with element
 * names referenced by the element.
 * 
 * @param context the context.
 * @param elementDeclaration the element declaration.
 */
private void findElementReference(String context,
                                  XSElementDeclaration elementDeclaration) {
   XSTypeDefinition typeDefinition = elementDeclaration.getTypeDefinition();
   if (null != typeDefinition) {
      String typeDefName = typeDefinition.getName();
      if (typeDefinition instanceof XSComplexTypeDefinition) {
         addToSchemaMap(context, typeDefName);
         if (null != typeDefName) {
            context = typeDefName;
         }
         XSParticle particle = ((XSComplexTypeDefinition) typeDefinition).getParticle();
         if (currentNodeNames.contains(typeDefName)) {
            /* circular reference */
            // currentNodeNames.add(typeDefName);
            // findReferenceInParticle(context, particle);
         }
         else {
            currentNodeNames.add(typeDefName);
            findReferenceInParticle(context, particle);
         }
      }
      else {
         addToSchemaMap(context, typeDefName);
         if (null != typeDefName) {
            context = typeDefName;
         }
         currentNodeNames.add(typeDefName);
      }
   }
}
 
开发者ID:mqsysadmin,项目名称:dpdirect,代码行数:38,代码来源:SchemaHelper.java

示例4: getBaseType

import org.apache.xerces.xs.XSTypeDefinition; //导入方法依赖的package包/类
private int getBaseType(XSTypeDefinition std) {
	if (std == null) {
		return XQItemType.XQBASETYPE_ANYSIMPLETYPE;
	}
	if (xs_ns.equals(std.getNamespace())) {
		QName qn = new QName(std.getNamespace(), std.getName());
		int type = getBaseTypeForTypeName(qn);
		logger.trace("getBaseType; returning {} for type {}", type, std.getName());
		return type;
	}
	return getBaseType(std.getBaseType());
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:13,代码来源:XmlModeler.java

示例5: addGlobalTypeDecl

import org.apache.xerces.xs.XSTypeDefinition; //导入方法依赖的package包/类
void addGlobalTypeDecl(XSTypeDefinition decl) {
    final String namespace = decl.getNamespace();
    final String declKey = (namespace == null || namespace.length() == 0)
        ? "," + decl.getName() : namespace + "," + decl.getName();

    if (fGlobalTypeDecls.get(declKey) == null) {
        fGlobalTypeDecls.put(declKey, decl);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:10,代码来源:XSDHandler.java

示例6: parseXSObject

import org.apache.xerces.xs.XSTypeDefinition; //导入方法依赖的package包/类
/**
 * Parse a schema element and attach the result to the given node.
 * 
 * @param schemaElem the schema element.
 * @param nodeContext the Node where the xml instance is generated.
 * @return the generated DOM node.
 */
protected Node parseXSObject(XSObject schemaElem,
                             Node nodeContext) throws Exception {
   Element contentElem = null;
   if (!(schemaElem instanceof XSSimpleTypeDefinition)) {
      // create the element
      contentElem = DocumentHelper.createElement(generatedDoc, schemaElem.getNamespace(), schemaElem.getName());
   }
   XSTypeDefinition tDefinition = null;
   if (schemaElem instanceof XSElementDeclaration) {
      tDefinition = ((XSElementDeclaration) schemaElem).getTypeDefinition();
      nodeContext.appendChild(contentElem);
   }
   else if (schemaElem instanceof XSTypeDefinition) {
      tDefinition = ((XSTypeDefinition) schemaElem);
   }
   else {
      tDefinition = ((XSTypeDefinition) schemaElem);
   }

   if (tDefinition instanceof XSComplexTypeDefinition) {
      XSComplexTypeDefinition ctDef = (XSComplexTypeDefinition) tDefinition;

      XSObjectList attList = ctDef.getAttributeUses();
      for (int i = 0; i < attList.getLength(); i++) {
         XSAttributeUse attrUseObject = (XSAttributeUse) attList.item(i);
         String attribname = attrUseObject.getAttrDeclaration().getName();
         if (sampleXML) {
            parseXSObject(attrUseObject.getAttrDeclaration().getTypeDefinition(),
                          DocumentHelper.createElement(generatedDoc, null, attribname));
         }
         assignAttributeValue(attribname, contentElem);
      }

      XSParticle particle = ((XSComplexTypeDefinition) tDefinition).getParticle();

      String typeDefName = tDefinition.getName();
      if (null != typeDefName) {
         processXSParticle(particle, contentElem);
      }
      else {
         processXSParticle(particle, contentElem);
      }
   }
   else {
      if (sampleXML) {
         StringList enumeration = ((XSSimpleTypeDefinition) tDefinition).getLexicalEnumeration();
         if (0 < enumeration.getLength()) {
            String name;
            if (null == nodeContext.getParentNode()) {
               name = "'" + nodeContext.getNodeName() + "' attribute";
            }
            else {
               name = "'" + schemaElem.getName() + "' node";
            }
            ArrayList<String> enumList = enumerationMap.get(name);
            if (null == enumList) {
               enumList = new ArrayList<String>();
               enumerationMap.put(name, enumList);
            }
            for (int i = 0; i < enumeration.getLength(); i++) {
               enumList.add(enumeration.item(i));
            }
         }
      }
   }
   if (!(schemaElem instanceof XSSimpleTypeDefinition)) {
      assignNodeValue(contentElem);
   }
   return contentElem;
}
 
开发者ID:mqsysadmin,项目名称:dpdirect,代码行数:78,代码来源:SchemaLoader.java


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