本文整理匯總了Java中javax.xml.bind.annotation.XmlSchema.elementFormDefault方法的典型用法代碼示例。如果您正苦於以下問題:Java XmlSchema.elementFormDefault方法的具體用法?Java XmlSchema.elementFormDefault怎麽用?Java XmlSchema.elementFormDefault使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.xml.bind.annotation.XmlSchema
的用法示例。
在下文中一共展示了XmlSchema.elementFormDefault方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getElementFormDefault
import javax.xml.bind.annotation.XmlSchema; //導入方法依賴的package包/類
public final XmlNsForm getElementFormDefault(String nsUri) {
for (ClassInfoImpl<T, C, F, M> ci : beans().values()) {
XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
if(xs==null)
continue;
if(!xs.namespace().equals(nsUri))
continue;
XmlNsForm xnf = xs.elementFormDefault();
if(xnf!=XmlNsForm.UNSET)
return xnf;
}
return XmlNsForm.UNSET;
}
示例2: calcXmlName
import javax.xml.bind.annotation.XmlSchema; //導入方法依賴的package包/類
private QName calcXmlName(String uri,String local) {
// compute the default
TODO.checkSpec();
if(local.length()==0 || local.equals("##default"))
local = seed.getName();
if(uri.equals("##default")) {
XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
// JAX-RPC doesn't want the default namespace URI swapping to take effect to
// local "unqualified" elements. UGLY.
if(xs!=null) {
switch(xs.elementFormDefault()) {
case QUALIFIED:
QName typeName = parent.getTypeName();
if(typeName!=null)
uri = typeName.getNamespaceURI();
else
uri = xs.namespace();
if(uri.length()==0)
uri = parent.builder.defaultNsUri;
break;
case UNQUALIFIED:
case UNSET:
uri = "";
}
} else {
uri = "";
}
}
return new QName(uri.intern(),local.intern());
}
示例3: calcXmlName
import javax.xml.bind.annotation.XmlSchema; //導入方法依賴的package包/類
private QName calcXmlName(String uri, String local) {
// compute the default
TODO.checkSpec();
if (local.length() == 0 || local.equals("##default"))
local = seed.getName();
if (uri.equals("##default")) {
XmlSchema xs = reader().getPackageAnnotation(XmlSchema.class, parent.getClazz(), this);
// JAX-RPC doesn't want the default namespace URI swapping to take
// effect to
// local "unqualified" elements. UGLY.
if (xs != null) {
switch (xs.elementFormDefault()) {
case QUALIFIED:
uri = getQualifiedNs(xs);
break;
case UNQUALIFIED:
case UNSET:
uri = "";
}
} else {
ClassEx cw = (ClassEx) parent.getClazz();
// System.out.println(cw);
uri = JefAdapters.jefQualified.contains(cw.getPackageName()) ? getQualifiedNs(null) : "";
}
}
return new QName(uri.intern(), local.intern());
}