|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.data.pojo.PojoHelper
public class PojoHelper
A helper for the pojo model nodes
Copyright (c) Formaria Ltd., 2008
License: see license.txt
| Constructor Summary | |
|---|---|
PojoHelper(java.lang.Object model)
Creates a new instance of PojoHelper |
|
| Method Summary | |
|---|---|
protected static java.lang.Class |
convertType(java.lang.String typeName)
Returns Class object whose simple name is in the given String. |
protected static java.lang.Object |
convertValue(java.lang.String type,
java.lang.String value)
Gets the original value of the specified object. |
PojoModel |
get(java.lang.String path)
Gets the pojo model at the specified path |
protected static java.lang.Class[] |
getArgumentTypes(java.lang.String propertyMethod)
Retrieves the argument types from the passed String describing property method( either getter or setter) The describing String must be in the format: method(typeName1, typeName2,...) |
protected static java.lang.Object[] |
getArgumentValues(java.lang.String element)
Retrieves argument values from the given element. |
protected static java.lang.String |
getElementIndex(java.lang.String element)
Retrieves the collection index from the given element. |
protected static java.lang.String |
getMethodName(java.lang.String propertyMethod)
Retrieves the method name from the passed String describing property method. |
static java.lang.String |
getPropertyKey(java.lang.String propertyName,
java.lang.Class[] types)
Gets the unique key for the given property |
static java.lang.String |
getPropertyName(java.lang.String element)
Retrieves the property name from the given String which must be in the format: property(arg1,arg2)[idx]" |
PojoModel |
getRootModel()
Gets the root of the pojo model |
static java.lang.Integer |
getSignatureKey(java.lang.Class[] types)
Returns the key for the specified argument types which will be used in the getters/setters hashtable |
static java.lang.Class[] |
getTypes(java.lang.Object[] objects)
Returns the table constisting of the classes whose instances are the given objects. |
boolean |
isDirty(java.lang.String path)
Indicates whether specified model node is dirty. |
static boolean |
isPrimitiveType(java.lang.Class type)
Determines whether the specified class is either a primitive or a primitive wrapper. |
static boolean |
needsAdapter(java.lang.Class type)
Indicates whether specified class needs an adapter |
PojoModel |
set(java.lang.String path,
java.lang.Object value)
Sets the model value for the specified child of the base node |
void |
setDirty()
Marks all nodes of the pojo model tree as dirty. |
void |
setDirty(java.lang.String path)
Marks the specified model node and its property subtree as dirty. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PojoHelper(java.lang.Object model)
model - the root of the pojo model| Method Detail |
|---|
public void setDirty(java.lang.String path)
path - the path to the model node to be markedpublic void setDirty()
public boolean isDirty(java.lang.String path)
path - the path to the model node to be queried
public PojoModel getRootModel()
public PojoModel get(java.lang.String path)
path - the path to the child node
public PojoModel set(java.lang.String path,
java.lang.Object value)
path - the path to the child nodevalue - the new value
public static boolean needsAdapter(java.lang.Class type)
type - the Class to be checked
public static boolean isPrimitiveType(java.lang.Class type)
type - the class to be queried
protected static java.lang.Object convertValue(java.lang.String type,
java.lang.String value)
type - the type to which the value is to be
convertedvalue - the value to be converted
protected static java.lang.Class convertType(java.lang.String typeName)
typeName - the simple name of the type.protected static java.lang.String getMethodName(java.lang.String propertyMethod)
propertyMethod - String describing property method
protected static java.lang.Class[] getArgumentTypes(java.lang.String propertyMethod)
propertyMethod - String describing property method
protected static java.lang.Object[] getArgumentValues(java.lang.String element)
element - the binding path element
protected static java.lang.String getElementIndex(java.lang.String element)
element - the binding path element
public static java.lang.String getPropertyName(java.lang.String element)
element - the binding path element
public static java.lang.String getPropertyKey(java.lang.String propertyName,
java.lang.Class[] types)
propertyName - the name of the propertytypes - the table containing the types of the property arguments.public static java.lang.Integer getSignatureKey(java.lang.Class[] types)
argument - types signature
public static java.lang.Class[] getTypes(java.lang.Object[] objects)
objects - the table consisting of the object whose
classes are to retrieved
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||