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


Java SchemaProperty类代码示例

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


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

示例1: MSPSchemaTypeElement

import org.apache.xmlbeans.SchemaProperty; //导入依赖的package包/类
public MSPSchemaTypeElement(SchemaProperty sProperty, String xPath) {
	super(sProperty, xPath);
	minOccurs = sProperty.getMinOccurs();
	maxOccurs = sProperty.getMaxOccurs();
	switch (sProperty.hasNillable()) {
		case SchemaProperty.NEVER:
			isNillable = Nillable.NEVER;
			break;
		case SchemaProperty.VARIABLE:
			isNillable = Nillable.VARIABLE;
			break;
		case SchemaProperty.CONSISTENTLY:
			isNillable = Nillable.CONSISTENTLY;
			break;
		default:
			isNillable = Nillable.NEVER;
			break;
	}
}
 
开发者ID:dpinney,项目名称:essence,代码行数:20,代码来源:MSPSchemaTypeElement.java

示例2: getDerivedProperties

import org.apache.xmlbeans.SchemaProperty; //导入依赖的package包/类
private SchemaProperty[] getDerivedProperties(SchemaType sType) {
  // We have to see if this is redefined, because if it is we have
  // to include all properties associated to its supertypes
  QName name = sType.getName();
  if (name != null && name.equals(sType.getBaseType().getName())) {
    SchemaType sType2 = sType.getBaseType();
    // Walk all the redefined types and record any properties
    // not present in sType, because the redefined types do not
    // have a generated class to represent them
    SchemaProperty[] props = sType.getDerivedProperties();
    Map<QName, SchemaProperty> propsByName = new LinkedHashMap<QName, SchemaProperty>();
    for (int i = 0; i < props.length; i++)
      propsByName.put(props[i].getName(), props[i]);
    while (sType2 != null && name.equals(sType2.getName())) {
      props = sType2.getDerivedProperties();
      for (int i = 0; i < props.length; i++)
        if (!propsByName.containsKey(props[i].getName()))
          propsByName.put(props[i].getName(), props[i]);
      sType2 = sType2.getBaseType();
    }
    return propsByName.values().toArray(new SchemaProperty[0]);
  } else
    return sType.getDerivedProperties();
}
 
开发者ID:nortal,项目名称:j-road,代码行数:25,代码来源:XteeSchemaCodePrinter.java

示例3: SchemaTypeProperty

import org.apache.xmlbeans.SchemaProperty; //导入依赖的package包/类
public SchemaTypeProperty(SchemaProperty sProperty, String xPath) {
	qname = sProperty.getName();
	String fullXPath = xPath;
	if (this instanceof MSPSchemaTypeElement)
		fullXPath += "/" + qname.getLocalPart();
	else if (this instanceof MSPSchemaTypeAttribute)
		fullXPath += "/@" + qname.getLocalPart();
	this.xPath = fullXPath;
	switch (sProperty.hasFixed()) {
		case SchemaProperty.NEVER:
			hasFixed = Occurs.NEVER;
			break;
		case SchemaProperty.VARIABLE:
			hasFixed = Occurs.VARIABLE;
			break;
		case SchemaProperty.CONSISTENTLY:
			hasFixed = Occurs.CONSISTENTLY;
			break;
	}
	switch (sProperty.hasDefault()) {
		case SchemaProperty.NEVER:
			hasDefault = Occurs.NEVER;
			break;
		case SchemaProperty.VARIABLE:
			hasDefault = Occurs.VARIABLE;
			break;
		case SchemaProperty.CONSISTENTLY:
			hasDefault = Occurs.CONSISTENTLY;
			break;
	}
	defaultValue = sProperty.getDefaultText();
	schemaType = new MSSchemaTypeParser(sProperty.getType(), fullXPath);
}
 
开发者ID:dpinney,项目名称:essence,代码行数:34,代码来源:SchemaTypeProperty.java

示例4: MSPSchemaTypeAttribute

