|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.hpi.fgis.dude.util.data.json.JsonNull
public class JsonNull
JsonNull
represents the Json null
value. Parts of the code are reused and
were taken from the JSON.org implementation.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface de.hpi.fgis.dude.util.data.json.JsonValue |
---|
JsonValue.JsonType |
Field Summary | |
---|---|
static JsonNull |
NULL
The Json null value. |
Method Summary | |
---|---|
protected Object |
clone()
There is only intended to be a single instance of the NULL object, so the clone method returns itself. |
int |
compareTo(JsonValue other)
Compares the current instance with the passed JsonValue . |
boolean |
equals(Object object)
A JsonRecord.JsonNull object is equal to the null value and to itself. |
void |
fromJson(DuDeJsonParser<?> jsonParser)
Initializes the current instance using the passed DuDeJsonParser . |
String |
getStringValue()
Returns the actual value converted into a String. |
JsonValue.JsonType |
getType()
Returns JsonType.Null . |
int |
hashCode()
|
int |
size()
Returns 0 since JsonRecord.JsonNull does not have any value. |
void |
toJson(DuDeJsonGenerator jsonGenerator)
Generates the Json code using the passed DuDeJsonGenerator . |
String |
toString()
Returns the "null" String value. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final JsonNull NULL
null
value.
Method Detail |
---|
protected final Object clone()
clone
in class Object
public boolean equals(Object object)
JsonRecord.JsonNull
object is equal to the null value and to itself.
equals
in class Object
object
- An object to test for being null
.
true
if the object parameter is the JsonRecord.JsonNull
object or
null
; otherwise false
.public String toString()
toString
in class Object
public JsonValue.JsonType getType()
JsonType.Null
.
getType
in interface JsonValue
JsonValue.getType()
public int size()
0
since JsonRecord.JsonNull
does not have any value.
size
in interface JsonValue
JsonValue.size()
public int compareTo(JsonValue other)
JsonValue
JsonValue
. Instances of different JsonValue.JsonType
s are ordered lexicographically except
for JsonValue.JsonType.Null
. The above mentioned requirements define the following order: null
== JsonValue.JsonType.Null
<
JsonValue.JsonType.Array
< JsonValue.JsonType.Boolean
< JsonValue.JsonType.Number
< JsonValue.JsonType.Record
< JsonValue.JsonType.String
.
compareTo
in interface JsonValue
compareTo
in interface Comparable<JsonValue>
Comparable.compareTo(Object)
public int hashCode()
hashCode
in class Object
public void toJson(DuDeJsonGenerator jsonGenerator) throws org.codehaus.jackson.JsonGenerationException, IOException
Jsonable
DuDeJsonGenerator
.
toJson
in interface Jsonable
jsonGenerator
- The DuDeJsonGenerator
that is used internally.
org.codehaus.jackson.JsonGenerationException
- If an error occurs while generating the Json syntax.
IOException
- If an error occurs while writing to the output.public void fromJson(DuDeJsonParser<?> jsonParser) throws org.codehaus.jackson.JsonParseException, IOException
Jsonable
DuDeJsonParser
.
fromJson
in interface Jsonable
jsonParser
- The parser that is used for extracting the data out of the Json.
org.codehaus.jackson.JsonParseException
- If an error occurs while parsing the Json.
IOException
- If an error occurs while reading from the stream.public String getStringValue()
JsonAtomic
#toString()
.
getStringValue
in interface JsonAtomic
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |