|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.plumtree.uiinfrastructure.utils.JavascriptParser com.plumtree.portalpages.rest.utils.JSONParser
public class JSONParser
Field Summary | |
---|---|
protected java.lang.String |
m_strObjectName
|
protected XPHashtable |
m_xpMembers
|
Fields inherited from class com.plumtree.uiinfrastructure.utils.JavascriptParser |
---|
CLOSE_BRACKET, CLOSE_CURLY_BRACKET, COLON, COMMA, ESCAPE, m_rootList, m_rootObj, OPEN_BRACKET, OPEN_CURLY_BRACKET, QUOTE, SINGLE_QUOTE |
Constructor Summary | |
---|---|
JSONParser()
Private constructor so it can only be accessed by the GetInstance method. |
Method Summary | |
---|---|
static IJSONParser |
GetInstance()
|
java.lang.String |
GetMember(java.lang.String _strName)
|
java.lang.Boolean |
GetMemberAsBool(java.lang.String name)
For boolean member values |
java.lang.Integer |
GetMemberAsInt(java.lang.String name)
For integer member values |
IXPList |
GetMemberAsList(java.lang.String name)
For array object members |
XPHashtable |
GetMemberAsMap(java.lang.String name)
For members with nested object values |
java.lang.String |
GetMemberAsString(java.lang.String name)
For string or |
java.lang.String |
GetObjectName()
|
protected java.lang.String |
ParseJSOMemberLabel(XPStringTokenizer tokz)
Gets the name of a javascript object member Expects the next token of the string tokenizer to be the double quote around the label. |
void |
ParseJSONObject(java.lang.String _strJSON)
Parses the supplied JSON object. |
Methods inherited from class com.plumtree.uiinfrastructure.utils.JavascriptParser |
---|
GetEscapedTokenAndEndQuote, GetNextToken, GetRootArray, GetRootObject, GetToken, IsJSComment, IsNewArray, IsNewJSObject, IsRootArray, IsRootObject, IsWhiteSpace, ParseJSArray, ParseJSObject, ParseJSOMemberValue, ParseJSSimpleValue, ParseJSString, SkipToken |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String m_strObjectName
protected XPHashtable m_xpMembers
Constructor Detail |
---|
public JSONParser()
Method Detail |
---|
public static IJSONParser GetInstance()
protected java.lang.String ParseJSOMemberLabel(XPStringTokenizer tokz)
ParseJSOMemberLabel
in class JavascriptParser
tokz
-
public void ParseJSONObject(java.lang.String _strJSON)
IJSONParser
ParseJSONObject
in interface IJSONParser
_strJSON
- the JSON string to be parsed.public java.lang.String GetObjectName()
GetObjectName
in interface IJSONParser
public java.lang.String GetMember(java.lang.String _strName)
GetMember
in interface IJSONParser
_strName
- The key for the JSON member to be returned.
public java.lang.String GetMemberAsString(java.lang.String name)
strName
-
public java.lang.Boolean GetMemberAsBool(java.lang.String name)
name
-
public java.lang.Integer GetMemberAsInt(java.lang.String name)
name
-
public IXPList GetMemberAsList(java.lang.String name)
name
-
public XPHashtable GetMemberAsMap(java.lang.String name)
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |