热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

com.sun.xml.xsom.XSType.getName()方法的使用及代码示例

本文整理了Java中com.sun.xml.xsom.XSType.getName()方法的一些代码示例,展示了XSType.getName()

本文整理了Java中com.sun.xml.xsom.XSType.getName()方法的一些代码示例,展示了XSType.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSType.getName()方法的具体详情如下:
包路径:com.sun.xml.xsom.XSType
类名称:XSType
方法名:getName

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> getComplexTypeToElementName(ClassOutline classOutline) {
Map> complexTypeToElementName = new HashMap<>();
XSSchemaSet schemaSet = classOutline.target.getSchemaComponent().getRoot();
for (XSSchema schema : schemaSet.getSchemas()) {
Map elemDecls = schema.getElementDecls();
for (Entry entry : elemDecls.entrySet()) {
XSElementDecl decl = entry.getValue();
XSType xsType = decl.getType();
if (xsType.getName() == null) {
continue;
}
QName type = new QName(xsType.getTargetNamespace(), xsType.getName());
List qnames = complexTypeToElementName.get(type);
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("
");
}
}

推荐阅读
  • Java SE从入门到放弃(三)的逻辑运算符详解
    本文详细介绍了Java SE中的逻辑运算符,包括逻辑运算符的操作和运算结果,以及与运算符的不同之处。通过代码演示,展示了逻辑运算符的使用方法和注意事项。文章以Java SE从入门到放弃(三)为背景,对逻辑运算符进行了深入的解析。 ... [详细]
  • 本文介绍了一个Java猜拳小游戏的代码,通过使用Scanner类获取用户输入的拳的数字,并随机生成计算机的拳,然后判断胜负。该游戏可以选择剪刀、石头、布三种拳,通过比较两者的拳来决定胜负。 ... [详细]
  • 本文讨论了如何优化解决hdu 1003 java题目的动态规划方法,通过分析加法规则和最大和的性质,提出了一种优化的思路。具体方法是,当从1加到n为负时,即sum(1,n)sum(n,s),可以继续加法计算。同时,还考虑了两种特殊情况:都是负数的情况和有0的情况。最后,通过使用Scanner类来获取输入数据。 ... [详细]
  • 本文介绍了如何在给定的有序字符序列中插入新字符,并保持序列的有序性。通过示例代码演示了插入过程,以及插入后的字符序列。 ... [详细]
  • Java中包装类的设计原因以及操作方法
    本文主要介绍了Java中设计包装类的原因以及操作方法。在Java中,除了对象类型,还有八大基本类型,为了将基本类型转换成对象,Java引入了包装类。文章通过介绍包装类的定义和实现,解答了为什么需要包装类的问题,并提供了简单易用的操作方法。通过本文的学习,读者可以更好地理解和应用Java中的包装类。 ... [详细]
  • 先看官方文档TheJavaTutorialshavebeenwrittenforJDK8.Examplesandpracticesdescribedinthispagedontta ... [详细]
  • 纠正网上的错误:自定义一个类叫java.lang.System/String的方法
    本文纠正了网上关于自定义一个类叫java.lang.System/String的错误答案,并详细解释了为什么这种方法是错误的。作者指出,虽然双亲委托机制确实可以阻止自定义的System类被加载,但通过自定义一个特殊的类加载器,可以绕过双亲委托机制,达到自定义System类的目的。作者呼吁读者对网上的内容持怀疑态度,并带着问题来阅读文章。 ... [详细]
  • 开发笔记:加密&json&StringIO模块&BytesIO模块
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了加密&json&StringIO模块&BytesIO模块相关的知识,希望对你有一定的参考价值。一、加密加密 ... [详细]
  • Java容器中的compareto方法排序原理解析
    本文从源码解析Java容器中的compareto方法的排序原理,讲解了在使用数组存储数据时的限制以及存储效率的问题。同时提到了Redis的五大数据结构和list、set等知识点,回忆了作者大学时代的Java学习经历。文章以作者做的思维导图作为目录,展示了整个讲解过程。 ... [详细]
  • 本文介绍了在Java中gt、gtgt、gtgtgt和lt之间的区别。通过解释符号的含义和使用例子,帮助读者理解这些符号在二进制表示和移位操作中的作用。同时,文章还提到了负数的补码表示和移位操作的限制。 ... [详细]
  • Android源码深入理解JNI技术的概述和应用
    本文介绍了Android源码中的JNI技术,包括概述和应用。JNI是Java Native Interface的缩写,是一种技术,可以实现Java程序调用Native语言写的函数,以及Native程序调用Java层的函数。在Android平台上,JNI充当了连接Java世界和Native世界的桥梁。本文通过分析Android源码中的相关文件和位置,深入探讨了JNI技术在Android开发中的重要性和应用场景。 ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • 开发笔记:Java是如何读取和写入浏览器Cookies的
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了Java是如何读取和写入浏览器Cookies的相关的知识,希望对你有一定的参考价值。首先我 ... [详细]
  • Java值传递机制的说明及示例代码
    本文对Java值传递机制进行了详细说明,包括形参和实参的定义和传递方式,以及通过示例代码展示了交换值的方法。 ... [详细]
  • 本文介绍了Swing组件的用法,重点讲解了图标接口的定义和创建方法。图标接口用来将图标与各种组件相关联,可以是简单的绘画或使用磁盘上的GIF格式图像。文章详细介绍了图标接口的属性和绘制方法,并给出了一个菱形图标的实现示例。该示例可以配置图标的尺寸、颜色和填充状态。 ... [详细]
author-avatar
手浪用户2602931657
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有