Package com.cedarsoftware.util.io
Class JsonValue
java.lang.Object
com.cedarsoftware.util.io.JsonValue
- Direct Known Subclasses:
JsonObject
This class is the parent class for all parsed JSON objects, arrays, or primitive values.
- Author:
- John DeRegnaucourt ([email protected])
Copyright (c) Cedar Software LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
License
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.*
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected Class<?>protected longstatic final Stringprotected booleanstatic final Stringprotected Class<?>static final Stringprotected intstatic final Stringprotected Longstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetId()Class<?>booleanhasId()A JsonObject starts off with an id of -1.abstract booleanisArray()booleanbooleanvoidsetFinishedTarget(Object o, boolean isFinished) voidsetHintType(Class<?> type) voidsetId(long id) voidsetJavaType(Class<?> type) voidsetReferenceId(Long id) void
-
Field Details
-
KEYS
- See Also:
-
ITEMS
- See Also:
-
ID
- See Also:
-
REF
- See Also:
-
TYPE
- See Also:
-
SHORT_TYPE
- See Also:
-
SHORT_ITEMS
- See Also:
-
SHORT_KEYS
- See Also:
-
SHORT_ID
- See Also:
-
SHORT_REF
- See Also:
-
VALUE
- See Also:
-
javaType
-
hintType
-
isFinished
protected boolean isFinished -
id
protected long id -
refId
-
line
protected int line -
col
protected int col
-
-
Constructor Details
-
JsonValue
public JsonValue()
-
-
Method Details
-
isReference
public boolean isReference() -
getReferenceId
-
setReferenceId
-
isFinished
public boolean isFinished() -
setFinished
public void setFinished() -
setTarget
-
setFinishedTarget
-
getTarget
-
isArray
public abstract boolean isArray() -
getJavaType
-
setJavaType
-
setHintType
-
getJavaTypeName
-
getId
public long getId() -
setId
public void setId(long id) -
hasId
public boolean hasId()A JsonObject starts off with an id of -1. Also, an id of 0 is not considered a valid id. It must be 1 or greater. JsonWriter utilizes this fact.
-