me.grison.jtoml
Class Util.Reflection

java.lang.Object
  extended by me.grison.jtoml.Util.Reflection
Enclosing class:
Util

public static class Util.Reflection
extends Object

Utilities around Reflection.


Constructor Summary
Util.Reflection()
           
 
Method Summary
static Object getFieldValue(Field field, Object object)
          Get the value of the given field on given object.
static boolean isTomlSupportedType(Class<?> clazz)
          Returns whether the given type is a built-in toml supported type.
static boolean isTomlSupportedTypeExceptMap(Class<?> clazz)
           
static Util.TomlFieldComparator newTomlFieldComparator(List<Field> fields)
          Returns a Util.TomlFieldComparator instantiated with the given list of Fields.
static void setFieldValue(Field field, Object object, Object value)
          Set the value of the given field on given object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util.Reflection

public Util.Reflection()
Method Detail

isTomlSupportedType

public static boolean isTomlSupportedType(Class<?> clazz)
Returns whether the given type is a built-in toml supported type.

Parameters:
clazz - a class object.
Returns:
whether it is a built-in toml type

isTomlSupportedTypeExceptMap

public static boolean isTomlSupportedTypeExceptMap(Class<?> clazz)

setFieldValue

public static void setFieldValue(Field field,
                                 Object object,
                                 Object value)
                          throws IllegalAccessException
Set the value of the given field on given object.

Parameters:
field - the field
object - the object
value - the value
Throws:
IllegalAccessException

getFieldValue

public static Object getFieldValue(Field field,
                                   Object object)
                            throws IllegalAccessException
Get the value of the given field on given object.

Parameters:
field - the field
object - the object
Throws:
IllegalAccessException

newTomlFieldComparator

public static Util.TomlFieldComparator newTomlFieldComparator(List<Field> fields)
Returns a Util.TomlFieldComparator instantiated with the given list of Fields.

Parameters:
fields - the list of fields of an object.
Returns:
the Util.TomlFieldComparator


Copyright © 2013. All Rights Reserved.