Implementation of the
Marshaller
interface for Castor. By default, Castor does not require any further configuration, though setting target classes, target packages or providing a mapping file can be used to have more control over the behavior of Castor.
If a target class is specified using setTargetClass
, the CastorMarshaller
can only be used to unmarshal XML that represents that specific class. If you want to unmarshal multiple classes, you have to provide a mapping file using setMappingLocations
.
Due to limitations of Castor's API, it is required to set the encoding used for writing to output streams. It defaults to UTF-8
.
@author Arjen Poutsma
@author Jakub Narloch
@see #setEncoding(String)
@see #setTargetClass(Class)
@see #setTargetPackages(String[])
@see #setMappingLocation(Resource)
@see #setMappingLocations(Resource[])
@since 3.0