org.qtunes.auth.control
Class JSONParser

java.lang.Object
  extended by org.qtunes.auth.control.JSONParser
All Implemented Interfaces:
ParamParser

public class JSONParser
extends java.lang.Object
implements ParamParser

A ParamParser that parses it's input as JSON. {object:db, calls:[{method:"getPlaylist", args:{name:"MyList"}}, {method:"addTrack", args:{track: 24}}]}


Field Summary
protected  Auth auth
           
protected  java.util.List<Call> calls
           
protected  ServiceContext context
           
protected  JSONSerializer json
           
protected  java.lang.String object
           
protected  Session session
           
 
Constructor Summary
JSONParser(ServiceContext context)
           
 
Method Summary
 java.util.List<Call> getMethodCalls()
          Get the name of the ControlMethod we want to invoke
 java.lang.String getObjectName()
          Get the name of the Object we want to invoke the method on
 Session getSession()
          Get the Session that was specified in the Parameters
 void parse(java.lang.String in)
           
 java.lang.String toString(java.lang.Object o)
          Convert the specified Object to a String in a form that would be usable by this ParamParser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected final ServiceContext context

auth

protected final Auth auth

json

protected final JSONSerializer json

calls

protected java.util.List<Call> calls

session

protected Session session

object

protected java.lang.String object
Constructor Detail

JSONParser

public JSONParser(ServiceContext context)
Method Detail

parse

public void parse(java.lang.String in)
           throws java.lang.Exception
Specified by:
parse in interface ParamParser
Throws:
java.lang.Exception

getObjectName

public java.lang.String getObjectName()
Description copied from interface: ParamParser
Get the name of the Object we want to invoke the method on

Specified by:
getObjectName in interface ParamParser

getMethodCalls

public java.util.List<Call> getMethodCalls()
Description copied from interface: ParamParser
Get the name of the ControlMethod we want to invoke

Specified by:
getMethodCalls in interface ParamParser

getSession

public Session getSession()
Description copied from interface: ParamParser
Get the Session that was specified in the Parameters

Specified by:
getSession in interface ParamParser

toString

public java.lang.String toString(java.lang.Object o)
Description copied from interface: ParamParser
Convert the specified Object to a String in a form that would be usable by this ParamParser

Specified by:
toString in interface ParamParser