org.ow2.jasmine.probe.collectors.jmx.internal
Class ComplexValuesUtil

java.lang.Object
  extended by org.ow2.jasmine.probe.collectors.jmx.internal.ComplexValuesUtil

public class ComplexValuesUtil
extends Object


Constructor Summary
ComplexValuesUtil()
           
 
Method Summary
static Object getArrayElement(Object value, String index)
          Return an array's element corresponding to a given index.
static Object getCompositeItem(Object value, String key)
          Get an item of a CompositeData value
static Object getElement(Object value, String index)
          Get an element of an indexed complexValue
static Object getItem(Object value, String key)
          Get an item of a complexValue
static Object getListElement(Object value, String index)
          Return a List element corresponding to a given index.
static Object getMapItem(Object value, String key)
          Get an item of a Map value
static Object getTabElement(Object value, String index)
          Return an element in a TabularData value corresponding to a given index.
static boolean hasSimpleType(Object value)
          This method allows to define the simple types allowed by JasmineProbe.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComplexValuesUtil

public ComplexValuesUtil()
Method Detail

getTabElement

public static Object getTabElement(Object value,
                                   String index)
                            throws ComplexValuesException
Return an element in a TabularData value corresponding to a given index.

Parameters:
value - the TabularData value
index - the given index
Returns:
the corresponding element if the index is valid
Throws:
ComplexValuesException - could not access to the TabularData or the value has multiple indexes.

getArrayElement

public static Object getArrayElement(Object value,
                                     String index)
                              throws ComplexValuesException,
                                     ClassCastException
Return an array's element corresponding to a given index.

Parameters:
value - the Array value
index - the given index
Returns:
the corresponding element if the index is valid
Throws:
ComplexValuesException - the index has not a number
ClassCastException

getListElement

public static Object getListElement(Object value,
                                    String index)
                             throws ComplexValuesException
Return a List element corresponding to a given index.

Parameters:
value - the List value
index - the given index
Returns:
the corresponding element if the index is valid
Throws:
ComplexValuesException - the index has not a number

getCompositeItem

public static Object getCompositeItem(Object value,
                                      String key)
                               throws ComplexValuesException
Get an item of a CompositeData value

Parameters:
value - the CompositeData value
key - the given key
Returns:
the item corresponding to the key, if the key exists
Throws:
ComplexValuesException - no item found with the given key

getMapItem

public static Object getMapItem(Object value,
                                String key)
                         throws ComplexValuesException
Get an item of a Map value

Parameters:
value - the Map value
key - the given key
Returns:
the item corresponding to the key, if the key exists
Throws:
ComplexValuesException - no item found with the given key

getElement

public static Object getElement(Object value,
                                String index)
                         throws ComplexValuesException
Get an element of an indexed complexValue

Parameters:
value - the complex value
Returns:
the element if found (null should not be returned)
Throws:
ComplexValuesException - not found (could be the case for a TablularType) or could not access.

getItem

public static Object getItem(Object value,
                             String key)
                      throws ComplexValuesException
Get an item of a complexValue

Returns:
Throws:
ComplexValuesException

hasSimpleType

public static boolean hasSimpleType(Object value)
This method allows to define the simple types allowed by JasmineProbe. Simple types are not decomposed in elements !

Parameters:
value - value to test
Returns:
true is its value is simple, false otherwise.


Copyright © 2012 OW2 Consortium. All Rights Reserved.