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


Java SchemaType.isSimpleType方法代码示例

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


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

示例1: printNestedInnerTypes

import org.apache.xmlbeans.SchemaType; //导入方法依赖的package包/类
void printNestedInnerTypes(SchemaType sType, SchemaTypeSystem system) throws IOException {
  boolean redefinition = sType.getName() != null && sType.getName().equals(sType.getBaseType().getName());
  while (sType != null) {
    SchemaType[] anonTypes = sType.getAnonymousTypes();
    for (int i = 0; i < anonTypes.length; i++) {
      if (anonTypes[i].isSkippedAnonymousType())
        printNestedInnerTypes(anonTypes[i], system);
      else {
        printInnerType(anonTypes[i], system);
      }
    }
    // For redefinition other than by extension for complex types, go
    // ahead and print
    // the anonymous types in the base
    if (!redefinition || (sType.getDerivationType() != SchemaType.DT_EXTENSION && !sType.isSimpleType()))
      break;
    sType = sType.getBaseType();
  }
}
 
开发者ID:nortal,项目名称:j-road,代码行数:20,代码来源:XteeSchemaCodePrinter.java

示例2: printNestedTypeImpls

import org.apache.xmlbeans.SchemaType; //导入方法依赖的package包/类
void printNestedTypeImpls(SchemaType sType, SchemaTypeSystem system) throws IOException {
  boolean redefinition = sType.getName() != null && sType.getName().equals(sType.getBaseType().getName());
  while (sType != null) {
    SchemaType[] anonTypes = sType.getAnonymousTypes();
    for (int i = 0; i < anonTypes.length; i++) {
      if (anonTypes[i].isSkippedAnonymousType())
        printNestedTypeImpls(anonTypes[i], system);
      else {
        printInnerTypeImpl(anonTypes[i], system, true);
      }
    }
    // For redefinition by extension, go ahead and print the anonymous
    // types in the base
    if (!redefinition || (sType.getDerivationType() != SchemaType.DT_EXTENSION && !sType.isSimpleType()))
      break;
    sType = sType.getBaseType();
  }
}
 
开发者ID:nortal,项目名称:j-road,代码行数:19,代码来源:XteeSchemaCodePrinter.java

示例3: addElementTypeAndRestricionsComment

