fr.etai.xat2v2.util
Class Xat2Util

java.lang.Object
  extended by fr.etai.xat2v2.util.Xat2Util

public final class Xat2Util
extends Object


Method Summary
static void addAppId(Xat2 xat2, String appId)
          Adds an applicationId to the xat2
static void addVerb(Xat2 xat2, String verb)
          Adds a verb to the xat2
static Object createIfDoesntExist(Object base, String... path)
           
static String getApplicationId(Xat2 xat2)
          Gets the applicationId from the XAT2 objects hierarchy.
static Message[] getErrors(Xat2 xat2)
          Returns all the error messages contained in the xat2 message.
static
<T> T
getIfExists(Object base, Class<T> expectedType, String... path)
           
static Object getIfExists(Object base, String... path)
           
static String[] getVerbOptions(Xat2 xat2, String verb)
          Gets the options linked to a specific verb
static String[] getVerbs(Xat2 xat2)
          Extract the verbs from the xat2
static boolean hasErrorMessage(Xat2 xat2)
          Checks if the xat2 message contains a least one error message.
static void setFirstVerb(Xat2 xat2, String verb)
           
static String toString(Object obj)
          Creates a String representation of any XAT2 object, List or Array of Xat2 Objects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getApplicationId

public static String getApplicationId(Xat2 xat2)
Gets the applicationId from the XAT2 objects hierarchy.

Parameters:
xat2 -
Returns:
the appId, or null if any object in the hierarchy is null.

getErrors

public static Message[] getErrors(Xat2 xat2)
Returns all the error messages contained in the xat2 message.

Parameters:
xat2 -
Returns:

hasErrorMessage

public static boolean hasErrorMessage(Xat2 xat2)
Checks if the xat2 message contains a least one error message.

Parameters:
xat2 -
Returns:

getVerbs

public static String[] getVerbs(Xat2 xat2)
Extract the verbs from the xat2

Parameters:
xat2 -
Returns:

addVerb

public static void addVerb(Xat2 xat2,
                           String verb)
Adds a verb to the xat2

Parameters:
xat2 -
verb -

addAppId

public static void addAppId(Xat2 xat2,
                            String appId)
Adds an applicationId to the xat2

Parameters:
xat2 -
appId -

getVerbOptions

public static String[] getVerbOptions(Xat2 xat2,
                                      String verb)
Gets the options linked to a specific verb

Parameters:
xat2 -
verb -
Returns:

setFirstVerb

public static void setFirstVerb(Xat2 xat2,
                                String verb)

getIfExists

public static <T> T getIfExists(Object base,
                                Class<T> expectedType,
                                String... path)

getIfExists

public static Object getIfExists(Object base,
                                 String... path)

createIfDoesntExist

public static Object createIfDoesntExist(Object base,
                                         String... path)

toString

public static String toString(Object obj)
Creates a String representation of any XAT2 object, List or Array of Xat2 Objects

Parameters:
obj -
Returns:


Copyright © 2012. All Rights Reserved.