Class AbstractObjectResolver
- java.lang.Object
-
- org.nuxeo.ecm.core.schema.types.resolver.AbstractObjectResolver
-
- All Implemented Interfaces:
Serializable
,ObjectResolver
- Direct Known Subclasses:
DirectoryEntryResolver
,DocumentModelResolver
,TestingColorResolver
,UserManagerResolver
public abstract class AbstractObjectResolver extends Object implements ObjectResolver
- Since:
- 10.2
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.nuxeo.ecm.core.schema.types.resolver.ObjectResolver
ObjectResolver.Helper
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Serializable>
parameters
protected boolean
validation
-
Fields inherited from interface org.nuxeo.ecm.core.schema.types.resolver.ObjectResolver
VALIDATION_PARAMETER_KEY
-
-
Constructor Summary
Constructors Constructor Description AbstractObjectResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkConfig()
void
configure(Map<String,String> parameters)
Configure this resolver.Map<String,Serializable>
getParameters()
Provides this resolver parameters.boolean
validate(Object value)
Validates some value references an existing entity.boolean
validate(Object value, Object context)
Validates some value references an existing entity, in the given context-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.core.schema.types.resolver.ObjectResolver
fetch, fetch, fetch, getConstraintErrorMessage, getManagedClasses, getName, getReference
-
-
-
-
Field Detail
-
parameters
protected Map<String,Serializable> parameters
-
validation
protected boolean validation
-
-
Method Detail
-
configure
public void configure(Map<String,String> parameters) throws IllegalArgumentException, IllegalStateException
Description copied from interface:ObjectResolver
Configure this resolver.- Specified by:
configure
in interfaceObjectResolver
- Parameters:
parameters
- A map of parameter whose keys are parameter names and map value are corresponding values.- Throws:
IllegalArgumentException
- If some parameter are not compatible with this resolver.IllegalStateException
- If this resolver is already configured.
-
getParameters
public Map<String,Serializable> getParameters()
Description copied from interface:ObjectResolver
Provides this resolver parameters.- Specified by:
getParameters
in interfaceObjectResolver
- Returns:
- A map containing associating parameter name to its value
-
validate
public boolean validate(Object value) throws IllegalStateException
Description copied from interface:ObjectResolver
Validates some value references an existing entity.- Specified by:
validate
in interfaceObjectResolver
- Parameters:
value
- The reference.- Returns:
- true if value could be resolved as an existing external reference, false otherwise.
- Throws:
IllegalStateException
- If this resolver has not been configured.
-
validate
public boolean validate(Object value, Object context) throws IllegalStateException
Description copied from interface:ObjectResolver
Validates some value references an existing entity, in the given context- Specified by:
validate
in interfaceObjectResolver
- Parameters:
value
- The reference.context
- A resolver-specific context allowing resolution of the value.- Returns:
- true if value could be resolved as an existing external reference, false otherwise.
- Throws:
IllegalStateException
- If this resolver has not been configured.
-
checkConfig
protected void checkConfig() throws IllegalStateException
- Throws:
IllegalStateException
-
-