public interface DhxMarshallerService
Modifier and Type | Method and Description |
---|---|
javax.xml.bind.Marshaller |
getMarshaller()
Method returns marshaller.
|
javax.xml.bind.Unmarshaller |
getUnmarshaller()
Method returns unmarshaller.
|
java.io.File |
marshall(java.lang.Object container)
Marshalls object to file.
|
void |
marshall(java.lang.Object container,
java.io.File file)
Marshalls object to given file.
|
void |
marshallToOutputStream(java.lang.Object container,
java.io.OutputStream stream)
Marshalls object to outputStream.
|
void |
marshallToOutputStreamNoNamespacePrefixes(java.lang.Object container,
java.io.OutputStream stream,
java.lang.Boolean includeXmlns)
Marshalls object to outputStream, removes all namespace prefixes from XML.
|
void |
marshallToResult(java.lang.Object obj,
javax.xml.transform.Result result)
Marshalls object to result.
|
java.io.StringWriter |
marshallToWriter(java.lang.Object container)
Marshalls object to writer.
|
java.io.StringWriter |
marshallToWriterAndValidate(java.lang.Object container,
java.io.InputStream schemaStream)
Marshalls object to writer and validates.
|
<T> T |
unmarshall(java.io.File capsuleFile)
Parses(unmarshalls) object from file.
|
<T> T |
unmarshall(java.io.InputStream capsuleStream)
Parses(unmarshalls) object from file.
|
<T> T |
unmarshall(org.w3c.dom.Node node)
Parses(unmarshalls) object from Node.
|
<T> T |
unmarshall(javax.xml.transform.Source source)
Method parses(unmarshalls) object.
|
<T> T |
unmarshallAndValidate(java.io.File capsuleFile,
java.io.InputStream schemaStream)
Parses(unmarshalls) object from file.
|
<T> T |
unmarshallAndValidate(java.io.InputStream capsuleStream,
java.io.InputStream schemaStream)
Parses(unmarshalls) object from file.
|
void |
validate(java.io.File file,
java.io.InputStream schemaStream)
Method validates file against XSD schema.
|
void |
validate(java.io.InputStream fileStream,
java.io.InputStream schemaStream)
Function validates file against XSD schema.
|
<T> T unmarshall(javax.xml.transform.Source source) throws ee.ria.dhx.exception.DhxException
T
- - type of the capsule being unmarshalledsource
- - source of the marshalled objectee.ria.dhx.exception.DhxException
- - thrown if error occurs while unmrashalling object<T> T unmarshall(java.io.File capsuleFile) throws ee.ria.dhx.exception.DhxException
T
- - type of the capsule being unmarshalledcapsuleFile
- - file to parseee.ria.dhx.exception.DhxException
- - thrown if error occurs while parsing file<T> T unmarshall(java.io.InputStream capsuleStream) throws ee.ria.dhx.exception.DhxException
T
- - type of the capsule being unmarshalledcapsuleStream
- - stream to parseee.ria.dhx.exception.DhxException
- - thrown if error occurs while parsing file<T> T unmarshall(org.w3c.dom.Node node) throws ee.ria.dhx.exception.DhxException
T
- - type of the capsule being unmarshallednode
- - node to unmarshallee.ria.dhx.exception.DhxException
- - thrown if error occurs while parsing file<T> T unmarshallAndValidate(java.io.InputStream capsuleStream, java.io.InputStream schemaStream) throws ee.ria.dhx.exception.DhxException
T
- - type of the capsule being unmarshalledcapsuleStream
- - stream of to parseschemaStream
- - stream on XSD schema against which to validate. No validation is done if
stream is NULLee.ria.dhx.exception.DhxException
- - thrown if error occurs while parsing file@Loggable <T> T unmarshallAndValidate(java.io.File capsuleFile, java.io.InputStream schemaStream) throws ee.ria.dhx.exception.DhxException
T
- - type of the capsule being unmarshalledcapsuleFile
- - file to parseschemaStream
- - stream on XSD schema against which to validate. No validation is done if
stream is NULLee.ria.dhx.exception.DhxException
- - thrown if error occurs while parsing filejava.io.File marshall(java.lang.Object container) throws ee.ria.dhx.exception.DhxException
container
- - object to marshallee.ria.dhx.exception.DhxException
- - thrown if error occurs while marshalling object@Loggable void marshall(java.lang.Object container, java.io.File file) throws ee.ria.dhx.exception.DhxException
container
- object to marshallfile
- file to marshall toee.ria.dhx.exception.DhxException
- thrown if error occurs while marshalling objectvoid marshallToOutputStream(java.lang.Object container, java.io.OutputStream stream) throws ee.ria.dhx.exception.DhxException
container
- - object to marshallstream
- - containing marshalled objectee.ria.dhx.exception.DhxException
- - thrown if error occurs while marshalling objectvoid marshallToOutputStreamNoNamespacePrefixes(java.lang.Object container, java.io.OutputStream stream, java.lang.Boolean includeXmlns) throws ee.ria.dhx.exception.DhxException
container
- - object to marshallstream
- - containing marshalled objectincludeXmlns
- if true, then xmlns will be addedee.ria.dhx.exception.DhxException
- - thrown if error occurs while marshalling objectvoid marshallToResult(java.lang.Object obj, javax.xml.transform.Result result) throws ee.ria.dhx.exception.DhxException
obj
- - object to marshallresult
- - result into which object will be marshalledee.ria.dhx.exception.DhxException
- - thrown if error occurs while marshalling objectjava.io.StringWriter marshallToWriter(java.lang.Object container) throws ee.ria.dhx.exception.DhxException
container
- - object to marshallee.ria.dhx.exception.DhxException
- - thrown if error occurs while marshalling objectjava.io.StringWriter marshallToWriterAndValidate(java.lang.Object container, java.io.InputStream schemaStream) throws ee.ria.dhx.exception.DhxException
container
- - object to marshallschemaStream
- - stream of the XSD schema to validate againstee.ria.dhx.exception.DhxException
- - thrown if error occurs while marshalling objectvoid validate(java.io.File file, java.io.InputStream schemaStream) throws ee.ria.dhx.exception.DhxException
file
- - file to validateschemaStream
- - stream caontaining XSD schemaee.ria.dhx.exception.DhxException
- - thrown if error occursvoid validate(java.io.InputStream fileStream, java.io.InputStream schemaStream) throws ee.ria.dhx.exception.DhxException
fileStream
- - stream to validateschemaStream
- - stream containing schema against which to validateee.ria.dhx.exception.DhxException
- - thrown if file is not validated against XSD schema.javax.xml.bind.Marshaller getMarshaller() throws ee.ria.dhx.exception.DhxException
ee.ria.dhx.exception.DhxException
- - thrown if error occuredjavax.xml.bind.Unmarshaller getUnmarshaller() throws ee.ria.dhx.exception.DhxException
ee.ria.dhx.exception.DhxException
- - thrown if error occured