import org.apache.xmlbeans.SchemaType; //导入方法依赖的package包/类
private void addElementTypeAndRestricionsComment( SchemaLocalElement element, XmlCursor xmlc )
{

	SchemaType type = element.getType();
	if( _typeComment && ( type != null && type.isSimpleType() ) )
	{
		String info = "";

		XmlAnySimpleType[] values = type.getEnumerationValues();
		if( values != null && values.length > 0 )
		{
			info = " - enumeration: [";
			for( int c = 0; c < values.length; c++ )
			{
				if( c > 0 )
					info += ",";

				info += values[c].getStringValue();
			}

			info += "]";
		}

		if( type.isAnonymousType() )
			xmlc.insertComment( "anonymous type" + info );
		else
			xmlc.insertComment( "type: " + type.getName().toString() + info );
	}
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:30,代码来源:SampleXmlUtil.java

示例4: createSampleForType

import org.apache.xmlbeans.SchemaType; //导入方法依赖的package包/类
/**
 * Cursor position Before: <theElement>^</theElement> After:
 * <theElement><lots of stuff/>^</theElement>
 */
public void createSampleForType( SchemaType stype, XmlCursor xmlc )
{
	_exampleContent = SoapUI.getSettings().getBoolean( WsdlSettings.XML_GENERATION_TYPE_EXAMPLE_VALUE );
	_typeComment = SoapUI.getSettings().getBoolean( WsdlSettings.XML_GENERATION_TYPE_COMMENT_TYPE );
	_skipComments = SoapUI.getSettings().getBoolean( WsdlSettings.XML_GENERATION_SKIP_COMMENTS );

	QName nm = stype.getName();
	if( nm == null && stype.getContainerField() != null )
		nm = stype.getContainerField().getName();

	if( nm != null && excludedTypes.contains( nm ) )
	{
		if( !_skipComments )
			xmlc.insertComment( "Ignoring type [" + nm + "]" );
		return;
	}

	if( _typeStack.contains( stype ) )
		return;

	_typeStack.add( stype );

	try
	{
		if( stype.isSimpleType() || stype.isURType() )
		{
			processSimpleType( stype, xmlc );
			return;
		}

		// complex Type
		// <theElement>^</theElement>
		processAttributes( stype, xmlc );

		// <theElement attri1="string">^</theElement>
		switch( stype.getContentType() )
		{
		case SchemaType.NOT_COMPLEX_TYPE :
		case SchemaType.EMPTY_CONTENT :
			// noop
			break;
		case SchemaType.SIMPLE_CONTENT :
		{
			processSimpleType( stype, xmlc );
		}
			break;
		case SchemaType.MIXED_CONTENT :
			xmlc.insertChars( pick( WORDS ) + " " );
			if( stype.getContentModel() != null )
			{
				processParticle( stype.getContentModel(), xmlc, true );
			}
			xmlc.insertChars( pick( WORDS ) );
			break;
		case SchemaType.ELEMENT_CONTENT :
			if( stype.getContentModel() != null )
			{
				processParticle( stype.getContentModel(), xmlc, false );
			}
			break;
		}
	}
	finally
	{
		_typeStack.remove( _typeStack.size() - 1 );
	}
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:72,代码来源:SampleXmlUtil.java

示例5: describeSchema

import org.apache.xmlbeans.SchemaType; //导入方法依赖的package包/类
public String describeSchema(SchemaType sType, int indentLvl) {
	String repr = "";
	String indent = "";
	for (int i=0; i<indentLvl; i++)
		indent += "\t";
	
	String name = "";
	String namespace = "";
	if (sType.getName() != null) {
		name = sType.getName().getLocalPart();
		namespace = sType.getName().getNamespaceURI();
	}
	if (sType.isSimpleType()) {
		repr += indent + "<simpleType name=\"" + name + "\" namespace=\"" + namespace + "\" ";
		// Don't bother describing primitive types further
		if (sType.getSimpleVariety() == SchemaType.ATOMIC && sType.isPrimitiveType())
			return repr + "/>\n";
		repr += ">\n";
		switch (sType.getSimpleVariety()) {
			case SchemaType.ATOMIC:
				repr += indent + "\t<restriction base=\"" + sType.getPrimitiveType().getName() + "\" ";
				if (!facetRestrictions.isEmpty()) {
					repr +=  ">\n";
					for (Map.Entry<String, String[]> entry : facetRestrictions.entrySet()) {
						for (String val : entry.getValue())
							repr += indent + "\t\t<" + entry.getKey() + " value=\"" + val + "\" />\n";
					}
					repr += indent + "\t</restriction>\n";
				} else
					repr += "/>\n";
				break;
			case SchemaType.LIST:
				repr += indent + "\t<list>\n";
				repr += indent + describeSchema(sType.getListItemType(), (indentLvl + 1));
				repr += indent + "\t</list>\n";
				break;
			case SchemaType.UNION:
				repr += indent + "\t<union>\n";
				for (SchemaType memberType : sType.getUnionMemberTypes())
					repr += describeSchema(memberType, (indentLvl + 2));
				repr += indent + "\t</union>\n";
				break;
			default:
				repr += indent + "\tERROR";
				break;
		}
		repr += indent + "</simpleType>\n";
	} else { // Complex type
		repr += indent + "<complexType name=\"" + name + "\" namespace=\"" + namespace + "\" ";
		if (sType.getContentType() == SchemaType.MIXED_CONTENT)
			repr += "mixed=\"true\" ";
		repr += ">\n";
		for (MSPSchemaTypeAttribute attr : attributeProperties) {
			repr += indent + "\t<attribute " + attr.toString() + ">\n";
			repr += attr.getSchemaType().toString((indentLvl + 2));
			repr += indent + "\t</attribute>\n";
		}
		switch (sType.getContentType()) {
			case SchemaType.EMPTY_CONTENT:
				repr += indent + "\t<!-- Empty Content -->\n";
				break;
			case SchemaType.SIMPLE_CONTENT:
				repr += indent + "\t<simpleContent>\n";
				repr += describeSchema(sType.getContentBasedOnType(), (indentLvl + 2));
				repr += indent + "\t</simpleContent>\n";
				break;
			default: //Element or Mixed Content
				repr += indent + "\t<complexContent>\n";
				for (MSPSchemaTypeElement elmt : elementProperties) {
					repr += indent +  "\t\t<element " + elmt.toString() + ">\n";
					repr += elmt.getSchemaType().toString((indentLvl + 3));
					repr += indent + "\t\t</element>\n";
				}
				repr += indent + "\t</complexContent>\n";
				break;
		}
		repr += indent + "</complexType>\n";
	}
	return repr;
}
 
开发者ID:dpinney,项目名称:essence,代码行数:81,代码来源:MSSchemaTypeParser.java

示例6: printInnerType

import org.apache.xmlbeans.SchemaType; //导入方法依赖的package包/类
void printInnerType(SchemaType sType, SchemaTypeSystem system) throws IOException {
  emit("");

  printInnerTypeJavaDoc(sType);

  startInterface(sType);

  printStaticTypeDeclaration(sType, system);

  if (sType.isSimpleType()) {
    if (sType.hasStringEnumValues())
      printStringEnumeration(sType);
  } else {
    if (sType.getContentType() == SchemaType.SIMPLE_CONTENT && sType.hasStringEnumValues())
      printStringEnumeration(sType);

    SchemaProperty[] props = getDerivedProperties(sType);

    for (int i = 0; i < props.length; i++) {
      SchemaProperty prop = props[i];

      // change begin - find annotation text
      String xteeTitle = findXteeTitle(prop);
      // change end - find annotation text

      printPropertyGetters(prop.getName(),
                           prop.isAttribute(),
                           prop.getJavaPropertyName(),
                           prop.getJavaTypeCode(),
                           javaTypeForProperty(prop),
                           xmlTypeForProperty(prop),
                           prop.hasNillable() != SchemaProperty.NEVER,
                           prop.extendsJavaOption(),
                           prop.extendsJavaArray(),
                           prop.extendsJavaSingleton(),
                           xteeTitle,
                           i + 1L);

      if (!prop.isReadOnly()) {
        printPropertySetters(prop.getName(),
                             prop.isAttribute(),
                             prop.getJavaPropertyName(),
                             prop.getJavaTypeCode(),
                             javaTypeForProperty(prop),
                             xmlTypeForProperty(prop),
                             prop.hasNillable() != SchemaProperty.NEVER,
                             prop.extendsJavaOption(),
                             prop.extendsJavaArray(),
                             prop.extendsJavaSingleton());
      }
    }

  }

  printNestedInnerTypes(sType, system);

  printFactory(sType);

  endBlock();
}
 
开发者ID:nortal,项目名称:j-road,代码行数:61,代码来源:XteeSchemaCodePrinter.java

示例7: xmlTypeForPropertyIsUnion

import org.apache.xmlbeans.SchemaType; //导入方法依赖的package包/类
static boolean xmlTypeForPropertyIsUnion(SchemaProperty sProp) {
  SchemaType sType = sProp.javaBasedOnType();
  return (sType.isSimpleType() && sType.getSimpleVariety() == SchemaType.UNION);
}
 
开发者ID:nortal,项目名称:j-road,代码行数:5,代码来源:XteeSchemaCodePrinter.java

示例8: createSampleForType

import org.apache.xmlbeans.SchemaType; //导入方法依赖的package包/类
/**
 * Cursor position
 * Before:
 * <theElement>^</theElement>
 * After:
 * <theElement><lots of stuff/>^</theElement>
 */
private void createSampleForType(SchemaType stype, XmlCursor xmlc, Map<String, String> mapValues)
{
    if (_typeStack.contains( stype ))
        return;

    _typeStack.add( stype );
    
    try
    {
        if (stype.isSimpleType() || stype.isURType())
        {
            processSimpleType(stype, xmlc, mapValues);
            return;
        }
        
        // complex Type
        // <theElement>^</theElement>
        processAttributes(stype, xmlc);
        
        // <theElement attri1="string">^</theElement>
        switch (stype.getContentType())
        {
            case SchemaType.NOT_COMPLEX_TYPE :
            case SchemaType.EMPTY_CONTENT :
                // noop
                break;
            case SchemaType.SIMPLE_CONTENT :
                {
                    processSimpleType(stype, xmlc, mapValues);
                }
                break;
            case SchemaType.MIXED_CONTENT :
                xmlc.insertChars(pick(WORDS) + " ");
                if (stype.getContentModel() != null)
                {
                    processParticle(stype.getContentModel(), xmlc, true);
                }
                xmlc.insertChars(pick(WORDS));
                break;
            case SchemaType.ELEMENT_CONTENT :
                if (stype.getContentModel() != null)
                {
                    processParticle(stype.getContentModel(), xmlc, false);
                }
                break;
        }
    }
    finally
    {
        _typeStack.remove( _typeStack.size() - 1 );
    }
}
 
开发者ID:HuaweiSNC,项目名称:OpsDev,代码行数:60,代码来源:RestfulApiSchemaManager.java


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