public abstract class WSRPManagedBean extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
protected class |
WSRPManagedBean.DefaultPropertyValidator |
protected class |
WSRPManagedBean.MessageValidationHandler |
static interface |
WSRPManagedBean.PropertyValidator
Provides an API to validate input properties.
|
| Modifier and Type | Field and Description |
|---|---|
protected BeanContext |
beanContext
The BeanContext associated with this bean
|
static String |
DUPLICATE |
static String |
INVALID_NAME |
static String |
INVALID_PATH |
protected org.slf4j.Logger |
log |
| Constructor and Description |
|---|
WSRPManagedBean() |
| Modifier and Type | Method and Description |
|---|---|
String |
cancel()
Default action: returns to outcome specified by
setCancelOutcome(String) |
String |
checkAndReturnValueIfValid(String value,
String targetForErrorMessage) |
String |
checkAndReturnValueIfValid(String value,
String targetForErrorMessage,
WSRPManagedBean.PropertyValidator validator)
Asks the specified PropertyValidator to check the validity of the specified value, using the specified target for error messages
|
protected void |
getDuplicateErrorMessage(String value,
String targetForErrorMessage,
String objectTypeName)
Retrieves the localized error message to display when the specified value is a duplicate of an already existing one.
|
protected abstract String |
getObjectTypeName()
Retrieves the name of the type of objects this bean deals with.
|
protected static List<javax.faces.model.SelectItem> |
getSelectItemsFrom(List<String> identifiers) |
protected WSRPManagedBean.PropertyValidator |
getValidator() |
abstract boolean |
isAlreadyExisting(String objectName)
Checks whether the specified value (understood as an identifier for entities this bean manages) is already known to this bean and therefore would consist of a duplicated
value.
|
boolean |
isOldAndNewDifferent(Object oldValue,
Object newValue)
Determines whether the specified old and new values are different after being normalized.
|
Object |
normalizeStringIfNeeded(Object value)
Normalizes String by considering empty String as null as JSF would give either and trim non-null Strings.
|
void |
setBeanContext(BeanContext beanContext) |
void |
setCancelOutcome(String cancelOutcome) |
protected void |
setValidator(WSRPManagedBean.PropertyValidator validator) |
protected transient org.slf4j.Logger log
protected BeanContext beanContext
public static final String INVALID_NAME
public static final String INVALID_PATH
public static final String DUPLICATE
protected void setValidator(WSRPManagedBean.PropertyValidator validator)
protected WSRPManagedBean.PropertyValidator getValidator()
public void setBeanContext(BeanContext beanContext)
public void setCancelOutcome(String cancelOutcome)
public String checkAndReturnValueIfValid(String value, String targetForErrorMessage)
public String checkAndReturnValueIfValid(String value, String targetForErrorMessage, WSRPManagedBean.PropertyValidator validator)
value - the value to be validatedtargetForErrorMessage - the name of the UI component being targeted when an error message needs to be displayedvalidator - the PropertyValidator that will validate the valuesnull otherwiseprotected void getDuplicateErrorMessage(String value, String targetForErrorMessage, String objectTypeName)
value - targetForErrorMessage - objectTypeName - protected abstract String getObjectTypeName()
public abstract boolean isAlreadyExisting(String objectName)
objectName - public boolean isOldAndNewDifferent(Object oldValue, Object newValue)
oldValue - newValue - public Object normalizeStringIfNeeded(Object value)
value - public String cancel()
setCancelOutcome(String)Copyright © 2006-2014 GateIn. All Rights Reserved.