javax.xml.bind.annotation.XmlType.name()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(129)

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

XmlType.name介绍

暂无

代码示例

代码示例来源:origin: com.sun.xml.bind/jaxb-impl

public String name() {
  return core.name();
}

代码示例来源:origin: spring-projects/spring-framework

localPart = annotation.name();
namespaceUri = annotation.namespace();

代码示例来源:origin: org.springframework/spring-web

localPart = annotation.name();
namespaceUri = annotation.namespace();

代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime

public String name() {
  return core.name();
}

代码示例来源:origin: com.sun.xml.bind/jaxb-impl

if(t!=null) {
  nsUri = t.namespace();
  local = t.name();

代码示例来源:origin: com.fasterxml.jackson.module/jackson-module-jaxb-annotations

@Override
public String findTypeName(AnnotatedClass ac) {
  XmlType type = findAnnotation(XmlType.class, ac, false, false, false);
  if (type != null) {
    String name = type.name();
    if (!MARKER_FOR_DEFAULT.equals(name)) return name;
  }
  return null;
}

代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime

if(t!=null) {
  nsUri = t.namespace();
  local = t.name();

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl

public String name() {
  return core.name();
}

代码示例来源:origin: apache/cxf

protected QName getJaxbQName(Class<?> cls, Type type, Object object, boolean pluralName)
  throws Exception {
  if (cls == JAXBElement.class) {
    return object != null ? ((JAXBElement<?>)object).getName() : null;
  }
  XmlRootElement root = cls.getAnnotation(XmlRootElement.class);
  if (root != null) {
    return getQNameFromNamespaceAndName(root.namespace(), root.name(), cls, pluralName);
  } else if (isXmlType(cls)) {
    XmlType xmlType = cls.getAnnotation(XmlType.class);
    return getQNameFromNamespaceAndName(xmlType.namespace(), xmlType.name(), cls, pluralName);
  } else {
    return new QName(getPackageNamespace(cls), cls.getSimpleName());
  }
}

代码示例来源:origin: Evolveum/midpoint

public static <T> String getTypeLocalName(Class<T> type) {
  XmlType xmlTypeAnn = type.getAnnotation(XmlType.class);
  if (xmlTypeAnn == null) {
    return null;
  }
  return xmlTypeAnn.name();
}

代码示例来源:origin: net.stickycode/sticky-resource

private String typeName(XmlType annotation, Class<?> type) {
 if (annotation.name().equals("##default"))
  return Introspector.decapitalize(type.getSimpleName());
 return annotation.name();
}

代码示例来源:origin: stoicflame/enunciate

/**
 * The name of the xml type element.
 *
 * @return The name of the xml type element.
 */
public String getName() {
 String name = Introspector.decapitalize(getSimpleName().toString());
 if ((xmlType != null) && (!"##default".equals(xmlType.name()))) {
  name = xmlType.name();
  if ("".equals(name)) {
   name = null;
  }
 }
 return name;
}

代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all

@Override
public String findTypeName(AnnotatedClass ac) {
  XmlType type = findAnnotation(XmlType.class, ac, false, false, false);
  if (type != null) {
    String name = type.name();
    if (!MARKER_FOR_DEFAULT.equals(name)) return name;
  }
  return null;
}

代码示例来源:origin: org.apache.wink/wink-common

@SuppressWarnings("unchecked")
private JAXBElement<?> defaultWrapInJAXBElement(Object jaxbObject, Class<?> type) {
  if (logger.isInfoEnabled()) {
    logger.info(Messages.getMessage("jaxbCreateDefaultJAXBElement", type.getName())); //$NON-NLS-1$
  }
  String typeStr = type.getAnnotation(XmlType.class).name();
  return new JAXBElement(new QName(typeStr), type, jaxbObject);
}

代码示例来源:origin: KostyaSha/yet-another-docker-plugin

@Override
public String findTypeName(AnnotatedClass ac) {
  XmlType type = findAnnotation(XmlType.class, ac, false, false, false);
  if (type != null) {
    String name = type.name();
    if (!MARKER_FOR_DEFAULT.equals(name)) return name;
  }
  return null;
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

@Override
public String findTypeName(AnnotatedClass ac) {
  XmlType type = findAnnotation(XmlType.class, ac, false, false, false);
  if (type != null) {
    String name = type.name();
    if (!MARKER_FOR_DEFAULT.equals(name)) return name;
  }
  return null;
}

代码示例来源:origin: Nextdoor/bender

@Override
public String findTypeName(AnnotatedClass ac) {
  XmlType type = findAnnotation(XmlType.class, ac, false, false, false);
  if (type != null) {
    String name = type.name();
    if (!MARKER_FOR_DEFAULT.equals(name)) return name;
  }
  return null;
}

代码示例来源:origin: FasterXML/jackson-module-jaxb-annotations

@Override
public String findTypeName(AnnotatedClass ac) {
  XmlType type = findAnnotation(XmlType.class, ac, false, false, false);
  if (type != null) {
    String name = type.name();
    if (!MARKER_FOR_DEFAULT.equals(name)) return name;
  }
  return null;
}

代码示例来源:origin: mklemm/jaxb2-rich-contract-plugin

private static String getLocalName(final Class<?> boundClass) {
  final XmlRootElement elementAnnotation = boundClass.getAnnotation(XmlRootElement.class);
  if (elementAnnotation != null && !"##default".equals(elementAnnotation.name())) {
    return elementAnnotation.name();
  } else {
    final XmlType xmlTypeAnnotation = boundClass.getAnnotation(XmlType.class);
    if (xmlTypeAnnotation != null && !"##default".equals(xmlTypeAnnotation.name())) {
      return xmlTypeAnnotation.name();
    } else {
      return boundClass.getSimpleName();
    }
  }
}

代码示例来源:origin: org.mitre/stix

/**
 * Return the name from the JAXB model object.
 * 
 * @param obj
 *            Expects a JAXB model object.
 * @return element name
 */
public static String getName(Object obj) {
  try {
    return obj.getClass().getAnnotation(XmlRootElement.class).name();
  } catch (NullPointerException e) {
    return obj.getClass().getAnnotation(XmlType.class).name();
  }
}

相关文章