Examples of XmlRootElement


Examples of javax.xml.bind.annotation.XmlRootElement

    /**
     * Return the root element name for the list of routes.
     */
    private String rootElementName() {
        XmlRootElement annotation = (RoutesType.class).getAnnotation(XmlRootElement.class);
        if (annotation != null) {
            String elementName = annotation.name();
            if (ObjectHelper.isNotNullAndNonEmpty(elementName)) {
                return elementName;
            }
        }
        return DEFAULT_ROOT_ELEMENT_NAME;
View Full Code Here

Examples of javax.xml.bind.annotation.XmlRootElement

    public <T> T convertTo(Class<T> type, Exchange exchange, Object value) {
        return convertTo(type, value);
    }

    protected <T> boolean isJaxbType(Class<T> type) {
        XmlRootElement element = type.getAnnotation(XmlRootElement.class);
        boolean jaxbType = element != null;
        return jaxbType;
    }
View Full Code Here

Examples of javax.xml.bind.annotation.XmlRootElement

       
        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());
View Full Code Here

Examples of javax.xml.bind.annotation.XmlRootElement

       
    }

    private QName getJaxbQName(JAXBContextProxy jaxbProxy, Class<?> type, Map<Class<?>, QName> clsMap) {

        XmlRootElement root = type.getAnnotation(XmlRootElement.class);
        if (root != null) {
            return getJaxbQName(root.name(), root.namespace(), type, clsMap);
        }

        try {
            JAXBBeanInfo jaxbInfo = jaxbProxy == null ? null : JAXBUtils.getBeanInfo(jaxbProxy, type);
            if (jaxbInfo == null) {
View Full Code Here

Examples of javax.xml.bind.annotation.XmlRootElement

            }
        }

        QName elementQName = null;
        QName typeQName = null;
        XmlRootElement rootElement = javaType.getAnnotation(XmlRootElement.class);
        if (rootElement != null) {
            String elementName = rootElement.name();
            String elementNamespace = rootElement.namespace();
            if (elementNamespace.equals("##default")) {
                elementNamespace = namespace;
            }
            if (elementName.equals("##default")) {
                elementName = Introspector.decapitalize(javaType.getSimpleName());
View Full Code Here

Examples of javax.xml.bind.annotation.XmlRootElement

            }
        }

        QName elementQName = null;
        QName typeQName = null;
        XmlRootElement rootElement = javaType.getAnnotation(XmlRootElement.class);
        if (rootElement != null) {
            String elementName = rootElement.name();
            String elementNamespace = rootElement.namespace();
            if (elementNamespace.equals("##default")) {
                elementNamespace = namespace;
            }
            if (elementName.equals("##default")) {
                elementName = jaxbDecapitalize(javaType.getSimpleName());
View Full Code Here

Examples of javax.xml.bind.annotation.XmlRootElement

        return xmlSchemaCollection;
    }
   
    private QName getQName(JAXBContextProxy jaxbProxy, Class<?> type, Map<Class<?>, QName> clsMap) {
       
        XmlRootElement root = type.getAnnotation(XmlRootElement.class);
        if (root != null) {
            QName qname = getQNameFromParts(root.name(), root.namespace(), clsMap);
            if (qname != null) {
                return qname;
            }
            String ns = JAXBUtils.getPackageNamespace(type);
            if (ns != null) {
                return getQNameFromParts(root.name(), ns, clsMap);
            } else {
                return null;
            }
        }
       
View Full Code Here

Examples of javax.xml.bind.annotation.XmlRootElement

       
        if (cls == JAXBElement.class) {
            return object != null ? ((JAXBElement)object).getName() : null;
        }
       
        XmlRootElement root = cls.getAnnotation(XmlRootElement.class);
        QName qname = null;
        if (root != null) {
            String namespace = getNamespace(root.namespace());
            if ("".equals(namespace)) {
                String packageNs = JAXBUtils.getPackageNamespace(cls);
                if (packageNs != null) {
                    namespace = getNamespace(packageNs);
                }
            }
            String name = getLocalName(root.name(), cls.getSimpleName(), pluralName);
            return new QName(namespace, name);
        } else {
            JAXBContext context = getJAXBContext(cls, type);
            JAXBContextProxy proxy = ReflectionInvokationHandler.createProxyWrapper(context,
                                                                                    JAXBContextProxy.class);
View Full Code Here

Examples of javax.xml.bind.annotation.XmlRootElement

    assertEquals(parents.size(),15);
  }

  @Test
  public void testGetAnnotation() {
    XmlRootElement element = ReflectionUtils.getAnnotation(user.getClass(), XmlRootElement.class);
   
    assertEquals(element.name(),"user");
  }
View Full Code Here

Examples of javax.xml.bind.annotation.XmlRootElement

        return xmlSchemaCollection;
    }

    private QName getJaxbQName(JAXBContextProxy jaxbProxy, Class<?> type, Map<Class<?>, QName> clsMap) {

        XmlRootElement root = type.getAnnotation(XmlRootElement.class);
        if (root != null) {
            QName qname = getQNameFromParts(root.name(), root.namespace(), type, clsMap);
            if (qname != null) {
                return qname;
            }
            String ns = JAXBUtils.getPackageNamespace(type);
            if (ns != null) {
                return getQNameFromParts(root.name(), ns, type, clsMap);
            } else {
                return null;
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.