本文整理汇总了Java中com.sun.xml.xsom.XSAttributeUse类的典型用法代码示例。如果您正苦于以下问题:Java XSAttributeUse类的具体用法?Java XSAttributeUse怎么用?Java XSAttributeUse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XSAttributeUse类属于com.sun.xml.xsom包,在下文中一共展示了XSAttributeUse类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: attGroupDecl
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
public void attGroupDecl(XSAttGroupDecl decl) {
SchemaTreeNode newNode = new SchemaTreeNode("Attribute group \""
+ decl.getName() + "\"", decl.getLocator());
this.currNode.add(newNode);
this.currNode = newNode;
Iterator itr;
itr = decl.iterateAttGroups();
while (itr.hasNext()) {
dumpRef((XSAttGroupDecl) itr.next());
}
itr = decl.iterateDeclaredAttributeUses();
while (itr.hasNext()) {
attributeUse((XSAttributeUse) itr.next());
}
this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
开发者ID:jolie,项目名称:jolie,代码行数:21,代码来源:SchemaTreeTraverser.java
示例2: attGroupDecl
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
public void attGroupDecl( XSAttGroupDecl decl ) {
Iterator itr;
println(MessageFormat.format("<attGroup name=\"{0}\">",
new Object[]{ decl.getName() }));
indent++;
// TODO: wildcard
itr = decl.iterateAttGroups();
while(itr.hasNext())
dumpRef( (XSAttGroupDecl)itr.next() );
itr = decl.iterateDeclaredAttributeUses();
while(itr.hasNext())
attributeUse( (XSAttributeUse)itr.next() );
indent--;
println("</attGroup>");
}
开发者ID:jolie,项目名称:jolie,代码行数:21,代码来源:SchemaWriter.java
示例3: attributeUse
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
public void attributeUse( XSAttributeUse use ) {
XSAttributeDecl decl = use.getDecl();
String additionalAtts="";
if(use.isRequired())
additionalAtts += " use=\"required\"";
if(use.getFixedValue()!=null && use.getDecl().getFixedValue()==null)
additionalAtts += " fixed=\""+use.getFixedValue()+'\"';
if(use.getDefaultValue()!=null && use.getDecl().getDefaultValue()==null)
additionalAtts += " default=\""+use.getDefaultValue()+'\"';
if(decl.isLocal()) {
// this is anonymous attribute use
dump(decl,additionalAtts);
} else {
// reference to a global one
println(MessageFormat.format("<attribute ref=\"'{'{0}'}'{1}{2}\"/>",
new Object[]{ decl.getTargetNamespace(), decl.getName(),
additionalAtts }));
}
}
开发者ID:jolie,项目名称:jolie,代码行数:23,代码来源:SchemaWriter.java
示例4: getAttributeUse
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
public XSAttributeUse getAttributeUse( String nsURI, String localName ) {
UName name = new UName(nsURI,localName);
if(prohibitedAtts.contains(name)) return null;
XSAttributeUse o = attributes.get(name);
if(o==null) {
Iterator<XSAttGroupDecl> itr = iterateAttGroups();
while(itr.hasNext() && o==null)
o = itr.next().getAttributeUse(nsURI,localName);
}
if(o==null) {
XSType base = getBaseType();
if(base.asComplexType()!=null)
o = base.asComplexType().getAttributeUse(nsURI,localName);
}
return o;
}
开发者ID:jolie,项目名称:jolie,代码行数:23,代码来源:ComplexTypeImpl.java
示例5: iterateAttributeUses
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
public Iterator<XSAttributeUse> iterateAttributeUses() {
XSComplexType baseType = getBaseType().asComplexType();
if( baseType==null ) return super.iterateAttributeUses();
return new Iterators.Union<XSAttributeUse>(
new Iterators.Filter<XSAttributeUse>(baseType.iterateAttributeUses()) {
protected boolean matches(XSAttributeUse value) {
XSAttributeDecl u = value.getDecl();
UName n = new UName(u.getTargetNamespace(),u.getName());
return !prohibitedAtts.contains(n);
}
},
super.iterateAttributeUses() );
}
开发者ID:jolie,项目名称:jolie,代码行数:17,代码来源:ComplexTypeImpl.java
示例6: attGroupDecl
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
public void attGroupDecl( XSAttGroupDecl decl ) {
Iterator<?> itr;
println(MessageFormat.format("<attributeGroup name=\"{0}\">", decl.getName()));
indent++;
// TODO: wildcard
itr = decl.iterateAttGroups();
while(itr.hasNext())
dumpRef( (XSAttGroupDecl)itr.next() );
itr = decl.iterateDeclaredAttributeUses();
while(itr.hasNext())
attributeUse( (XSAttributeUse)itr.next() );
indent--;
println("</attributeGroup>");
}
开发者ID:citygml4j,项目名称:citygml4j,代码行数:20,代码来源:SchemaWriter.java
示例7: attributeUse
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
public void attributeUse( XSAttributeUse use ) {
XSAttributeDecl decl = use.getDecl();
String additionalAtts="";
if(use.isRequired())
additionalAtts += " use=\"required\"";
if(use.getFixedValue()!=null && use.getDecl().getFixedValue()==null)
additionalAtts += " fixed=\""+use.getFixedValue()+'\"';
if(use.getDefaultValue()!=null && use.getDecl().getDefaultValue()==null)
additionalAtts += " default=\""+use.getDefaultValue()+'\"';
if(decl.isLocal()) {
// this is anonymous attribute use
dump(decl,additionalAtts);
} else {
// reference to a global one
println(MessageFormat.format("<attribute ref=\"'{'{0}'}'{1}{2}\"/>",
decl.getTargetNamespace(), decl.getName(), additionalAtts));
}
}
开发者ID:citygml4j,项目名称:citygml4j,代码行数:22,代码来源:SchemaWriter.java
示例8: attributeUse
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
public XmlForm attributeUse(XSAttributeUse use) {
boolean required = use.isRequired();
if (log.isDebugEnabled())
log.debug("Attribute Use: " + use +
", Required: " + required);
XSAttributeDecl decl = use.getDecl();
XmlForm xmlForm = decl.apply(this);
if (required) {
Form form = xmlForm.getForm();
if (form instanceof FormElement<?>)
((FormElement<?>) form).setRequired(true);
}
return xmlForm;
}
开发者ID:reinra,项目名称:dynaform,代码行数:20,代码来源:XmlFormBuilder.java
示例9: _valueToDocument
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的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 );
}
}
}
}
开发者ID:jolie,项目名称:jolie,代码行数:38,代码来源:XmlUtils.java
示例10: getAttributeUses
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
public List<XSAttributeUse> getAttributeUses() {
// TODO: this is fairly inefficient
List<XSAttributeUse> v = new ArrayList<XSAttributeUse>();
v.addAll(attributes.values());
for( XSAttGroupDecl agd : getAttGroups() )
v.addAll(agd.getAttributeUses());
return v;
}
开发者ID:jolie,项目名称:jolie,代码行数:9,代码来源:AttributesHolder.java
示例11: getAttributeUse
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
public XSAttributeUse getAttributeUse( String nsURI, String localName ) {
UName name = new UName(nsURI,localName);
XSAttributeUse o=null;
Iterator<XSAttGroupDecl> itr = iterateAttGroups();
while(itr.hasNext() && o==null)
o = itr.next().getAttributeUse(nsURI,localName);
if(o==null) o = attributes.get(name);
return o;
}
开发者ID:jolie,项目名称:jolie,代码行数:13,代码来源:AttGroupDeclImpl.java
示例12: attributeUse
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
public void attributeUse(XSAttributeUse use) {
XSAttributeDecl decl = use.getDecl();
String additionalAtts = "";
if (use.isRequired()) {
additionalAtts += " use=\"required\"";
}
if (use.getFixedValue() != null
&& use.getDecl().getFixedValue() == null) {
additionalAtts += " fixed=\"" + use.getFixedValue() + "\"";
}
if (use.getDefaultValue() != null
&& use.getDecl().getDefaultValue() == null) {
additionalAtts += " default=\"" + use.getDefaultValue() + "\"";
}
if (decl.isLocal()) {
// this is anonymous attribute use
dump(decl, additionalAtts);
}
else {
// reference to a global one
String str = MessageFormat.format(
"Attribute ref \"'{'{0}'}'{1}{2}\"", new Object[]{
decl.getTargetNamespace(), decl.getName(),
additionalAtts});
SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator());
this.currNode.add(newNode);
}
}
开发者ID:jolie,项目名称:jolie,代码行数:32,代码来源:SchemaTreeTraverser.java
示例13: dumpComplexTypeAttribute
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
/**
* Creates node for complex type.
*
* @param type Complex type.
*/
private void dumpComplexTypeAttribute(XSComplexType type) {
Iterator itr;
itr = type.iterateAttGroups();
while (itr.hasNext()) {
dumpRef((XSAttGroupDecl) itr.next());
}
itr = type.iterateDeclaredAttributeUses();
while (itr.hasNext()) {
attributeUse((XSAttributeUse) itr.next());
}
}
开发者ID:jolie,项目名称:jolie,代码行数:19,代码来源:SchemaTreeTraverser.java
示例14: dumpComplexTypeAttribute
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
private void dumpComplexTypeAttribute( XSComplexType type ) {
Iterator itr;
itr = type.iterateAttGroups();
while(itr.hasNext())
dumpRef( (XSAttGroupDecl)itr.next() );
itr = type.iterateDeclaredAttributeUses();
while(itr.hasNext())
attributeUse( (XSAttributeUse)itr.next() );
}
开发者ID:jolie,项目名称:jolie,代码行数:12,代码来源:SchemaWriter.java
示例15: attributeHolder
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
private Iterator<XSAttributeDecl> attributeHolder(final XSAttContainer atts) {
// TODO: check spec. is this correct?
return new Iterators.Adapter<XSAttributeDecl,XSAttributeUse>(atts.iterateAttributeUses()) {
protected XSAttributeDecl filter(XSAttributeUse u) {
return u.getDecl();
}
};
}
开发者ID:jolie,项目名称:jolie,代码行数:9,代码来源:Axis.java
示例16: getAttributeUse
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
private XSAttributeUse getAttributeUse(CAttributePropertyInfo propertyInfo) {
final XSComponent schemaComponent = propertyInfo.getSchemaComponent();
if (schemaComponent instanceof XSAttributeUse) {
return (XSAttributeUse) schemaComponent;
} else {
return null;
}
}
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:9,代码来源:XJCCMInfoFactory.java
示例17: getDefaultValue
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
protected String getDefaultValue(CAttributePropertyInfo propertyInfo) {
final XSAttributeUse attributeUse = getAttributeUse(propertyInfo);
if (attributeUse != null) {
final XmlString defaultValue = attributeUse.getDefaultValue();
if (defaultValue != null) {
return defaultValue.value;
}
}
return null;
}
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:12,代码来源:XJCCMInfoFactory.java
示例18: getDefaultValueNamespaceContext
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
protected NamespaceContext getDefaultValueNamespaceContext(
CAttributePropertyInfo propertyInfo) {
final XSAttributeUse attributeUse = getAttributeUse(propertyInfo);
if (attributeUse != null) {
final XmlString defaultValue = attributeUse.getDefaultValue();
if (defaultValue != null) {
return new NamespaceContextAdapter(defaultValue);
}
}
return null;
}
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:13,代码来源:XJCCMInfoFactory.java
示例19: isPropertyElementOf
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
public boolean isPropertyElementOf(QName featureTypeName, final QName propertyName, String handle) throws WFSException {
ElementDecl element = getElementDecl(featureTypeName, handle);
SchemaWalker schemaWalker = new SchemaWalker() {
@Override
public void elementDecl(XSElementDecl child) {
if (child.getName().equals(propertyName.getLocalPart()) &&
child.getTargetNamespace().equals(propertyName.getNamespaceURI())) {
setShouldWalk(false);
}
}
@Override
public void attributeUse(XSAttributeUse use) {
// avoid visiting attribute use
}
};
element.getXSElementDecl().getType().visit(schemaWalker);
boolean isPropertyElement = !schemaWalker.shouldWalk();
// TOOO: check for generic attributes and appearance attributes
if (!isPropertyElement) {
String namespaceURI = propertyName.getNamespaceURI();
isPropertyElement = namespaceURI.equals(GenericsModule.v1_0_0.getNamespaceURI()) ||
namespaceURI.equals(AppearanceModule.v1_0_0.getNamespaceURI());
}
return isPropertyElement;
}
开发者ID:3dcitydb,项目名称:web-feature-service,代码行数:32,代码来源:FeatureTypeHandler.java
示例20: findAttributeDecls
import com.sun.xml.xsom.XSAttributeUse; //导入依赖的package包/类
private List<PropertyUse> findAttributeDecls(final XSAttGroupDecl attGroupDecl) {
final List<PropertyUse> attributeDecls = new ArrayList<>();
for (final XSAttributeUse child : attGroupDecl.getDeclaredAttributeUses()) {
attributeDecls.add(new PropertyUse(child));
}
return attributeDecls;
}
开发者ID:mklemm,项目名称:jaxb2-rich-contract-plugin,代码行数:8,代码来源:GroupInterfaceGenerator.java
注:本文中的com.sun.xml.xsom.XSAttributeUse类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论