Javadoc fix.
This commit is contained in:
@@ -47,16 +47,16 @@ import net.sf.json.JSONObject;
|
|||||||
* Config cfg = new Config();
|
* Config cfg = new Config();
|
||||||
* System.out.println(cfg.convert(new Pojo()));
|
* System.out.println(cfg.convert(new Pojo()));
|
||||||
* </pre>
|
* </pre>
|
||||||
* Converting a type universally: <pre>
|
* Converting a type universally: <pre>{@code
|
||||||
Converter<Color> colorConv = new Converter<Color>() {
|
Converter<Color> colorConv = new Converter<Color>() {
|
||||||
public Object convert (Color c, Config cfg) {
|
public Object convert (Color c, Config cfg) {
|
||||||
return new Integer((c.getRed() << 16) | (c.getGreen()<<8) | c.getBlue());
|
return new Integer((c.getRed() << 16) | (c.getGreen() << 8) | c.getBlue());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
cfg.addClassConverter(Color.class, colorConv);
|
cfg.addClassConverter(Color.class, colorConv);
|
||||||
* </pre>
|
* }</pre>
|
||||||
* Customizing a specific field of a class:<pre>
|
* Customizing a specific field of a class:<pre>{@code
|
||||||
FieldAccessor<SomeImpl, Collection<?>> entryConv =
|
FieldAccessor<SomeImpl, Collection<?>> entryConv =
|
||||||
new FieldAccessor<SomeImpl, Collection<?>>() {
|
new FieldAccessor<SomeImpl, Collection<?>>() {
|
||||||
public Collection<SomeValue> get (SomeImpl impl) {
|
public Collection<SomeValue> get (SomeImpl impl) {
|
||||||
@@ -66,7 +66,7 @@ import net.sf.json.JSONObject;
|
|||||||
cfg.addFieldConfig(SomeImpl.class, new FieldConfig<SomeImpl>().
|
cfg.addFieldConfig(SomeImpl.class, new FieldConfig<SomeImpl>().
|
||||||
addExclusions("privateStuff").
|
addExclusions("privateStuff").
|
||||||
addFieldConverter("valueMap", new ConvertCollectionFieldToArray<SomeImpl>(entryConv)));
|
addFieldConverter("valueMap", new ConvertCollectionFieldToArray<SomeImpl>(entryConv)));
|
||||||
* </pre>
|
* }</pre>
|
||||||
*/
|
*/
|
||||||
public class JSONConversion
|
public class JSONConversion
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user