本文整理汇总了Java中org.apache.xmlbeans.SchemaProperty.getDefaultText方法的典型用法代码示例。如果您正苦于以下问题:Java SchemaProperty.getDefaultText方法的具体用法?Java SchemaProperty.getDefaultText怎么用?Java SchemaProperty.getDefaultText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.xmlbeans.SchemaProperty
的用法示例。
在下文中一共展示了SchemaProperty.getDefaultText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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);
}
}
示例3: 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 );
}
}