本文整理汇总了Java中com.sun.xml.xsom.XSType.isSimpleType方法的典型用法代码示例。如果您正苦于以下问题:Java XSType.isSimpleType方法的具体用法?Java XSType.isSimpleType怎么用?Java XSType.isSimpleType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.xml.xsom.XSType
的用法示例。
在下文中一共展示了XSType.isSimpleType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isDerivedFromComplexType
import com.sun.xml.xsom.XSType; //导入方法依赖的package包/类
private boolean isDerivedFromComplexType(XSSchema schema, String localPart) {
XSType base = schema.getType(localPart);
if (base != null) {
if (base.isSimpleType()) {
typeFlag.add(TypeFlag.NO_ABSTRACT_GML);
typeFlag.add(TypeFlag.NO_FEATURE);
typeFlag.add(TypeFlag.NO_FEATURE_COLLECTION);
typeFlag.add(TypeFlag.NO_CITY_OBJECT);
typeFlag.add(TypeFlag.NO_GEOMETRY);
typeFlag.add(TypeFlag.NO_FEATURE_PROPERTY);
typeFlag.add(TypeFlag.NO_GEOMETRY_PROPERTY);
return false;
} else
return element.getType().isDerivedFrom(base);
}
return false;
}
示例2: _valueToDocument
import com.sun.xml.xsom.XSType; //导入方法依赖的package包/类
private static void _valueToDocument( Value value, Element element, Document doc, XSType type )
{
if ( type.isSimpleType() ) {
element.appendChild( doc.createTextNode( value.strValue() ) );
} else if ( type.isComplexType() ) {
String name;
Value currValue;
XSComplexType complexType = type.asComplexType();
// Iterate over attributes
Collection< ? extends XSAttributeUse > attributeUses = complexType.getAttributeUses();
for( XSAttributeUse attrUse : attributeUses ) {
name = attrUse.getDecl().getName();
if ( (currValue=getAttributeOrNull( value, name )) != null ) {
element.setAttribute( name, currValue.strValue() );
}
}
XSContentType contentType = complexType.getContentType();
XSParticle particle = contentType.asParticle();
if ( contentType.asSimpleType() != null ) {
element.appendChild( doc.createTextNode( value.strValue() ) );
} else if ( particle != null ) {
XSTerm term = particle.getTerm();
XSModelGroupDecl modelGroupDecl;
XSModelGroup modelGroup = null;
if ( (modelGroupDecl=term.asModelGroupDecl()) != null ) {
modelGroup = modelGroupDecl.getModelGroup();
} else if ( term.isModelGroup() ) {
modelGroup = term.asModelGroup();
}
if ( modelGroup != null ) {
_valueToDocument( value, element, doc, modelGroup );
}
}
}
}
示例3: elementDecl
import com.sun.xml.xsom.XSType; //导入方法依赖的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());
}