import org.apache.xmlbeans.SchemaProperty; //导入依赖的package包/类
public MSPSchemaTypeAttribute(SchemaProperty sProperty, String xPath) {
	super(sProperty, xPath);
	if (sProperty.getMaxOccurs().intValue() == 0)
		setUse(Use.PROHIBITED);
	else if (sProperty.getMinOccurs().intValue() == 1)
		setUse(Use.REQUIRED);
}
 
开发者ID:dpinney,项目名称:essence,代码行数:8,代码来源:MSPSchemaTypeAttribute.java

示例5: isJavaPrimitive

import org.apache.xmlbeans.SchemaProperty; //导入依赖的package包/类
static boolean isJavaPrimitive(int javaType) {
  return (javaType < SchemaProperty.JAVA_FIRST_PRIMITIVE
                                                         ? false
                                                         : (javaType > SchemaProperty.JAVA_LAST_PRIMITIVE
                                                                                                          ? false
                                                                                                          : true));
}
 
开发者ID:nortal,项目名称:j-road,代码行数:8,代码来源:XteeSchemaCodePrinter.java

示例6: makeAttributeDefaultValue

import org.apache.xmlbeans.SchemaProperty; //导入依赖的package包/类
void makeAttributeDefaultValue(String jtargetType, SchemaProperty prop, String identifier) throws IOException {
  String fullName = jtargetType;
  if (fullName == null)
    fullName = prop.javaBasedOnType().getFullJavaName().replace('$', '.');

  emit("target = (" + fullName + ")get_default_attribute_value(" + identifier + ");");
}
 
开发者ID:nortal,项目名称:j-road,代码行数:8,代码来源:XteeSchemaCodePrinter.java

示例7: findXteeTitle

import org.apache.xmlbeans.SchemaProperty; //导入依赖的package包/类
private String findXteeTitle(SchemaProperty prop) throws IOException {
  String xteeTitle = null;
  try {
    String localPart = prop.getName().getLocalPart();
    Node propNode = ((SchemaTypeImpl) prop.getContainerType()).getParseObject().getDomNode();
    Node node = propNode;

    if (StringUtils.equals(localPart, "item") || StringUtils.equals(localPart, "all")) {
      while (true) {
        if (StringUtils.equals(node.getLocalName(), "element")) {
          localPart = node.getAttributes().getNamedItem("name").getNodeValue();
          break;
        }
        node = node.getParentNode();
        if (node == null) {
          node = findFirstNode(propNode.getChildNodes(), "element", localPart);
          break;
        }
      }
    } else {
      node = findFirstNode(node.getChildNodes(), "element", localPart);
    }
    if (node != null) {
      xteeTitle = clearString(getXmlObjectValue(findFirstNode(node.getChildNodes(), "title", null, false)));
      if (xteeTitle == null) {
        xteeTitle = StringUtils.capitalize(node.getAttributes().getNamedItem("name").getNodeValue());
      }
    }
  } catch (Exception e) {
    throw new IOException(e);
  }

  return xteeTitle;
}
 
开发者ID:nortal,项目名称:j-road,代码行数:35,代码来源:XteeSchemaCodePrinter.java

示例8: processAttributes

import org.apache.xmlbeans.SchemaProperty; //导入依赖的package包/类
private void processAttributes(SchemaType stype, XmlCursor xmlc)
{
    if (_soapEnc)
    {
        QName typeName = stype.getName();
        if (typeName != null)
        {
            xmlc.insertAttributeWithValue(XSI_TYPE, formatQName(xmlc, typeName));
        }
    }
    
    SchemaProperty[] attrProps = stype.getAttributeProperties();
    for (int i = 0; i < attrProps.length; i++)
    {
        SchemaProperty attr = attrProps[i];
        if (_soapEnc)
        {
            if (SKIPPED_SOAP_ATTRS.contains(attr.getName()))
                continue;
            if (ENC_ARRAYTYPE.equals(attr.getName()))
            {
                SOAPArrayType arrayType = ((SchemaWSDLArrayType)stype.getAttributeModel().getAttribute(attr.getName())).getWSDLArrayType();
                if (arrayType != null)
                    xmlc.insertAttributeWithValue(attr.getName(), formatQName(xmlc, arrayType.getQName()) + arrayType.soap11DimensionString());
                continue;
            }
        }
        String defaultValue = attr.getDefaultText();
        xmlc.insertAttributeWithValue(attr.getName(), defaultValue == null ?
            sampleDataForSimpleType(attr.getType()) : defaultValue);
    }
}
 
