Package javax.xml.bind.annotation

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


       
        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

       
        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

            }
        }

        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

        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(), 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

        }
        return answer;
    }

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

        }
        return answer;
    }

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

       
        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 (cls.getAnnotation(XmlType.class) != null) {
            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

        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

            if (interceptSend.getSkipSendToOriginalEndpoint()) {
                buffer.append(".skipSendToOriginalEndpoint()");
            }
        } else if (out instanceof MarshalDefinition) {
            DataFormatDefinition dataFormat = ((MarshalDefinition)out).getDataFormatType();
            XmlRootElement xmlRoot = dataFormat.getClass().getAnnotation(XmlRootElement.class);
            buffer.append("().").append(xmlRoot.name()).append("()");
        } else if (out instanceof MulticastDefinition) {
            buffer.append("()");
        } else if (out instanceof OtherwiseDefinition) {
            buffer.append("()");
        } else if (out instanceof PipelineDefinition) {
            // transformed into simple ToDefinition
        } else if (out instanceof PolicyDefinition) {
            renderPolicy(buffer, out);
        } else if (out instanceof PollEnrichDefinition) {
            renderPollEnrich(buffer, out);
        } else if (out instanceof ProcessDefinition) {
            renderProcess(buffer, out);
        } else if (out instanceof RemoveHeaderDefinition) {
            RemoveHeaderDefinition remove = (RemoveHeaderDefinition)out;
            buffer.append("(\"").append(remove.getHeaderName()).append("\")");
        } else if (out instanceof RemovePropertyDefinition) {
            RemovePropertyDefinition remove = (RemovePropertyDefinition)out;
            buffer.append("(\"").append(remove.getPropertyName()).append("\")");
        } else if (out instanceof SetExchangePatternDefinition) {
            SetExchangePatternDefinition setEP = (SetExchangePatternDefinition)out;
            buffer.append("(ExchangePattern.");
            buffer.append(setEP.getPattern().toString());
            buffer.append(")");
        } else if (out instanceof SortDefinition) {
            SortDefinition sort = (SortDefinition)out;
            buffer.append("(");
            ExpressionRenderer.renderExpression(buffer, sort.getExpression().toString());
            buffer.append(")");
        } else if (out instanceof StopDefinition) {
            buffer.append("()");
        } else if (out instanceof ThreadsDefinition) {
            renderThreads(buffer, out);
        } else if (out instanceof TransactedDefinition) {
            renderTransacted(buffer, out);
        } else if (out instanceof TryDefinition) {
            buffer.append("()");
        } else if (out instanceof UnmarshalDefinition) {
            DataFormatDefinition dataFormat = ((UnmarshalDefinition)out).getDataFormatType();
            XmlRootElement xmlRoot = dataFormat.getClass().getAnnotation(XmlRootElement.class);
            buffer.append("().").append(xmlRoot.name()).append("()");
        }
    }
View Full Code Here

TOP

Related Classes of javax.xml.bind.annotation.XmlRootElement

Copyright © 2018 www.massapicom. 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.