public class JsonWrapper extends DelegatingParser implements JsonNode
Constructor and Description |
---|
JsonWrapper()
Constructs a new JsonWrapper.
|
Modifier and Type | Method and Description |
---|---|
int |
getJsonArrayIndex()
Returns the index of this node in its parent array, or -1 if not applicable
(i.e.
|
String |
getJsonName()
Returns the JSON field name.
|
char |
getJsonType()
Returns the type of node.
|
boolean |
isJsonArray()
Returns whether this node is a JSON array.
|
boolean |
isNillable()
Returns whether this node may be explicitly set to null.
|
boolean |
isOptional()
Returns whether this node must exist during unmarshalling.
|
boolean |
marshal(MarshallingContext context)
Marshals a record.
|
boolean |
matches(UnmarshallingContext context)
Returns whether this parser and its children match a record
being unmarshalled.
|
void |
setJsonArray(boolean jsonArray) |
void |
setJsonArrayIndex(int jsonArrayIndex) |
void |
setJsonName(String jsonName) |
void |
setJsonType(char jsonType) |
void |
setNillable(boolean nillable) |
void |
setOptional(boolean optional) |
protected void |
toParamString(StringBuilder s)
Called by
TreeNode.toString() to append node parameters to the output. |
boolean |
unmarshal(UnmarshallingContext context)
Unmarshals a record.
|
clearValue, getParser, getSize, getValue, hasContent, isIdentifier, setValue
isSupportedChild
registerLocals
add, clone, find, getChildren, getFirst, getName, isDescendant, iterator, print, print, setName, size, sort, toString, updateReferences
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public boolean matches(UnmarshallingContext context)
Parser
matches
in interface Parser
matches
in class DelegatingParser
context
- the UnmarshallingContext
public boolean unmarshal(UnmarshallingContext context)
Parser
unmarshal
in interface Parser
unmarshal
in class DelegatingParser
context
- the UnmarshallingContext
public boolean marshal(MarshallingContext context) throws IOException
Parser
marshal
in interface Parser
marshal
in class DelegatingParser
context
- the MarshallingContext
IOException
- if an I/O error occurspublic String getJsonName()
JsonNode
getJsonName
in interface JsonNode
public void setJsonName(String jsonName)
public char getJsonType()
JsonNode
JsonNode.isJsonArray()
is true, this method
returns the component type of the array.getJsonType
in interface JsonNode
public void setJsonType(char jsonType)
public boolean isJsonArray()
JsonNode
isJsonArray
in interface JsonNode
public void setJsonArray(boolean jsonArray)
public int getJsonArrayIndex()
JsonNode
getJsonArrayIndex
in interface JsonNode
public void setJsonArrayIndex(int jsonArrayIndex)
public boolean isNillable()
JsonNode
isNillable
in interface JsonNode
public void setNillable(boolean nillable)
public boolean isOptional()
Parser
isOptional
in interface Parser
isOptional
in class DelegatingParser
public void setOptional(boolean optional)
protected void toParamString(StringBuilder s)
TreeNode
TreeNode.toString()
to append node parameters to the output.toParamString
in class TreeNode<Component>
s
- the output to append