Package javax.xml.bind

Examples of javax.xml.bind.Unmarshaller.unmarshal()


    public static Object unmarshal(JAXBContext context, OMElement element, boolean cache) throws JAXBException {
        UnmarshallerAdapter adapter = org.apache.axiom.util.jaxb.JAXBUtils.getUnmarshallerAdapter(
                element.getXMLStreamReader(cache));
        Unmarshaller unmarshaller = context.createUnmarshaller();
        unmarshaller.setAttachmentUnmarshaller(adapter.getAttachmentUnmarshaller());
        return unmarshaller.unmarshal(adapter.getReader());
    }
}
View Full Code Here


      staxEventReader = new JpaNamespaceTransformingEventReader( staxEventReader );
      JAXBContext jaxbContext = JAXBContext.newInstance( ObjectFactory.class );
      Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
      unmarshaller.setSchema( schema );
      unmarshaller.setEventHandler( handler );
      return clazz.cast( unmarshaller.unmarshal( staxEventReader ) );
    }
    catch ( JAXBException e ) {
      StringBuilder builder = new StringBuilder();
      builder.append( "Unable to perform unmarshalling at line number " );
      builder.append( handler.getLineNumber() );
View Full Code Here

    public abstract List<SamlExternalEntity> getExternalSamlEntities();

    protected void readEntitiesDescriptor(Reader reader) {
        try {
            Unmarshaller unmarshaller = metaDataJaxbContext.createUnmarshaller();
            JAXBElement<?> o = (JAXBElement<?>) unmarshaller.unmarshal(reader);
            EntitiesDescriptorType entitiesDescriptor = (EntitiesDescriptorType) o.getValue();
            readEntitiesDescriptor(entitiesDescriptor);
        } catch (JAXBException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

    }

    protected EntityDescriptorType readEntityDescriptor(Reader metaInfoReader) {
        try {
            Unmarshaller unmarshaller = metaDataJaxbContext.createUnmarshaller();
            JAXBElement<?> o = (JAXBElement<?>) unmarshaller.unmarshal(metaInfoReader);
            EntityDescriptorType entityDescriptor = (EntityDescriptorType) o.getValue();
            return entityDescriptor;
        } catch (JAXBException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

    private RequestAbstractType getSamlRequest(Document document) throws InvalidRequestException {
        try {
            Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
            @SuppressWarnings("unchecked")
            JAXBElement<RequestAbstractType> jaxbRequest = (JAXBElement<RequestAbstractType>) unmarshaller.unmarshal(document);
            RequestAbstractType request = jaxbRequest.getValue();
            return request;
        } catch (JAXBException e) {
            throw new InvalidRequestException("SAML message could not be parsed", e);
        }
View Full Code Here

    private StatusResponseType getSamlResponse(Document document) throws InvalidRequestException {
        try {
            Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
            @SuppressWarnings("unchecked")
            JAXBElement<StatusResponseType> jaxbResponseType = (JAXBElement<StatusResponseType>) unmarshaller.unmarshal(document);
            StatusResponseType statusResponse = jaxbResponseType.getValue();
            return statusResponse;
        } catch (JAXBException e) {
            throw new InvalidRequestException("SAML message could not be parsed", e);
        }
View Full Code Here

            // must use classloader from CamelContext to have JAXB working
            jaxbContext = JAXBContext.newInstance(Constants.JAXB_CONTEXT_PACKAGES, CamelContext.class.getClassLoader());
        }

        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
        Object result = unmarshaller.unmarshal(is);

        if (result == null) {
            throw new IOException("Cannot unmarshal to routes using JAXB from input stream: " + is);
        }
View Full Code Here

                        ((Entry) target).setParent((Entry) parent);
                    }
                }
            });

            root = (Root) unmarshaller.unmarshal(TreeModelDataBean.class.getResource("tree-model-data.xml"));
        } catch (JAXBException e) {
            throw new FacesException(e.getMessage(), e);
        }
    }
View Full Code Here

      JAXBContext context;
      try {
        context = JAXBContext.newInstance(ObjectFactory.class);
        final Unmarshaller unmarshaller = context.createUnmarshaller();
        unmarshaller.setSchema(null);
        final SqlResourceDefinition definition = ((JAXBElement<SqlResourceDefinition>) unmarshaller
            .unmarshal(inputStream)).getValue();
        final SqlBuilder sqlBuilder = Factory.getSqlBuilder();
        sqlResource = new SqlResourceImpl(resName, definition, Factory.getSqlResourceMetaData(
            resName, definition, sqlBuilder), sqlBuilder, new ArrayList<Trigger>());
        sqlResources.put(resName, sqlResource);
View Full Code Here

      }
      JAXBElement<?> result;
      try
      {
         Unmarshaller unmarshaller = jaxb.createUnmarshaller();
         JAXBElement<?> e = unmarshaller.unmarshal(new StreamSource(entityStream), (Class<?>) typeArg);
         result = e;
      }
      catch (JAXBException e)
      {
         throw new ExceptionAdapter(e);
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.