Javadoc fix.

This commit is contained in:
Michael Bayne
2025-07-04 10:02:34 -07:00
parent 210ccca53c
commit 7ee646af97
@@ -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&lt;Color&gt; colorConv = new Converter&lt;Color&gt;() { Converter&lt;Color&gt; colorConv = new Converter&lt;Color&gt;() {
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&lt;SomeImpl, Collection&lt;?&gt;&gt; entryConv = FieldAccessor&lt;SomeImpl, Collection&lt;?&gt;&gt; entryConv =
new FieldAccessor&lt;SomeImpl, Collection&lt;?&gt;&gt;() { new FieldAccessor&lt;SomeImpl, Collection&lt;?&gt;&gt;() {
public Collection&lt;SomeValue&gt; get (SomeImpl impl) { public Collection&lt;SomeValue&gt; get (SomeImpl impl) {
@@ -66,7 +66,7 @@ import net.sf.json.JSONObject;
cfg.addFieldConfig(SomeImpl.class, new FieldConfig&lt;SomeImpl&gt;(). cfg.addFieldConfig(SomeImpl.class, new FieldConfig&lt;SomeImpl&gt;().
addExclusions("privateStuff"). addExclusions("privateStuff").
addFieldConverter("valueMap", new ConvertCollectionFieldToArray&lt;SomeImpl&gt;(entryConv))); addFieldConverter("valueMap", new ConvertCollectionFieldToArray&lt;SomeImpl&gt;(entryConv)));
* </pre> * }</pre>
*/ */
public class JSONConversion public class JSONConversion
{ {