public class MarshallerImpl extends Object implements Marshaller
Marshaller implementation.| Constructor and Description |
|---|
MarshallerImpl(MarshallingContext context,
Selector layout,
RecordMarshaller recordMarshaller)
Constructs a new UnmarshallerImpl
|
| Modifier and Type | Method and Description |
|---|---|
void |
debug()
Prints the internal view of the stream configuration
to
System.out |
void |
debug(PrintStream out)
Prints the internal view of the stream configuration.
|
protected Object |
getRecordValue()
Returns the record value for the most recent marshalled bean object.
|
Marshaller |
marshal(Object bean)
Marshals a single bean object.
|
Marshaller |
marshal(String recordName,
Object bean)
Marshals a single bean object.
|
String[] |
toArray()
Returns the most recent marshalled bean object as a String[] for csv
and delimited formatted streams.
|
Document |
toDocument()
Returns the most recent marshalled bean object as a
Document for xml
formatted streams. |
List<String> |
toList()
Returns the most recent marshalled bean object as a
List for csv
and delimited formatted streams. |
String |
toString()
Returns the most recent marshalled bean object as a String.
|
public MarshallerImpl(MarshallingContext context, Selector layout, RecordMarshaller recordMarshaller)
context - the UnmarshallingContextlayout - the stream layoutrecordMarshaller - the RecordMarshaller for converting record text to record valuespublic Marshaller marshal(Object bean) throws BeanWriterException
Marshallermarshal in interface Marshallerbean - the bean object to marshalBeanWriterException - if a record is not matched for the given bean object,
or in some other rare (but fatal) conditionspublic Marshaller marshal(String recordName, Object bean) throws BeanWriterException
Marshallermarshal in interface MarshallerrecordName - the name of the record to marshalbean - the bean object to marshalBeanWriterException - if a record is not matched for the given record name
and bean object, or in some other rare (but fatal) conditionspublic String toString()
MarshallertoString in interface MarshallertoString in class Objectpublic String[] toArray() throws BeanWriterException
MarshallertoArray in interface MarshallerBeanWriterException - if an array is not supported by the stream formatpublic List<String> toList() throws BeanWriterException
MarshallerList for csv
and delimited formatted streams.toList in interface MarshallerList of fieldsBeanWriterException - if an array is not supported by the stream formatpublic Document toDocument() throws BeanWriterException
MarshallerDocument for xml
formatted streams.toDocument in interface MarshallerDocumentBeanWriterException - if Document is not supported by the stream formatprotected Object getRecordValue()
public void debug()
DebuggableSystem.outdebug in interface Debuggablepublic void debug(PrintStream out)
Debuggabledebug in interface Debuggableout - the PrintStream to write to