|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.inria.ns.reflex.xml.json.Handler
public class Handler
XML handler for XML-aware JSON objects.
Factory
Constructor Summary | |
---|---|
Handler()
|
Method Summary | |
---|---|
void |
addJSONComment(JSONContext context)
Add a JSON comment to the current structure ; effects may vary according to the configuration in use. |
boolean |
addJSONMember(JSONContext context,
QName name)
Add a JSON member (that is to say a name/value pair) to the current structure ; effects may vary according to the configuration in use. |
boolean |
addJSONValue(JSONContext context)
Add a JSON value to the current structure ; effects may vary according to the configuration in use. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Handler()
Method Detail |
---|
public void addJSONComment(JSONContext context)
This method is called by the parser when it has read a JSON comment (which is hold by this context).
addJSONComment
in interface JSONHandler
context
- The context that hold the parser state and structure.JSONFactory#newJSONComment(JSONParser, String)
,
JSONConfiguration
public boolean addJSONMember(JSONContext context, QName name)
This method is called by the parser when it has read a JSON member (which is hold by this context).
addJSONMember
in interface JSONHandler
context
- The context that hold the parser state and structure.name
- The name of the member, usually it is a simple wrapped string,
but custom XML names can be considered.
true
to indicate to the parser that
the member was effectively added to the target structure,
false
otherwise. This allow to skip unwanted
structures safely.JSONFactory#newJSONMember(JSONParser, QName, Object)
,
JSONConfiguration
public boolean addJSONValue(JSONContext context)
This method is called by the parser when it has read a JSON value (which is hold by this context).
addJSONValue
in interface JSONHandler
context
- The context that hold the parser state and structure.
false
if the configuration indicates to attach
objects to parents and the value is a JSON object and is not the
root structure, true
otherwise.JSONFactory
,
JSONConfiguration
,
Configuration.isAttachObjectsToParent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |