net.sf.csutils.core.utils
Class JaxbReader<CLSS>

java.lang.Object
  extended by net.sf.csutils.core.utils.JaxbReader<CLSS>

public class JaxbReader<CLSS>
extends java.lang.Object

Helper class, which provides useful tools for working with JAXB.


Constructor Summary
JaxbReader(java.lang.Class<CLSS> pClass)
           
 
Method Summary
 CLSS read(java.io.File pFile)
          Reads and deserializes a JAXB bean from the XML stream provided by the given File.
 CLSS read(org.xml.sax.InputSource pSource)
          Reads and deserializes a JAXB bean from the XML stream provided by the given InputSource.
 CLSS read(java.io.InputStream pStream)
          Reads and deserializes a JAXB bean by reading the given InputStream.
 CLSS read(org.w3c.dom.Node pNode)
          Reads and deserializes a JAXB bean from the XML stream provided by the given Node.
 CLSS read(java.lang.Object pObject)
           
 CLSS read(java.io.Reader pReader)
          Reads and deserializes a JAXB bean from the XML stream provided by the given Reader.
 CLSS read(javax.xml.transform.Source pSource)
          Reads and deserializes a JAXB bean from the XML stream provided by the given Source.
 CLSS read(java.net.URL pURL)
          Reads and deserializes a JAXB bean from the XML stream provided by the given URL.
 CLSS read(javax.xml.stream.XMLEventReader pReader)
          Reads and deserializes a JAXB bean from the XML stream provided by the given XMLEventReader.
 CLSS read(javax.xml.stream.XMLStreamReader pReader)
          Reads and deserializes a JAXB bean from the XML stream provided by the given XMLStreamReader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaxbReader

public JaxbReader(java.lang.Class<CLSS> pClass)
Method Detail

read

public CLSS read(java.io.InputStream pStream)
          throws javax.xml.bind.JAXBException
Reads and deserializes a JAXB bean by reading the given InputStream.

Parameters:
pStream - The stream, from which to read the JAXB bean.
Returns:
The deserialized JAXB bean.
Throws:
javax.xml.bind.JAXBException - The operation failed.

read

public CLSS read(java.io.File pFile)
          throws javax.xml.bind.JAXBException
Reads and deserializes a JAXB bean from the XML stream provided by the given File.

Parameters:
pFile - The file, from which to read the JAXB bean.
Returns:
The deserialized JAXB bean.
Throws:
javax.xml.bind.JAXBException - The operation failed.

read

public CLSS read(org.xml.sax.InputSource pSource)
          throws javax.xml.bind.JAXBException
Reads and deserializes a JAXB bean from the XML stream provided by the given InputSource.

Parameters:
pSource - The SAX source, from which to read the JAXB bean.
Returns:
The deserialized JAXB bean.
Throws:
javax.xml.bind.JAXBException - The operation failed.

read

public CLSS read(java.io.Reader pReader)
          throws javax.xml.bind.JAXBException
Reads and deserializes a JAXB bean from the XML stream provided by the given Reader.

Parameters:
pReader - The reader, from which to read the JAXB bean.
Returns:
The deserialized JAXB bean.
Throws:
javax.xml.bind.JAXBException - The operation failed.

read

public CLSS read(org.w3c.dom.Node pNode)
          throws javax.xml.bind.JAXBException
Reads and deserializes a JAXB bean from the XML stream provided by the given Node.

Parameters:
pNode - The node, from which to read the XML stream.
Returns:
The deserialized JAXB bean.
Throws:
javax.xml.bind.JAXBException - The operation failed.

read

public CLSS read(javax.xml.transform.Source pSource)
          throws javax.xml.bind.JAXBException
Reads and deserializes a JAXB bean from the XML stream provided by the given Source.

Parameters:
pSource - The transformer source providing the XML stream.
Returns:
The deserialized JAXB bean.
Throws:
javax.xml.bind.JAXBException - The operation failed.

read

public CLSS read(java.net.URL pURL)
          throws java.io.IOException,
                 javax.xml.bind.JAXBException
Reads and deserializes a JAXB bean from the XML stream provided by the given URL.

Parameters:
pURL - The URL providing the XML streams.
Returns:
The deserialized JAXB bean.
Throws:
javax.xml.bind.JAXBException - The operation failed.
java.io.IOException

read

public CLSS read(javax.xml.stream.XMLEventReader pReader)
          throws javax.xml.bind.JAXBException
Reads and deserializes a JAXB bean from the XML stream provided by the given XMLEventReader.

Parameters:
pReader - The StAX event reader poviding the XML stream.
Returns:
The deserialized JAXB bean.
Throws:
javax.xml.bind.JAXBException - The operation failed.

read

public CLSS read(javax.xml.stream.XMLStreamReader pReader)
          throws javax.xml.bind.JAXBException
Reads and deserializes a JAXB bean from the XML stream provided by the given XMLStreamReader.

Parameters:
pReader - The StAX stream reader providing the XML stream.
Returns:
The deserialized JAXB bean.
Throws:
javax.xml.bind.JAXBException - The operation failed.

read

public CLSS read(java.lang.Object pObject)
          throws javax.xml.bind.JAXBException,
                 java.io.IOException
Throws:
javax.xml.bind.JAXBException
java.io.IOException


Copyright © 2009-2011. All Rights Reserved.