ReportMill 11 API

com.reportmill.base
Class RMKey

java.lang.Object
  extended by com.reportmill.base.RMKey

public class RMKey
extends java.lang.Object

This class provides an optimized convenience for getting named values from arbitrary objects.


Nested Class Summary
static interface RMKey.Get
          This is interface is implemented by objects that can get key values themselves.
static interface RMKey.GetSet
          This is interface is implemented by objects that can get/set key value themselves.
static class RMKey.KeyAccessor
          KeyAccessor - enclosed class for actually getting/setting values for a given object (class) and key.
 
Constructor Summary
RMKey()
           
 
Method Summary
static RMKey.KeyAccessor getAccessor(java.lang.Object anObj, java.lang.String aKey)
          Returns the accessor object for a given object (class) and key.
static java.lang.String getAttributeName(java.lang.String aKey)
          Returns the attribute name for a key (stripping is/get and capitolizing first letter).
static java.lang.Object getValue(java.lang.Object anObj, java.lang.String aKey)
          Returns a value for given object and key.
static boolean hasKey(java.lang.Object anObj, java.lang.String aKey)
          Returns whether given object has an accessor for given key.
static int intValueForKey(java.lang.Object anObj, java.lang.String aKey)
          Returns an int value for a key.
static boolean isKey(java.lang.String aString)
          Returns whether given string is a valid key (starts with letter and only contains letters, digits, white space and under bars).
static boolean setValue(java.lang.Object anObj, java.lang.String aKey, java.lang.Object aValue)
          Sets a value for given object and key and value.
static java.lang.String stringValueForKey(java.lang.Object anObj, java.lang.String aKey)
          Returns a string value for a key.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RMKey

public RMKey()
Method Detail

isKey

public static boolean isKey(java.lang.String aString)
Returns whether given string is a valid key (starts with letter and only contains letters, digits, white space and under bars).


getValue

public static java.lang.Object getValue(java.lang.Object anObj,
                                        java.lang.String aKey)
Returns a value for given object and key.


setValue

public static boolean setValue(java.lang.Object anObj,
                               java.lang.String aKey,
                               java.lang.Object aValue)
Sets a value for given object and key and value.


hasKey

public static boolean hasKey(java.lang.Object anObj,
                             java.lang.String aKey)
Returns whether given object has an accessor for given key.


stringValueForKey

public static java.lang.String stringValueForKey(java.lang.Object anObj,
                                                 java.lang.String aKey)
Returns a string value for a key.


intValueForKey

public static int intValueForKey(java.lang.Object anObj,
                                 java.lang.String aKey)
Returns an int value for a key.


getAccessor

public static RMKey.KeyAccessor getAccessor(java.lang.Object anObj,
                                            java.lang.String aKey)
Returns the accessor object for a given object (class) and key.


getAttributeName

public static java.lang.String getAttributeName(java.lang.String aKey)
Returns the attribute name for a key (stripping is/get and capitolizing first letter).


ReportMill 11 API