org.shept.org.springframework.web.servlet.mvc.support
public class ModelUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
initMethod |
protected static org.apache.commons.logging.Log |
logger
Logger that is available to subclasses
|
| Constructor and Description |
|---|
ModelUtils() |
| Modifier and Type | Method and Description |
|---|---|
private static Object |
cloneCopy(Object model)
When the object to be copied provides a clone implementation
return a clone of the object.
|
static Object |
copyModel(org.springframework.dao.support.DaoSupport dao,
Object model)
Trying to copy a model as generic as possible when Dao Layer is available
1st we check if a #clone method is implemented.
|
static Object |
copyModel(Object model)
Trying to copy a model as generic as possible when no Dao layer is available
1st we check if a #clone method is implemented.
|
static ModelCreation |
getNewModelTemplate(ChainConfiguration cc,
Object model,
String initString) |
static ModelCreation |
getNewModelTemplate(Class<?> clazz,
Object model,
String initString) |
static ModelCreation |
getNewModelTemplate(Class<?> clazz,
String initString) |
static void |
initialize(Object target,
Object sourceModel) |
private static Object |
shallowCopy(Object model)
Answer a shallow copy of the object
|
static Object |
unwrapIfNecessary(Object commandOrModel)
Unwrap a command or model from its envelope.
|
static Object |
wrapIfNecessary(Object model)
This is the counterpart of
unwrapIfNecessary(Object)
When showing model entity objects in a form we may want to decorate them
with additional information that should'nt be saved to the database,
e.g. |
public static String initMethod
protected static org.apache.commons.logging.Log logger
public static Object unwrapIfNecessary(Object commandOrModel)
commandOrModel - public static Object wrapIfNecessary(Object model)
unwrapIfNecessary(Object)
When showing model entity objects in a form we may want to decorate them
with additional information that should'nt be saved to the database,
e.g. repeat information fields (passwords other temporary or compound fields)
Wrapping provides a solution to present a command object instead of the real model entity.model - public static Object copyModel(Object model)
model - public static Object copyModel(org.springframework.dao.support.DaoSupport dao, Object model)
model - private static Object cloneCopy(Object model)
model - private static Object shallowCopy(Object model)
model - public static ModelCreation getNewModelTemplate(Class<?> clazz, Object model, String initString)
public static ModelCreation getNewModelTemplate(Class<?> clazz, String initString)
public static ModelCreation getNewModelTemplate(ChainConfiguration cc, Object model, String initString)
Copyright © 2014. All Rights Reserved.