public String namespace() { return core.namespace(); }
XmlRootElement annotation = outputClass.getAnnotation(XmlRootElement.class); localPart = annotation.name(); namespaceUri = annotation.namespace();
protected XML resolveXml(Annotated a, Annotation[] annotations, io.swagger.v3.oas.annotations.media.Schema schema) { // if XmlRootElement annotation, construct an Xml object and attach it to the model XmlRootElement rootAnnotation = null; if (a != null) { rootAnnotation = a.getAnnotation(XmlRootElement.class); } if (rootAnnotation == null) { if (annotations != null) { for (Annotation ann: annotations) { if (ann instanceof XmlRootElement) { rootAnnotation = (XmlRootElement)ann; break; } } } } if (rootAnnotation != null && !"".equals(rootAnnotation.name()) && !"##default".equals(rootAnnotation.name())) { XML xml = new XML().name(rootAnnotation.name()); if (rootAnnotation.namespace() != null && !"".equals(rootAnnotation.namespace()) && !"##default".equals(rootAnnotation.namespace())) { xml.namespace(rootAnnotation.namespace()); } return xml; } return null; }
XmlRootElement annotation = outputClass.getAnnotation(XmlRootElement.class); localPart = annotation.name(); namespaceUri = annotation.namespace();
/** * Parses an {@link XmlRootElement} annotation on a class * and determine the element name. * * @return null * if none was found. */ protected final QName parseElementName(ClassDeclT clazz) { XmlRootElement e = reader().getClassAnnotation(XmlRootElement.class,clazz,this); if(e==null) return null; String local = e.name(); if(local.equals("##default")) { // if defaulted... local = NameConverter.standard.toVariableName(nav().getClassShortName(clazz)); } String nsUri = e.namespace(); if(nsUri.equals("##default")) { // if defaulted ... XmlSchema xs = reader().getPackageAnnotation(XmlSchema.class,clazz,this); if(xs!=null) nsUri = xs.namespace(); else { nsUri = builder.defaultNsUri; } } return new QName(nsUri.intern(),local.intern()); }
public String namespace() { return core.namespace(); }
@Override public PropertyName findRootName(AnnotatedClass ac) { XmlRootElement elem = findRootElementAnnotation(ac); if (elem != null) { return _combineNames(elem.name(), elem.namespace(), ""); } return null; }
public String findNamespace(Annotated ann) { String ns = null; if (ann instanceof AnnotatedClass) { // For classes, it must be @XmlRootElement. Also, we do // want to use defaults from package, base class XmlRootElement elem = findRootElementAnnotation((AnnotatedClass) ann); if (elem != null) { ns = elem.namespace(); } } else { // For others, XmlElement or XmlAttribute work (anything else?) XmlElement elem = findAnnotation(XmlElement.class, ann, false, false, false); if (elem != null) { ns = elem.namespace(); } if (ns == null || MARKER_FOR_DEFAULT.equals(ns)) { XmlAttribute attr = findAnnotation(XmlAttribute.class, ann, false, false, false); if (attr != null) { ns = attr.namespace(); } } } // JAXB uses marker for "not defined" if (MARKER_FOR_DEFAULT.equals(ns)) { ns = null; } return ns; }
/** * Parses an {@link XmlRootElement} annotation on a class * and determine the element name. * * @return null * if none was found. */ protected final QName parseElementName(ClassDeclT clazz) { XmlRootElement e = reader().getClassAnnotation(XmlRootElement.class,clazz,this); if(e==null) return null; String local = e.name(); if(local.equals("##default")) { // if defaulted... local = NameConverter.standard.toVariableName(nav().getClassShortName(clazz)); } String nsUri = e.namespace(); if(nsUri.equals("##default")) { // if defaulted ... XmlSchema xs = reader().getPackageAnnotation(XmlSchema.class,clazz,this); if(xs!=null) nsUri = xs.namespace(); else { nsUri = builder.defaultNsUri; } } return new QName(nsUri.intern(),local.intern()); }
String name = rootElement.name(); if (!MARKER_FOR_DEFAULT.equals(name)) { return _combineNames(name, rootElement.namespace(), defaultName);
/** * The namespace of the xml element. * * @return The namespace of the xml element. */ public String getNamespace() { String namespace = getPackage().getNamespace(); if ((rootElement != null) && (!"##default".equals(rootElement.namespace()))) { namespace = rootElement.namespace(); } return namespace; }
/** * The namespace of the xml element. * * @return The namespace of the xml element. */ public String getNamespace() { String namespace = getPackage().getNamespace(); if ((rootElement != null) && (!"##default".equals(rootElement.namespace()))) { namespace = rootElement.namespace(); } return namespace; }
/** * The namespace of the xml element. * * @return The namespace of the xml element. */ public String getNamespace() { String namespace = getPackage().getNamespace(); if ((rootElement != null) && (!"##default".equals(rootElement.namespace()))) { namespace = rootElement.namespace(); } return namespace; }
public static QName getJaxbQName(final Class<?> type) { final XmlRootElement root = type.getAnnotation(XmlRootElement.class); if (root != null) { return getJaxbQName(root.name(), root.namespace(), type); } return null; }
protected static QName getJaxbQName(Class<?> cls) { XmlRootElement root = cls.getAnnotation(XmlRootElement.class); if (root != null) { String namespace = getNamespace(root.namespace()); String name = getLocalName(root.name(), cls.getSimpleName()); return new QName(namespace, name); } return null; }
@Override public QName findRootElement(Annotated ann) { XmlRootElement root = findAnnotation(XmlRootElement.class, ann, false, false, false); if (root != null) { return new QName(handleJaxbDefault(root.namespace()), handleJaxbDefault(root.name())); } return null; }
@Override public PropertyName findRootName(AnnotatedClass ac) { XmlRootElement elem = findRootElementAnnotation(ac); if (elem != null) { return _combineNames(elem.name(), elem.namespace(), ""); } return null; }
public ElementFilter(Class<? extends PMMLObject> clazz){ XmlRootElement element = getElement(clazz); setNamespaceURI(element.namespace()); setLocalName(element.name()); }
public ElementFilter(Class<? extends PMMLObject> clazz){ XmlRootElement element = getElement(clazz); setNamespaceURI(element.namespace()); setLocalName(element.name()); }
public ElementFilter(XMLReader reader, Class<? extends PMMLObject> clazz){ super(reader); XmlRootElement element = getElement(clazz); setNamespaceURI(element.namespace()); setLocalName(element.name()); }