com.stanfy.gsonxml
Class GsonXml

java.lang.Object
  extended by com.stanfy.gsonxml.GsonXml

public final class GsonXml
extends java.lang.Object

Wrapper for Gson.


Method Summary
<T> T
fromXml(java.io.Reader json, java.lang.Class<T> classOfT)
           
<T> T
fromXml(java.io.Reader json, java.lang.reflect.Type typeOfT)
           
<T> T
fromXml(java.lang.String json, java.lang.Class<T> classOfT)
           
<T> T
fromXml(java.lang.String json, java.lang.reflect.Type typeOfT)
           
<T> T
fromXml(XmlReader reader, java.lang.reflect.Type typeOfT)
          Reads the next JSON value from reader and convert it to an object of type typeOfT.
 com.google.gson.Gson getGson()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getGson

public com.google.gson.Gson getGson()

fromXml

public <T> T fromXml(java.lang.String json,
                     java.lang.Class<T> classOfT)
          throws com.google.gson.JsonSyntaxException
Throws:
com.google.gson.JsonSyntaxException

fromXml

public <T> T fromXml(java.lang.String json,
                     java.lang.reflect.Type typeOfT)
          throws com.google.gson.JsonSyntaxException
Throws:
com.google.gson.JsonSyntaxException

fromXml

public <T> T fromXml(java.io.Reader json,
                     java.lang.Class<T> classOfT)
          throws com.google.gson.JsonSyntaxException,
                 com.google.gson.JsonIOException
Throws:
com.google.gson.JsonSyntaxException
com.google.gson.JsonIOException

fromXml

public <T> T fromXml(java.io.Reader json,
                     java.lang.reflect.Type typeOfT)
          throws com.google.gson.JsonIOException,
                 com.google.gson.JsonSyntaxException
Throws:
com.google.gson.JsonIOException
com.google.gson.JsonSyntaxException

fromXml

public <T> T fromXml(XmlReader reader,
                     java.lang.reflect.Type typeOfT)
          throws com.google.gson.JsonIOException,
                 com.google.gson.JsonSyntaxException
Reads the next JSON value from reader and convert it to an object of type typeOfT. Since Type is not parameterized by T, this method is type unsafe and should be used carefully

Throws:
com.google.gson.JsonIOException - if there was a problem writing to the Reader
com.google.gson.JsonSyntaxException - if json is not a valid representation for an object of type

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object