Package net.loomchild.segment.util
Class Bind
- java.lang.Object
-
- net.loomchild.segment.util.Bind
-
public class Bind extends java.lang.Object
Helper class for JAXB binding. Responsible for marshalling and unmarshalling using given schema and context.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.xml.bind.Marshaller
marshaller
private javax.xml.bind.Unmarshaller
unmarshaller
-
Constructor Summary
Constructors Constructor Description Bind(javax.xml.bind.JAXBContext context, javax.xml.validation.Schema schema)
Creates Bind.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
marshal(java.io.Writer writer, java.lang.Object object)
Writes given object to given writer validating it.void
marshal(java.lang.String fileName, java.lang.Object object)
Writes given object to a file with given name validating it.java.lang.Object
unmarshal(java.io.Reader reader)
Retrieves object from given reader validation the input.java.lang.Object
unmarshal(java.lang.String fileName)
Retrieves object from a file with given name validating the input.
-
-
-
Method Detail
-
marshal
public void marshal(java.io.Writer writer, java.lang.Object object)
Writes given object to given writer validating it.- Parameters:
writer
-object
-
-
marshal
public void marshal(java.lang.String fileName, java.lang.Object object)
Writes given object to a file with given name validating it.- Parameters:
fileName
-object
-
-
unmarshal
public java.lang.Object unmarshal(java.io.Reader reader)
Retrieves object from given reader validation the input.- Parameters:
reader
-- Returns:
- object
-
unmarshal
public java.lang.Object unmarshal(java.lang.String fileName)
Retrieves object from a file with given name validating the input.- Parameters:
fileName
-- Returns:
- object
-
-