Package net.loomchild.segment.util
Class Bind
- java.lang.Object
-
- net.loomchild.segment.util.Bind
-
public class Bind extends java.lang.ObjectHelper 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.Marshallermarshallerprivate javax.xml.bind.Unmarshallerunmarshaller
-
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 voidmarshal(java.io.Writer writer, java.lang.Object object)Writes given object to given writer validating it.voidmarshal(java.lang.String fileName, java.lang.Object object)Writes given object to a file with given name validating it.java.lang.Objectunmarshal(java.io.Reader reader)Retrieves object from given reader validation the input.java.lang.Objectunmarshal(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
-
-