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


Java XSAttributeUse.getDecl方法代码示例

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


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

示例1: 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

示例2: 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

示例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}\"/>",
				decl.getTargetNamespace(), decl.getName(), additionalAtts));
	}
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:22,代码来源:SchemaWriter.java

示例4: 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

示例5: 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

示例6: 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

示例7: attributes

import com.sun.xml.xsom.XSAttributeUse; //导入方法依赖的package包/类
private void attributes(List<Form> forms,
    Map<String, TextWriter> attrWriters,
    Map<String, TextHandler> attrReaders,
    Collection<? extends XSAttributeUse> attrs) {
  
  for (XSAttributeUse use : attrs) {
    XmlForm xmlForm = use.apply(this);
    if (xmlForm != null) {
      XSAttributeDecl attr = use.getDecl();
      String name = attr.getName();

      Form form = xmlForm.getForm();
      if (form != null)
        forms.add(form);

      XmlWriter writer = xmlForm.getWriter();
      if (writer instanceof TextXmlWriter) {
        TextWriter textWriter = ((TextXmlWriter) writer).getWriter();
        attrWriters.put(name, textWriter);
      }
      
      XmlReader reader = xmlForm.getReader();
      TextHandler handler = null;
      if (reader instanceof TextXmlReader) {
        TextXmlReader textXmlReader = (TextXmlReader) reader;
        handler = textXmlReader.getHandler();
      } else if (reader != null)
        throw new IllegalStateException("XmlReader " + reader + " cannot be assigned to an XML attribtue, TextXmlReader expected");
      if (handler != null)
        attrReaders.put(name, handler);
    }
  }
}
 
开发者ID:reinra,项目名称:dynaform,代码行数:34,代码来源:XmlFormBuilder.java


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