public interface ObjectResolver extends Serializable
Modifier and Type | Interface and Description |
---|---|
static class |
ObjectResolver.Helper
Manage translation for resolver :
#getConstraintErrorMessage(ObjectResolver, Object, Locale) |
Modifier and Type | Method and Description |
---|---|
void |
configure(Map<String,String> parameters)
Configure this resolver.
|
<T> T |
fetch(Class<T> type,
Object value)
Provides the entity referenced by a value, return the entity as expected type.
|
Object |
fetch(Object value)
Provides the entity referenced by a value.
|
String |
getConstraintErrorMessage(Object invalidValue,
Locale locale)
Provides an error message to display when some invalid value does not match existing entity.
|
List<Class<?>> |
getManagedClasses()
Returns the resolved object types.
|
String |
getName()
Provides this resolver name.
|
Map<String,Serializable> |
getParameters()
Provides this resolver parameters.
|
Serializable |
getReference(Object object)
Generates a reference to an entity.
|
boolean |
validate(Object value)
Validates some value references an existing entity.
|
void configure(Map<String,String> parameters) throws IllegalArgumentException, IllegalArgumentException
parameters
- A map of parameter whose keys are parameter names and map value are corresponding values.IllegalArgumentException
- If some parameter are not compatible with this resolver.IllegalStateException
- If this resolver is already configured.List<Class<?>> getManagedClasses()
Map<String,Serializable> getParameters()
boolean validate(Object value)
value
- The reference.IllegalStateException
- If this resolver has not been configured.Object fetch(Object value)
value
- The reference.IllegalStateException
- If this resolver has not been configured.<T> T fetch(Class<T> type, Object value)
value
- The reference.IllegalStateException
- If this resolver has not been configured.Serializable getReference(Object object)
object
- The entity.IllegalStateException
- If this resolver has not been configured.String getConstraintErrorMessage(Object invalidValue, Locale locale)
invalidValue
- The invalid value that don't match any entity.locale
- The language in which the message should be generated.Copyright © 2015 Nuxeo SA. All rights reserved.