开发者ID:HuaweiSNC,项目名称:OpsDev,代码行数:33,代码来源:RestfulApiSchemaManager.java

示例9: findBase64Types

import org.apache.xmlbeans.SchemaProperty; //导入依赖的package包/类
/**
 * Populate the base64 types The algo is to look for simpletypes that have base64 content, and
 * then step out of that onestep and get the element. For now there's an extended check to see
 * whether the simple type is related to the Xmime:contentType!
 *
 * @param sts
 */
private static List findBase64Types(SchemaTypeSystem sts) {
    List allSeenTypes = new ArrayList();
    List base64ElementQNamesList = new ArrayList();
    SchemaType outerType;
    //add the document types and global types
    allSeenTypes.addAll(Arrays.asList(sts.documentTypes()));
    allSeenTypes.addAll(Arrays.asList(sts.globalTypes()));

    for (int i = 0; i < allSeenTypes.size(); i++) {
        SchemaType sType = (SchemaType)allSeenTypes.get(i);

        if (sType.getContentType() == SchemaType.SIMPLE_CONTENT &&
                sType.getPrimitiveType() != null) {
            if (org.apache.axis2.namespace.Constants.BASE_64_CONTENT_QNAME
                    .equals(sType.getPrimitiveType().getName())) {
                outerType = sType.getOuterType();
                //check the outer type further to see whether it has the contenttype attribute from
                //XMime namespace
                SchemaProperty[] properties = sType.getProperties();
                for (int j = 0; j < properties.length; j++) {
                    if (org.apache.axis2.namespace.Constants.XMIME_CONTENT_TYPE_QNAME
                            .equals(properties[j].getName())) {
                        //add this only if it is a document type ??
                        if (outerType.isDocumentType()) {
                            base64ElementQNamesList.add(outerType.getDocumentElementName());
                        }
                        break;
                    }
                }
            }
        }
        //add any of the child types if there are any
        allSeenTypes.addAll(Arrays.asList(sType.getAnonymousTypes()));
    }

    return base64ElementQNamesList;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:45,代码来源:CodeGenerationUtility.java

示例10: findPlainBase64Types

import org.apache.xmlbeans.SchemaProperty; //导入依赖的package包/类
/**
 * @param stype
 * @param base64Types
 */
private static void findPlainBase64Types(SchemaType stype,
                                         ArrayList base64Types,
                                         ArrayList processedTypes) {

    SchemaProperty[] elementProperties = stype.getElementProperties();
    QName name;
    SchemaType schemaType;
    for (int i = 0; i < elementProperties.length; i++) {
        schemaType = elementProperties[i].getType();
        name = elementProperties[i].getName();
        if (!base64Types.contains(name) && !processedTypes.contains(schemaType.getName())) {
            processedTypes.add(stype.getName());
            if (schemaType.isPrimitiveType()) {
                SchemaType primitiveType = schemaType.getPrimitiveType();
                if (org.apache.axis2.namespace.Constants.BASE_64_CONTENT_QNAME
                        .equals(primitiveType.getName())) {
                    base64Types.add(name);
                }

            } else {
                findPlainBase64Types(schemaType, base64Types, processedTypes);
            }
        }
    }


}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:32,代码来源:CodeGenerationUtility.java

示例11: createInsertionMethodName

import org.apache.xmlbeans.SchemaProperty; //导入依赖的package包/类
protected String createInsertionMethodName(SchemaProperty schemaProperty) {
    String propertyName = schemaProperty.getJavaPropertyName();

    if (schemaProperty.extendsJavaArray()) {
        return GET_METHOD_PREFIX + propertyName + LIST_METHOD_SUFFIX;
    }

    return SET_METHOD_PREFIX + propertyName;
}
 
开发者ID:moosbusch,项目名称:xbMuseumXmlCommons,代码行数:10,代码来源:DefaultMuseumXmlPostProcessor.java

示例12: postProcess

import org.apache.xmlbeans.SchemaProperty; //导入依赖的package包/类
@Override
public void postProcess(MuseumXmlInjector injector, XmlObject injectee) {
    SchemaType schemaType = injectee.schemaType();
    SchemaProperty[] schemaProperties = schemaType.getProperties();

    for (SchemaProperty schemaProperty : schemaProperties) {
        if (schemaProperty.getMinOccurs().longValue() > 0) {
            String insertionMethodName = createInsertionMethodName(schemaProperty);
            XmlPostProcessorInfo postProcessorInfo = createPostProcessorInfo(
                    injectee, insertionMethodName);
            Class<?> paramType = postProcessorInfo.getInsertionParameterType();
            Object paramValue;

            if (paramType != String.class) {
                paramValue = createParameterValue(injector, paramType);
            } else {
                paramValue = getStringMappings().get(insertionMethodName);

                if (paramValue == null) {
                    paramValue = MuseumXmlDocument.GENERIC_STRING_VALUE;
                } else if (paramValue.equals("")) {
                    paramValue = MuseumXmlDocument.GENERIC_STRING_VALUE;
                }
            }

            insertDefaultValue(postProcessorInfo, paramValue);
        }
    }
}
 
开发者ID:moosbusch,项目名称:xbMuseumXmlCommons,代码行数:30,代码来源:DefaultMuseumXmlPostProcessor.java

示例13: processAttributes

import org.apache.xmlbeans.SchemaProperty; //导入依赖的package包/类
private void processAttributes( SchemaType stype, XmlCursor xmlc )
{
	if( _soapEnc )
	{
		QName typeName = stype.getName();
		if( typeName != null )
		{
			xmlc.insertAttributeWithValue( XSI_TYPE, formatQName( xmlc, typeName ) );
		}
	}

	SchemaProperty[] attrProps = stype.getAttributeProperties();
	for( int i = 0; i < attrProps.length; i++ )
	{
		SchemaProperty attr = attrProps[i];
		if( attr.getMinOccurs().intValue() == 0 && ignoreOptional )
			continue;

		if( attr.getName().equals( new QName( "http://www.w3.org/2005/05/xmlmime", "contentType" ) ) )
		{
			xmlc.insertAttributeWithValue( attr.getName(), "application/?" );
			continue;
		}

		if( _soapEnc )
		{
			if( SKIPPED_SOAP_ATTRS.contains( attr.getName() ) )
				continue;
			if( ENC_ARRAYTYPE.equals( attr.getName() ) )
			{
				SOAPArrayType arrayType = ( ( SchemaWSDLArrayType )stype.getAttributeModel().getAttribute(
						attr.getName() ) ).getWSDLArrayType();
				if( arrayType != null )
					xmlc.insertAttributeWithValue( attr.getName(), formatQName( xmlc, arrayType.getQName() )
							+ arrayType.soap11DimensionString() );
				continue;
			}
		}

		String value = null;
		if( multiValues != null )
		{
			String[] values = multiValues.get( attr.getName() );
			if( values != null )
				value = StringUtils.join( values, "," );
		}
		if( value == null )
			value = attr.getDefaultText();
		if( value == null )
			value = sampleDataForSimpleType( attr.getType() );

		xmlc.insertAttributeWithValue( attr.getName(), value );
	}
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:55,代码来源:SampleXmlUtil.java

示例14: printInnerType

import org.apache.xmlbeans.SchemaProperty; //导入依赖的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

示例15: xmlTypeForProperty

import org.apache.xmlbeans.SchemaProperty; //导入依赖的package包/类
String xmlTypeForProperty(SchemaProperty sProp) {
  SchemaType sType = sProp.javaBasedOnType();
  return findJavaType(sType).replace('$', '.');
}
 
开发者ID:nortal,项目名称:j-road,代码行数:5,代码来源:XteeSchemaCodePrinter.java


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