public class BeanWriter extends Object
| Constructor and Description |
|---|
BeanWriter(Writer outputWriter,
BeanTranslator beanWriter)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Invokes the close method of the writer ( ie : with an XML writer it closes the root tag )
then flushes and closes the output flow.
|
void |
open()
Invokes the open method of the writer ( ie : with an XML writer it opens the root tag )
|
void |
writeComment(String comment)
Converts the given string into a comment and writes it
( the string is writen between XML comments ) |
void |
writeObject(Object bean)
Writes the given object in the output flow ( in XML, JSON, etc... ) without name
|
void |
writeObject(Object bean,
String name)
Writes the given object in the output flow ( in XML, JSON, etc... )
|
public BeanWriter(Writer outputWriter, BeanTranslator beanWriter)
outputWriter - the output writerbeanWriter - the bean writer implementation to use ( XML, JSON, etc... )public void open()
public void close()
public void writeObject(Object bean)
bean - the bean to writepublic void writeObject(Object bean, String name)
bean - the bean to writename - the name of the bean ( used as tag name in XML, or object name in JSON )public void writeComment(String comment)
comment - Copyright © 2016. All rights reserved.