Examples of Unmarshaller


Examples of javax.xml.bind.Unmarshaller

  @XmlElement(namespace="http://www.metamatrix.com/metamodels/MetaMatrixFunction", name="ScalarFunction")
  List<FunctionMethod> functionMethods = new ArrayList<FunctionMethod>();
 
  public static List<FunctionMethod> loadFunctionMethods(InputStream source) throws JAXBException {
    JAXBContext jc = JAXBContext.newInstance(new Class<?>[] {FunctionMetadataReader.class});
    Unmarshaller marshaller = jc.createUnmarshaller();
    FunctionMetadataReader md = (FunctionMetadataReader) marshaller.unmarshal(source);
    return md.functionMethods;
  }
View Full Code Here

Examples of javax.xml.bind.Unmarshaller

           
            SOAPEnvelope env = message.getSOAPPart().getEnvelope();
            SOAPHeader header = env.getHeader();
           
            if (header != null) {
                Unmarshaller unmarshaller =
                    getJAXBContext().createUnmarshaller();
                Iterator headerElements = header.examineAllHeaderElements();
                while (headerElements.hasNext()) {
                    SOAPHeaderElement headerElement =
                        (SOAPHeaderElement)headerElements.next();
View Full Code Here

Examples of javax.xml.bind.Unmarshaller

    private void setUpDecode(SOAPMessageContext context,
                             SOAPHeader header,
                             AddressingPropertiesImpl maps,
                             String mapProperty,
                             boolean requestor) throws Exception {
        Unmarshaller unmarshaller = control.createMock(Unmarshaller.class);
        ContextUtils.getJAXBContext().createUnmarshaller();
        EasyMock.expectLastCall().andReturn(unmarshaller);
        Iterator headerItr = control.createMock(Iterator.class);
        header.examineAllHeaderElements();
        EasyMock.expectLastCall().andReturn(headerItr);
View Full Code Here

Examples of javax.xml.bind.Unmarshaller

        AddressingPropertiesImpl maps = null;
        try {
            SOAPEnvelope env = message.getSOAPPart().getEnvelope();
            SOAPHeader header = env.getHeader();
            if (header != null) {
                Unmarshaller unmarshaller = null;
                Iterator headerElements = header.examineAllHeaderElements();
                while (headerElements.hasNext()) {
                    SOAPHeaderElement headerElement =
                        (SOAPHeaderElement)headerElements.next();
                    Name headerName = headerElement.getElementName();
View Full Code Here

Examples of javax.xml.bind.Unmarshaller

                obj = new SAXSource(inputSource);
            } else if (StreamSource.class.isAssignableFrom(callback.getSupportedFormats()[0])) {    
                obj = new StreamSource(getSOAPBodyStream(doc));
            } else if (Object.class.isAssignableFrom(callback.getSupportedFormats()[0])) {          
                JAXBContext context = callback.getJAXBContext();
                Unmarshaller u = context.createUnmarshaller();
                return u.unmarshal(doc);                   
            }
        } catch (Exception se) {
            se.printStackTrace();
        }
        return obj;
View Full Code Here

Examples of javax.xml.bind.Unmarshaller

        Object obj = null;
        try {
            if (context == null) {
                context = JAXBContext.newInstance(clazz);
            }
            Unmarshaller u = context.createUnmarshaller();
            u.setSchema(schema);

            obj = (clazz != null) ? u.unmarshal(srcNode, clazz) : u.unmarshal(srcNode);
           
            if (obj instanceof JAXBElement<?>) {
                JAXBElement<?> el = (JAXBElement<?>)obj;
                if (isSame(el.getName(), elName)) {
                    obj = el.getValue();
View Full Code Here

Examples of javax.xml.bind.Unmarshaller

    }

    public static Object unmarshall(JAXBContext context, Schema schema, Node srcNode, QName elName) {
        Object obj = null;
        try {
            Unmarshaller u = context.createUnmarshaller();
            u.setSchema(schema);

            obj = u.unmarshal(srcNode);
           
            if (obj instanceof JAXBElement<?>) {
                JAXBElement<?> el = (JAXBElement<?>)obj;
                if (el.getName().equals(elName)) {
                    obj = el.getValue();
View Full Code Here

Examples of javax.xml.bind.Unmarshaller

        if (nl.getLength() > 0) {
            JAXBContext context = null;
            String packageName = RMUtils.getWSRMPolicyFactory().getClass().getPackage().getName();
            try {
                context = JAXBContext.newInstance(packageName, getClass().getClassLoader());
                Unmarshaller u = context.createUnmarshaller();
                Object obj = u.unmarshal(nl.item(0));
                if (obj instanceof JAXBElement<?>) {
                    JAXBElement<?> el = (JAXBElement<?>)obj;
                    obj = el.getValue();
                }
                rma = (RMAssertionType)obj;
View Full Code Here

Examples of javax.xml.bind.Unmarshaller

        }
        JAXBContext context = null;
        Object obj = null;

        context = JAXBContext.newInstance(packageName, getClass().getClassLoader());
        Unmarshaller u = context.createUnmarshaller();
        if (doValidate) {
            u.setSchema(schema);
        }
        obj = u.unmarshal(data);
        if (obj instanceof JAXBElement<?>) {
            JAXBElement<?> el = (JAXBElement<?>)obj;
            obj = el.getValue();
            /*
             * if (el.getName().equals(type)) { obj = el.getValue(); }
View Full Code Here

Examples of javax.xml.bind.Unmarshaller

            InputStream in = wsDDUrl.openStream();
            if (in == null) {
                throw new DeploymentException("unable to read descriptor " + wsDDUrl);
            }
           
            Unmarshaller unmarshaller = getJAXBContext().createUnmarshaller();
            Object obj = unmarshaller.unmarshal(in);
           
            WebservicesType wst = null;
            if (obj instanceof JAXBElement) {
                wst = (WebservicesType)((JAXBElement)obj).getValue();
            }
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.