fulmine.model.field
Class FieldUtils

java.lang.Object
  extended by fulmine.model.field.FieldUtils

public abstract class FieldUtils
extends Object

Provides utility methods for working with IField instances

Author:
Ramon Servadei

Field Summary
static String CREATE_FROM_NATIVE
          The name of a field that is created from a native type.
 
Constructor Summary
FieldUtils()
           
 
Method Summary
static IField createFromNative(Object nativeObject)
          Convert an object from its native object to a framework object
static
<T extends IField>
T
createFromString(Class<? extends IField> field, String fieldName, String fieldValue)
          Create an instance of an IField using the parameters passed in.
static
<T extends IField>
T
createFromString(String simpleClassName, String fieldName)
          Create an instance of an IField using the simple class name and the name for the field
static
<T extends IField>
T
createFromString(String simpleClassName, String fieldName, byte application, short permission)
          Create an instance of an IField using the simple class name and the name for the field
static Class<? extends IField> getFrameworkClass(Class<?> nativeType)
          Convert the native class to the framework class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATE_FROM_NATIVE

public static final String CREATE_FROM_NATIVE
The name of a field that is created from a native type.

See Also:
createFromNative(Object), Constant Field Values
Constructor Detail

FieldUtils

public FieldUtils()
Method Detail

createFromString

public static <T extends IField> T createFromString(Class<? extends IField> field,
                                                    String fieldName,
                                                    String fieldValue)
Create an instance of an IField using the parameters passed in. The (String, String) constructor for the field class is located and invoked.

Type Parameters:
T -
Parameters:
field - the field Class
fieldName - the field name
fieldValue - the field value
Returns:
the field instance

createFromString

public static <T extends IField> T createFromString(String simpleClassName,
                                                    String fieldName)
Create an instance of an IField using the simple class name and the name for the field

Type Parameters:
T -
Parameters:
simpleClassName - the simple class name, e.g. StringField
fieldName - the name for the field
Returns:
the field

createFromString

public static <T extends IField> T createFromString(String simpleClassName,
                                                    String fieldName,
                                                    byte application,
                                                    short permission)
Create an instance of an IField using the simple class name and the name for the field

Type Parameters:
T -
Parameters:
simpleClassName - the simple class name, e.g. StringField
fieldName - the name for the field
application - the application code for the field
permission - the permission code for the field
Returns:
the field

createFromNative

public static IField createFromNative(Object nativeObject)
Convert an object from its native object to a framework object

Parameters:
nativeObject - the object to convert
Returns:
a framework object
Throws:
IllegalArgumentException - if the native object is not supported

getFrameworkClass

public static Class<? extends IField> getFrameworkClass(Class<?> nativeType)
Convert the native class to the framework class

Parameters:
nativeType - the native class type
Returns:
the framework class
Throws:
IllegalArgumentException - if the native class is not compatible with the framework


Copyright © 2007-2009. All Rights Reserved.