public class JsonBeanTranslator extends Object implements BeanTranslator
| Constructor and Description |
|---|
JsonBeanTranslator()
Creates a new JSON translator
By default the output will not be formated |
JsonBeanTranslator(boolean formattedOutput)
Creates a new JSON translator
|
| Modifier and Type | Method and Description |
|---|---|
void |
close(Writer output) |
void |
closeArray(Writer output,
Object[] array,
String name,
Object parent) |
void |
closeCollection(Writer output,
Collection<?> collection,
String name,
Object parent) |
void |
closeObject(Writer output,
Object bean,
String name,
int subObjectsCount) |
void |
closeSubObjects(Writer output,
Object bean,
String name) |
void |
open(Writer output) |
void |
openArray(Writer output,
Object[] array,
String name,
Object parent) |
void |
openCollection(Writer output,
Collection<?> collection,
String name,
Object parent) |
void |
openObject(Writer output,
Object bean,
String name) |
void |
openSubObjects(Writer output,
Object bean,
String name) |
void |
writeComment(Writer output,
String comment)
Write a comment
|
void |
writeNullValue(Writer output,
String name,
Object parent)
Write a null value
|
void |
writeSubElementValue(Writer output,
Object value,
String name,
Object parent)
Write a basic value as a "sub-element"
|
void |
writeValue(Writer output,
Object obj,
String name,
Object parent)
Write a basic value
|
public JsonBeanTranslator()
public JsonBeanTranslator(boolean formattedOutput)
formattedOutput - indicates if the output must be formated or notpublic void open(Writer output)
open in interface BeanTranslatorpublic void close(Writer output)
close in interface BeanTranslatorpublic void openSubObjects(Writer output, Object bean, String name)
openSubObjects in interface BeanTranslatorpublic void closeSubObjects(Writer output, Object bean, String name)
closeSubObjects in interface BeanTranslatorpublic void openObject(Writer output, Object bean, String name)
openObject in interface BeanTranslatorpublic void closeObject(Writer output, Object bean, String name, int subObjectsCount)
closeObject in interface BeanTranslatorpublic void writeComment(Writer output, String comment)
BeanTranslatorwriteComment in interface BeanTranslatorpublic void writeNullValue(Writer output, String name, Object parent)
BeanTranslatorwriteNullValue in interface BeanTranslatorname - the name of the valueparent - the parent objectpublic void writeValue(Writer output, Object obj, String name, Object parent)
BeanTranslatorwriteValue in interface BeanTranslatorobj - the value to write ( String, Number, Boolean, etc )name - the name of the valueparent - the parent objectpublic void writeSubElementValue(Writer output, Object value, String name, Object parent)
BeanTranslatorwriteSubElementValue in interface BeanTranslatorvalue - the value to write ( String, Number, Boolean, etc )name - the name of the valueparent - the parent objectpublic void openArray(Writer output, Object[] array, String name, Object parent)
openArray in interface BeanTranslatorpublic void closeArray(Writer output, Object[] array, String name, Object parent)
closeArray in interface BeanTranslatorpublic void openCollection(Writer output, Collection<?> collection, String name, Object parent)
openCollection in interface BeanTranslatorpublic void closeCollection(Writer output, Collection<?> collection, String name, Object parent)
closeCollection in interface BeanTranslatorCopyright © 2016. All rights reserved.