public class NameableConverter<T extends Nameable> extends java.lang.Object implements JsonConverter<T>
Nameable
items. Subclasses
may implement the setMore(JSONObject, Nameable)
method
to add more properties to the JSON object.Constructor and Description |
---|
NameableConverter() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
convert(T object)
Convert the given object to a JSON-compatible object.
|
protected void |
setMore(org.json.simple.JSONObject json,
T object)
Can be used by subclasses to set more properties on the
JSON object.
|
public java.lang.Object convert(T object)
JsonConverter
convert
in interface JsonConverter<T extends Nameable>
object
- The objcet to convertprotected void setMore(org.json.simple.JSONObject json, T object)
json
- The JSON object that store the converted propertiesobject
- The object that is being converted