|
BeanIO 2.0.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.beanio.internal.util.TreeNode<Component> org.beanio.internal.parser.Component org.beanio.internal.parser.ParserComponent org.beanio.internal.parser.DelegatingParser org.beanio.internal.parser.format.json.JsonWrapper
public class JsonWrapper
A JsonWrapper is used to handle nested JSON objects.
Field Summary |
---|
Fields inherited from interface org.beanio.internal.parser.format.json.JsonNode |
---|
ARRAY, BOOLEAN, NUMBER, OBJECT, STRING |
Constructor Summary | |
---|---|
JsonWrapper()
Constructs a new JsonWrapper. |
Method Summary | |
---|---|
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 |
isLazy()
Returns whether this node must exist during unmarshalling. |
boolean |
isNillable()
Returns whether this node may be explicitly set to null. |
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 |
setLazy(boolean lazy)
|
void |
setNillable(boolean nillable)
|
protected void |
toParamString(StringBuilder s)
Called by TreeNode.toString() to append node parameters to the output. |
boolean |
unmarshal(UnmarshallingContext context)
Unmarshals a record. |
Methods inherited from class org.beanio.internal.parser.DelegatingParser |
---|
clearValue, getParser, getSize, getValue, hasContent, isIdentifier, setValue |
Methods inherited from class org.beanio.internal.parser.ParserComponent |
---|
isSupportedChild |
Methods inherited from class org.beanio.internal.parser.Component |
---|
registerLocals |
Methods inherited from class org.beanio.internal.util.TreeNode |
---|
add, clone, find, getChildren, getFirst, getName, iterator, print, setName, size, sort, toString, updateReferences |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.beanio.internal.parser.format.json.JsonNode |
---|
getName |
Methods inherited from interface org.beanio.internal.parser.Parser |
---|
getName |
Constructor Detail |
---|
public JsonWrapper()
Method Detail |
---|
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 isLazy()
Parser
isLazy
in interface Parser
isLazy
in class DelegatingParser
public void setLazy(boolean lazy)
lazy
- 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
|
BeanIO 2.0.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |