Search in sources :

Example 81 with Unmarshaller

use of javax.xml.bind.Unmarshaller in project opennms by OpenNMS.

the class MonitoredService method unmarshal.

/**
     * Method unmarshal.
     * 
     * @param reader
     * @return the unmarshaled
     * org.opennms.client.schema.MonitoredService
     * @throws JAXBException 
     */
public static org.opennms.client.schema.MonitoredService unmarshal(final java.io.Reader reader) throws JAXBException {
    final JAXBContext context = JAXBContext.newInstance(MonitoredService.class);
    final Unmarshaller um = context.createUnmarshaller();
    return (MonitoredService) um.unmarshal(reader);
}
Also used : JAXBContext(javax.xml.bind.JAXBContext) Unmarshaller(javax.xml.bind.Unmarshaller)

Example 82 with Unmarshaller

use of javax.xml.bind.Unmarshaller in project opennms by OpenNMS.

the class Node method unmarshal.

/**
     * Method unmarshal.
     * 
     * @param reader
     * @throws org.exolab.castor.xml.MarshalException if object is
     * null or if any SAXException is thrown during marshaling
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     * @return the unmarshaled org.opennms.client.schema.Node
     * @throws JAXBException 
     */
public static org.opennms.client.schema.Node unmarshal(final java.io.Reader reader) throws JAXBException {
    final JAXBContext context = JAXBContext.newInstance(Node.class);
    final Unmarshaller um = context.createUnmarshaller();
    return (Node) um.unmarshal(reader);
}
Also used : JAXBContext(javax.xml.bind.JAXBContext) Unmarshaller(javax.xml.bind.Unmarshaller)

Example 83 with Unmarshaller

use of javax.xml.bind.Unmarshaller in project opennms by OpenNMS.

the class Interface method unmarshal.

/**
     * Method unmarshal.
     * 
     * @param reader
     * @return the unmarshaled org.opennms.client.schema.Interface
     * @throws JAXBException 
     */
public static org.opennms.client.schema.Interface unmarshal(final java.io.Reader reader) throws JAXBException {
    final JAXBContext context = JAXBContext.newInstance(Interface.class);
    final Unmarshaller um = context.createUnmarshaller();
    return (Interface) um.unmarshal(reader);
}
Also used : JAXBContext(javax.xml.bind.JAXBContext) Unmarshaller(javax.xml.bind.Unmarshaller)

Example 84 with Unmarshaller

use of javax.xml.bind.Unmarshaller in project opennms by OpenNMS.

the class ModelImport method unmarshal.

/**
     * Method unmarshal.
     * 
     * @param reader
     * @throws org.exolab.castor.xml.MarshalException if object is
     * null or if any SAXException is thrown during marshaling
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     * @return the unmarshaled org.opennms.client.schema.ModelImport
     * @throws JAXBException 
     */
public static org.opennms.client.schema.ModelImport unmarshal(final java.io.Reader reader) throws JAXBException {
    final JAXBContext context = JAXBContext.newInstance(ModelImport.class);
    final Unmarshaller um = context.createUnmarshaller();
    return (ModelImport) um.unmarshal(reader);
}
Also used : JAXBContext(javax.xml.bind.JAXBContext) Unmarshaller(javax.xml.bind.Unmarshaller)

Example 85 with Unmarshaller

use of javax.xml.bind.Unmarshaller in project opennms by OpenNMS.

the class Asset method unmarshal.

/**
     * Method unmarshal.
     * 
     * @param reader
     * @return the unmarshaled org.opennms.client.schema.Asset
     * @throws JAXBException 
     */
public static org.opennms.client.schema.Asset unmarshal(final java.io.Reader reader) throws JAXBException {
    final JAXBContext context = JAXBContext.newInstance(Asset.class);
    final Unmarshaller um = context.createUnmarshaller();
    return (Asset) um.unmarshal(reader);
}
Also used : JAXBContext(javax.xml.bind.JAXBContext) Unmarshaller(javax.xml.bind.Unmarshaller)

Aggregations

Unmarshaller (javax.xml.bind.Unmarshaller)292 JAXBContext (javax.xml.bind.JAXBContext)240 JAXBException (javax.xml.bind.JAXBException)97 InputStream (java.io.InputStream)91 Test (org.junit.Test)79 StringReader (java.io.StringReader)40 BaseTest (org.orcid.core.BaseTest)39 V2Convertible (org.orcid.core.version.V2Convertible)39 File (java.io.File)33 InputSource (org.xml.sax.InputSource)22 IOException (java.io.IOException)21 JAXBElement (javax.xml.bind.JAXBElement)18 Marshaller (javax.xml.bind.Marshaller)18 ByteArrayInputStream (java.io.ByteArrayInputStream)17 SAXSource (javax.xml.transform.sax.SAXSource)17 SAXParserFactory (javax.xml.parsers.SAXParserFactory)13 XMLInputFactory (javax.xml.stream.XMLInputFactory)13 XMLStreamException (javax.xml.stream.XMLStreamException)13 XMLStreamReader (javax.xml.stream.XMLStreamReader)13 Schema (javax.xml.validation.Schema)13