public final class ModelHelper extends Object
This class provides methods for checking whether a given property name is declared as a model variable.
Model variables are defined on ModelObject derived types as variables that begin with a "PROP_" prefix.
The code walks the class chain and picks out which variables are model specific and which ones are custom. The results are stored in look-up tables so that subsequent lookups will simply hit the cache. This is perfectly fine since model definitions do not change at runtime.
| Constructor and Description |
|---|
ModelHelper() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isCustomProperty(ModelObject object,
String propertyName)
Determines whether the given property is a custom property for
the given object
|
static boolean |
isModelProperty(ModelObject object,
String propertyName)
Determines whether the given property is a non-custom (or model)
property for the given object.
|
static String |
newGUID()
Builds a new GUID
|
static void |
resetId(ModelObject object,
String id)
Allows model object ids to be set manually
|
public static boolean isCustomProperty(ModelObject object, String propertyName)
object - the objectpropertyName - the property namepublic static boolean isModelProperty(ModelObject object, String propertyName)
object - the objectpropertyName - the property namepublic static String newGUID()
public static void resetId(ModelObject object, String id)
object - ModelObjectid - StringCopyright © 2005–2016 Alfresco Software. All rights reserved.