protected static class DefaultJsonGenerator.ClosureConverter extends java.lang.Object implements JsonGenerator.Converter
Modifier and Type | Field and Description |
---|---|
protected Closure<?> |
closure |
protected int |
paramCount |
protected java.lang.Class<?> |
type |
Modifier | Constructor and Description |
---|---|
protected |
ClosureConverter(java.lang.Class<?> type,
Closure<?> closure) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
convert(java.lang.Object value,
java.lang.String key)
Converts a given value.
|
boolean |
equals(java.lang.Object o)
Any two Converter instances registered for the same type are considered
to be equal.
|
boolean |
handles(java.lang.Class<?> type)
Returns
true if this converter can handle conversions
of the given type. |
int |
hashCode() |
java.lang.String |
toString() |
protected final java.lang.Class<?> type
protected final Closure<?> closure
protected final int paramCount
protected ClosureConverter(java.lang.Class<?> type, Closure<?> closure)
public boolean handles(java.lang.Class<?> type)
true
if this converter can handle conversions
of the given type.handles
in interface JsonGenerator.Converter
type
- the type of the object to convertpublic java.lang.Object convert(java.lang.Object value, java.lang.String key)
convert
in interface JsonGenerator.Converter
value
- the object to convertkey
- the key name for the value, may be null
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object with which to compare.true
if this object contains the same class; false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object