本文整理了Java中com.sun.xml.xsom.XSType.getName()
方法的一些代码示例,展示了XSType.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSType.getName()
方法的具体详情如下:
包路径:com.sun.xml.xsom.XSType
类名称:XSType
方法名:getName
暂无
代码示例来源:origin: Evolveum/midpoint
private QName getType(XSType xsType) {
if (xsType.getName() == null) {
return null;
}
return new QName(xsType.getTargetNamespace(), xsType.getName());
}
代码示例来源:origin: Evolveum/midpoint
private QName determineSupertype(XSType type) {
XSType baseType = type.getBaseType();
if (baseType == null) {
return null;
}
if (baseType.getName().equals("anyType")) {
return null;
}
return new QName(baseType.getTargetNamespace(), baseType.getName());
}
代码示例来源:origin: senbox-org/s2tbx
private static int XsTypeToMetadataType(XSType xsType) {
String name = "";
if (xsType != null) {
name = xsType.getName();
}
if ("byte".equalsIgnoreCase(name)) {
return ProductData.TYPE_UINT8;
} else if ("integer".equalsIgnoreCase(name)) {
return ProductData.TYPE_INT32;
} else if ("double".equalsIgnoreCase(name) ||
"real".equalsIgnoreCase(name)) {
return ProductData.TYPE_FLOAT32;
} else if ("date".equals(name) ||
"dateTime".equals(name)) {
return ProductData.TYPE_UTC;
} else {
return ProductData.TYPE_ASCII;
}
}
代码示例来源:origin: senbox-org/s2tbx
static int XsTypeToMetadataType(XSType xsType) {
String name = "";
if (xsType != null) {
name = xsType.getName();
}
if ("byte".equalsIgnoreCase(name)) {
return ProductData.TYPE_UINT8;
} else if ("integer".equalsIgnoreCase(name)) {
return ProductData.TYPE_INT32;
} else if ("double".equalsIgnoreCase(name) ||
"real".equalsIgnoreCase(name) ||
"float".equalsIgnoreCase(name)) {
return ProductData.TYPE_FLOAT32;
} else if ("date".equals(name) ||
"dateTime".equals(name)) {
return ProductData.TYPE_UTC;
} else {
return ProductData.TYPE_ASCII;
}
}
代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-schema
protected static String getTypeName(XSType type, String fieldName) {
String typeName = type.getName();
if (typeName == null || type.isLocal()) {
return getAnonymousTypeName(type, fieldName);
} else {
return typeName;
}
}
代码示例来源:origin: mklemm/jaxb2-rich-contract-plugin
@Override
public QName elementDecl(final XSElementDecl decl) {
if (decl.getType().getName() == null) {
return new QName(decl.getType().getTargetNamespace(), "anononymousElementType");
} else {
return new QName(decl.getType().getTargetNamespace(), decl.getType().getName());
}
}
代码示例来源:origin: Evolveum/midpoint
private Map
Map
XSSchemaSet schemaSet = classOutline.target.getSchemaComponent().getRoot();
for (XSSchema schema : schemaSet.getSchemas()) {
Map
for (Entry
XSElementDecl decl = entry.getValue();
XSType xsType = decl.getType();
if (xsType.getName() == null) {
continue;
}
QName type = new QName(xsType.getTargetNamespace(), xsType.getName());
List
if (qnames == null) {
qnames = new ArrayList<>();
complexTypeToElementName.put(type, qnames);
}
qnames.add(new QName(decl.getTargetNamespace(), decl.getName()));
}
}
return complexTypeToElementName;
}
代码示例来源:origin: Evolveum/midpoint
public SimpleTypeDefinition createSimpleTypeDefinition(XSSimpleType simpleType,
PrismContext prismContext, XSAnnotation annotation) throws SchemaException {
QName typeName = new QName(simpleType.getTargetNamespace(), simpleType.getName());
XSType baseType = simpleType.getBaseType();
QName baseTypeName = baseType != null ? new QName(baseType.getTargetNamespace(), baseType.getName()) : null;
SimpleTypeDefinition.DerivationMethod derivationMethod;
switch (simpleType.getDerivationMethod()) {
case XSSimpleType.EXTENSION: derivatiOnMethod= EXTENSION; break;
case XSSimpleType.RESTRICTION: derivatiOnMethod= RESTRICTION; break;
case XSSimpleType.SUBSTITUTION: derivatiOnMethod= SUBSTITUTION; break;
default: derivatiOnMethod= null; // TODO are combinations allowed? e.g. EXTENSION+SUBSTITUTION?
}
return new SimpleTypeDefinitionImpl(typeName, baseTypeName, derivationMethod, prismContext);
}
代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-schema
protected ListType loadListType(Schema schema, XSListSimpleType type, String fieldName)
throws TypeBindingException {
String name = getTypeName(type, fieldName);
XSType xsItemType = type.getItemType();
Type itemType;
if (xsItemType.getTargetNamespace().equals(NS_XSD)) {
itemType = XSDTypes.getType(xsItemType.getName());
} else {
itemType = loadSimpleType(schema, xsItemType, null);
}
if (itemType == null) {
log.error("list item type was not defined -> you should define first the item type");
return null;
}
return new ListTypeImpl(schema.getName(), name, itemType);
}
代码示例来源:origin: Evolveum/midpoint
public static boolean hasAnnotation(XSType xsType, QName annotationElementName) {
if (xsType.getName() == null) {
return false;
}
Element annotatiOnElement= getAnnotationElement(xsType.getAnnotation(), annotationElementName);
if (annotationElement != null) {
return true;
}
if (xsType.getBaseType() != null && !xsType.getBaseType().equals(xsType)) {
return hasAnnotation(xsType.getBaseType(), annotationElementName);
}
return false;
}
代码示例来源:origin: com.sun.xsom/xsom
public void run() throws SAXException {
XSType t = baseType.getType();
if (t.isComplexType() && t.asComplexType().getContentType().asParticle()!=null) {
$runtime.reportError(
Messages.format(Messages.ERR_SIMPLE_CONTENT_EXPECTED,
t.getTargetNamespace(), t.getName()), loc);
}
}
});
代码示例来源:origin: org.glassfish.jaxb/xsom
public void run() throws SAXException {
XSType t = baseType.getType();
if (t.isComplexType() && t.asComplexType().getContentType().asParticle()!=null) {
$runtime.reportError(
Messages.format(Messages.ERR_SIMPLE_CONTENT_EXPECTED,
t.getTargetNamespace(), t.getName()), loc);
}
}
});
代码示例来源:origin: org.glassfish.metro/webservices-tools
public void run() throws SAXException {
XSType t = baseType.getType();
if (t.isComplexType() && t.asComplexType().getContentType().asParticle()!=null) {
$runtime.reportError(
Messages.format(Messages.ERR_SIMPLE_CONTENT_EXPECTED,
t.getTargetNamespace(), t.getName()), loc);
}
}
});
代码示例来源:origin: sun-jaxb/jaxb-xjc
public void run() throws SAXException {
XSType t = baseType.getType();
if (t.isComplexType() && t.asComplexType().getContentType().asParticle()!=null) {
$runtime.reportError(
Messages.format(Messages.ERR_SIMPLE_CONTENT_EXPECTED,
t.getTargetNamespace(), t.getName()), loc);
}
}
});
代码示例来源:origin: yeshodhan/android-jaxb
public void run() throws SAXException {
XSType t = baseType.getType();
if (t.isComplexType() && t.asComplexType().getContentType().asParticle()!=null) {
$runtime.reportError(
Messages.format(Messages.ERR_SIMPLE_CONTENT_EXPECTED,
t.getTargetNamespace(), t.getName()), loc);
}
}
});
代码示例来源:origin: sun-jaxb/jaxb-xjc
/**
* Creates node for element declaration with additional attributes.
*
* @param decl Element declaration.
* @param extraAtts Additional attributes.
*/
private void elementDecl(XSElementDecl decl, String extraAtts) {
XSType type = decl.getType();
// TODO: various other attributes
String str = MessageFormat.format("Element name=\"{0}\"{1}{2}",
new Object[]{
decl.getName(),
type.isLocal() ? "" : " type=\"{"
+ type.getTargetNamespace() + "}"
+ type.getName() + "\"", extraAtts});
SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator());
this.currNode.add(newNode);
this.currNode = newNode;
if (type.isLocal()) {
if (type.isLocal()) {
type.visit(this);
}
}
this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
代码示例来源:origin: org.glassfish.jaxb/xsom
private void elementDecl( XSElementDecl decl, String extraAtts ) {
XSType type = decl.getType();
// TODO: various other attributes
// qualified attr; Issue
if(decl.getForm() != null) {
extraAtts += " form=\"" + (decl.getForm() ? "qualified" : "unqualified" ) + "\"";
}
println(MessageFormat.format("
decl.getName(),
type.isLocal()?"":" type=\"{"+
type.getTargetNamespace()+'}'+
type.getName()+'\"',
extraAtts,
type.isLocal()?"":"/"));
if(type.isLocal()) {
indent++;
if(type.isLocal()) type.visit(this);
indent--;
println("
}
}
代码示例来源:origin: org.glassfish.metro/webservices-tools
private void elementDecl( XSElementDecl decl, String extraAtts ) {
XSType type = decl.getType();
// TODO: various other attributes
// qualified attr; Issue
if(decl.getForm() != null) {
extraAtts += " form=\"" + (decl.getForm() ? "qualified" : "unqualified" ) + "\"";
}
println(MessageFormat.format("
decl.getName(),
type.isLocal()?"":" type=\"{"+
type.getTargetNamespace()+'}'+
type.getName()+'\"',
extraAtts,
type.isLocal()?"":"/"));
if(type.isLocal()) {
indent++;
if(type.isLocal()) type.visit(this);
indent--;
println("
}
}
代码示例来源:origin: sun-jaxb/jaxb-xjc
private void elementDecl( XSElementDecl decl, String extraAtts ) {
XSType type = decl.getType();
// TODO: various other attributes
// qualified attr; Issue
if(decl.getForm() != null) {
extraAtts += " form=\"" + (decl.getForm() ? "qualified" : "unqualified" ) + "\"";
}
println(MessageFormat.format("
decl.getName(),
type.isLocal()?"":" type=\"{"+
type.getTargetNamespace()+'}'+
type.getName()+'\"',
extraAtts,
type.isLocal()?"":"/"));
if(type.isLocal()) {
indent++;
if(type.isLocal()) type.visit(this);
indent--;
println("
}
}
代码示例来源:origin: com.sun.xsom/xsom
private void elementDecl( XSElementDecl decl, String extraAtts ) {
XSType type = decl.getType();
// TODO: various other attributes
// qualified attr; Issue
if(decl.getForm() != null) {
extraAtts += " form=\"" + (decl.getForm() ? "qualified" : "unqualified" ) + "\"";
}
println(MessageFormat.format("
decl.getName(),
type.isLocal()?"":" type=\"{"+
type.getTargetNamespace()+'}'+
type.getName()+'\"',
extraAtts,
type.isLocal()?"":"/"));
if(type.isLocal()) {
indent++;
if(type.isLocal()) type.visit(this);
indent--;
println("
}
}