Examples of JAXBElement


Examples of javax.xml.bind.JAXBElement

                    theList.set(i, createJAXBElementFromXMLRoot((Root) next, declaredType));
                }
            }
        } else if (value instanceof WrappedValue) {
            QName qname = new QName(xmlRoot.getNamespaceURI(), xmlRoot.getLocalName());
            return new JAXBElement(qname, ((WrappedValue) value).getDeclaredType(), ((WrappedValue) value).getValue());
        } else if (value instanceof JAXBElement) {
            return (JAXBElement) value;
        } else if (value instanceof ManyValue) {
            value = ((ManyValue) value).getItem();
        }
View Full Code Here

Examples of javax.xml.bind.JAXBElement

        return createJAXBElement(qname, declaredType, value);
    }

    protected JAXBElement createJAXBElement(QName qname, Class theClass, Object value) {
        if (theClass == null) {
            return new JAXBElement(qname, Object.class, value);
        }

        if (CoreClassConstants.XML_GREGORIAN_CALENDAR.isAssignableFrom(theClass)) {
            theClass = CoreClassConstants.XML_GREGORIAN_CALENDAR;
        } else if (CoreClassConstants.DURATION.isAssignableFrom(theClass)) {
            theClass = CoreClassConstants.DURATION;
        }

        return new JAXBElement(qname, theClass, value);
    }
View Full Code Here

Examples of javax.xml.bind.JAXBElement

                // Set for List<T>
                setList(targetBean, propValue);
            } else if (descriptor.getPropertyType() == JAXBElement.class) {
                if (propValue != null) {
                    Class clazz = dclClass!=null ? dclClass : propValue.getClass();
                    JAXBElement element = new JAXBElement(xmlName, clazz, propValue);
                    setAtomic(targetBean, element, writeMethod);
                }
            } else {
                // Normal case
                setAtomic(targetBean, propValue, writeMethod);
View Full Code Here

Examples of javax.xml.bind.JAXBElement

    private String extractStringElementFromAny(QName elementQName, EndpointReferenceType epr) {
        String elementStringValue = null;
        if (null != epr.getReferenceParameters()) {
            for (Object o : epr.getReferenceParameters().getAny()) {
                if (o instanceof JAXBElement) {
                    JAXBElement el = (JAXBElement)o;
                    if (el.getName().equals(elementQName)) {
                        elementStringValue = (String)el.getValue();
                    }
                }
            }
        }
        return elementStringValue;
View Full Code Here

Examples of javax.xml.bind.JAXBElement

            QName wrapperQName = new QName(operationDesc.getResponseWrapperTargetNamespace(),
                                           operationDesc.getResponseWrapperLocalName());

            // Make sure object can be rendered as an element
            if (!marshalDesc.getAnnotationDesc(cls).hasXmlRootElement()) {
                object = new JAXBElement(wrapperQName, cls, object);
            }
           
            // Enable SWA for nested SwaRef attachments
            if (operationDesc.hasResponseSwaRefAttachments()) {
                m.setDoingSWA(true);
View Full Code Here

Examples of javax.xml.bind.JAXBElement

            QName wrapperQName = new QName(operationDesc.getRequestWrapperTargetNamespace(),
                                           operationDesc.getRequestWrapperLocalName());

            // Make sure object can be rendered as an element
            if (!marshalDesc.getAnnotationDesc(cls).hasXmlRootElement()) {
                object = new JAXBElement(wrapperQName, cls, object);
            }
           
            // Enable SWA for nested SwaRef attachments
            if (operationDesc.hasRequestSwaRefAttachments()) {
                m.setDoingSWA(true);
View Full Code Here

Examples of javax.xml.bind.JAXBElement

                                                 faultBeanDesc.getFaultBeanLocalName());
                // Make sure the faultBeanObject can be marshalled as an element
                if (!marshalDesc.getAnnotationDesc(faultBeanObject.getClass()).
                        hasXmlRootElement())
                {
                    faultBeanObject = new JAXBElement(faultBeanQName, faultBeanObject.getClass(),
                                                      faultBeanObject);
                }

                // Create a detailblock representing the faultBeanObject
                Block[] detailBlocks = new Block[1];
View Full Code Here

Examples of javax.xml.bind.JAXBElement

    }

    public Object getElementValue() {
        if (elementValue == null) {
            // Create ElementValue from type information
            elementValue = new JAXBElement(qName, typeClass, typeValue);
        }
        return elementValue;
    }
View Full Code Here

Examples of javax.xml.bind.JAXBElement

                if (representAsOccurrence(returnObject, returnType)) {
                    if (log.isDebugEnabled()) {
                        log.debug("Return element isListOrArray");
                    }
                    OccurrenceArray occurrenceArray = new OccurrenceArray(returnObject);
                    JAXBElement jaxb = new JAXBElement(returnQName, returnType, occurrenceArray);
                    returnElement = new Element(jaxb, returnQName);
                } else if (marshalDesc.getAnnotationDesc(returnType).hasXmlRootElement()) {
                    returnElement = new Element(returnObject, returnQName);
                } else {
                    returnElement = new Element(returnObject, returnQName, returnType);
View Full Code Here

Examples of javax.xml.bind.JAXBElement

        // separate (occurrence) elements
        Element element = pde.getElement();
        if (element != null) {
            Object elementValue = element.getElementValue();
            if (elementValue instanceof JAXBElement) {
                JAXBElement jaxb = (JAXBElement) elementValue;
                Object value = jaxb.getValue();
                if (representAsOccurrence(value, jaxb.getDeclaredType())) {
                    if (log.isDebugEnabled()) {
                        log.debug("Build OccurrentArray");
                    }
                    OccurrenceArray occurrenceArray = new OccurrenceArray(value);
                    JAXBElement newJAXBElement =
                        new JAXBElement(jaxb.getName(),
                                jaxb.getDeclaredType(),
                                occurrenceArray);
                    element = new Element(newJAXBElement, jaxb.getName());
                    pde = new PDElement(pde.getParam(), element, 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.