public class TestingColorResolver extends Object implements ObjectResolver
Modifier and Type | Class and Description |
---|---|
static interface |
TestingColorResolver.Color |
static class |
TestingColorResolver.MODE |
static class |
TestingColorResolver.PrimaryColor |
static class |
TestingColorResolver.SecondaryColor |
ObjectResolver.Helper
Modifier and Type | Field and Description |
---|---|
static String |
COLOR_MODE |
static String |
NAME |
Constructor and Description |
---|
TestingColorResolver() |
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.
|
TestingColorResolver.Color |
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 entity)
Generates a reference to an entity.
|
boolean |
validate(Object value)
Validates some value references an existing entity.
|
public static final String COLOR_MODE
public static final String NAME
public TestingColorResolver()
public List<Class<?>> getManagedClasses()
ObjectResolver
getManagedClasses
in interface ObjectResolver
public void configure(Map<String,String> parameters) throws IllegalStateException, IllegalArgumentException
ObjectResolver
configure
in interface ObjectResolver
parameters
- A map of parameter whose keys are parameter names and map value are corresponding values.IllegalStateException
- If this resolver is already configured.IllegalArgumentException
- If some parameter are not compatible with this resolver.public String getName() throws IllegalStateException
ObjectResolver
getName
in interface ObjectResolver
IllegalStateException
public Map<String,Serializable> getParameters() throws IllegalStateException
ObjectResolver
getParameters
in interface ObjectResolver
IllegalStateException
public boolean validate(Object value) throws IllegalStateException
ObjectResolver
validate
in interface ObjectResolver
value
- The reference.IllegalStateException
- If this resolver has not been configured.public TestingColorResolver.Color fetch(Object value) throws IllegalStateException
ObjectResolver
fetch
in interface ObjectResolver
value
- The reference.IllegalStateException
- If this resolver has not been configured.public <T> T fetch(Class<T> type, Object value) throws IllegalStateException
ObjectResolver
fetch
in interface ObjectResolver
value
- The reference.IllegalStateException
- If this resolver has not been configured.public Serializable getReference(Object entity) throws IllegalStateException
ObjectResolver
getReference
in interface ObjectResolver
entity
- The entity.IllegalStateException
- If this resolver has not been configured.public String getConstraintErrorMessage(Object invalidValue, Locale locale)
ObjectResolver
getConstraintErrorMessage
in interface ObjectResolver
invalidValue
- The invalid value that don't match any entity.locale
- The language in which the message should be generated.Copyright © 2017 Nuxeo. All rights reserved.