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


Java XSElementDecl.getType方法代码示例

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


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

示例1: getComplexTypeToElementName

import com.sun.xml.xsom.XSElementDecl; //导入方法依赖的package包/类
private Map<QName, List<QName>> getComplexTypeToElementName(ClassOutline classOutline) {
    Map<QName, List<QName>> complexTypeToElementName = new HashMap<QName, List<QName>>();

    XSSchemaSet schemaSet = classOutline.target.getSchemaComponent().getRoot();
    for (XSSchema schema : schemaSet.getSchemas()) {
        Map<String, XSElementDecl> elemDecls = schema.getElementDecls();
        for (Entry<String, XSElementDecl> entry : elemDecls.entrySet()) {
            XSElementDecl decl = entry.getValue();
            XSType xsType = decl.getType();

            if (xsType.getName() == null) {
                continue;
            }
            QName type = new QName(xsType.getTargetNamespace(), xsType.getName());
            List<QName> qnames = complexTypeToElementName.get(type);

            if (qnames == null) {
                qnames = new ArrayList<QName>();
                complexTypeToElementName.put(type, qnames);
            }
            qnames.add(new QName(decl.getTargetNamespace(), decl.getName()));
        }
    }

    return complexTypeToElementName;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:27,代码来源:SchemaProcessor.java

示例2: elementDecl

import com.sun.xml.xsom.XSElementDecl; //导入方法依赖的package包/类
/**
 * Creates node for element declaration with additional attributes.
 *
 * @param decl      Element declaration.
 * @param extraAtts Additional attributes.
 */
private void elementDecl(XSElementDecl decl, String extraAtts) {
    XSType type = decl.getType();

    // TODO: various other attributes

    String str = MessageFormat.format("Element name=\"{0}\"{1}{2}",
            new Object[]{
                decl.getName(),
                type.isLocal() ? "" : " type=\"{"
            + type.getTargetNamespace() + "}"
            + type.getName() + "\"", extraAtts});

    SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator());
    this.currNode.add(newNode);
    this.currNode = newNode;

    if (type.isLocal()) {
        if (type.isLocal()) {
            type.visit(this);
        }
    }

    this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
 
开发者ID:jolie,项目名称:jolie,代码行数:31,代码来源:SchemaTreeTraverser.java

示例3: elementDecl

import com.sun.xml.xsom.XSElementDecl; //导入方法依赖的package包/类
private void elementDecl( XSElementDecl decl, String extraAtts ) {
    XSType type = decl.getType();
    
    // TODO: various other attributes 
    
    println(MessageFormat.format("<element name=\"{0}\"{1}{2}{3}>",
        new Object[]{
            decl.getName(),
            type.isLocal()?"":" type=\"{"+
                type.getTargetNamespace()+'}'+
                type.getName()+'\"',
            extraAtts,
            type.isLocal()?"":"/"
        }));

    if(type.isLocal()) {
        indent++;

        if(type.isLocal())  type.visit(this);

        indent--;
        println("</element>");
    }
}
 
开发者ID:jolie,项目名称:jolie,代码行数:25,代码来源:SchemaWriter.java

示例4: getPossibleValues

import com.sun.xml.xsom.XSElementDecl; //导入方法依赖的package包/类
/**
 * Retrieves allowed values for a restricted type
 * 
 * @param inputName
 *            SOAP input
 * @return allowed values for the input or an empty list if the type of the
 *         input is not a string restriction
 */
public List<String> getPossibleValues(String inputName) {
	List<String> values = new ArrayList<String>();

	XSElementDecl element = schemaElements.get(inputName);
	if (element == null)
		return values;

	XSType type = element.getType();
	if (type == null || !(type instanceof XSRestrictionSimpleType))
		return values;

	XSRestrictionSimpleType res = (XSRestrictionSimpleType) type;

	String baseType = res.getBaseType().getName();
	// allow only xsd:string "enumerations"
	if (!baseType.equals("string"))
		return values;

	for (XSFacet facet : res.getDeclaredFacets()) {
		String value = facet.getValue().toString();
		values.add(value);
	}

	return values;
}
 
开发者ID:impactcentre,项目名称:iif-generic-soap-client,代码行数:34,代码来源:WsdlDocument.java

示例5: elementDecl

import com.sun.xml.xsom.XSElementDecl; //导入方法依赖的package包/类
@Override
public void elementDecl(XSElementDecl element)
{
  String elementName = element.getName();

  // If the current element has the name being searched store its type
  if (elementName.equals(this.searchName))
  {
    this.searchElement = element;

    // If the element does not refer to a type then return its content type
    // (Example create element)

  }

  // otherwise dig the content of the elements type
  else if (! ( elementName.equals(XMLTags.FIRST_CONDITION_TAG) || elementName.equals(XMLTags.SECOND_CONDITION_TAG) ))
  {
    XSType elementType = element.getType();
    XSComplexType elementComplexType = elementType.asComplexType();
    // if the type of the element is a complex type
    // visit whatever it has in its content.
    if (elementComplexType != null)
    {
      elementComplexType.getContentType().visit(this);
    }
  }
}
 
开发者ID:terraframe,项目名称:Runway-SDK,代码行数:29,代码来源:XSDElementFinder.java

示例6: elementDecl

import com.sun.xml.xsom.XSElementDecl; //导入方法依赖的package包/类
public XmlForm elementDecl(XSElementDecl decl) {
  if (log.isDebugEnabled())
    log.debug("Element Declaration: " + decl);
    
  XSType type = decl.getType();
  
  if (type.isSimpleType())
    return elementDeclSimple(decl, type.asSimpleType());
  else
    return elementDeclComplex(decl, type.asComplexType());
}
 
开发者ID:reinra,项目名称:dynaform,代码行数:12,代码来源:XmlFormBuilder.java

示例7: elementDecl

import com.sun.xml.xsom.XSElementDecl; //导入方法依赖的package包/类
private void elementDecl( XSElementDecl decl, String extraAtts ) {
	XSType type = decl.getType();

	// TODO: various other attributes

	// qualified attr; Issue
	if(decl.getForm() != null) {
		extraAtts += " form=\"" + (decl.getForm() ? "qualified" : "unqualified" ) + "\"";
	}

	StringBuffer buf = new StringBuffer();
	XSElementDecl substGrp = decl.getSubstAffiliation();
	
	if (substGrp != null) {
		buf.append(" substitutionGroup=\"{")
		.append(substGrp.getTargetNamespace())
		.append("}")
		.append(substGrp.getName())
		.append("\"");
	}

	println(MessageFormat.format("<element name=\"{0}\"{1}{2}{3}{4}>",
			decl.getName(),
			type.isLocal()?"":" type=\"{"+
					type.getTargetNamespace()+'}'+
					type.getName()+'\"',
					extraAtts,
					buf.toString(),
					type.isLocal()?"":"/"));

	if(type.isLocal()) {
		indent++;

		if(type.isLocal())  type.visit(this);

		indent--;
		println("</element>");
	} else {

	}
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:42,代码来源:SchemaWriter.java


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