public class TestingColorResolver extends AbstractObjectResolver 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 |
parameters, validation
VALIDATION_PARAMETER_KEY
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.
|
Serializable |
getReference(Object entity)
Generates a reference to an entity.
|
checkConfig, getParameters, validate, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fetch, getParameters, validate, validate
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
configure
in class AbstractObjectResolver
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 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 © 2019 Nuxeo. All rights reserved.