Class BaseTypeProducer
java.lang.Object
org.exoplatform.services.rest.impl.method.BaseTypeProducer
- All Implemented Interfaces:
TypeProducer
- Direct Known Subclasses:
PrimitiveTypeProducer,StringConstructorProducer,StringProducer,StringValueOfProducer
Abstraction for single (not for collections) types.
- Version:
- $Id: $
- Author:
- Andrey Parfonov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ObjectcreateValue(String value) Create object from given string.createValue(String param, javax.ws.rs.core.MultivaluedMap<String, String> values, String defaultValue)
-
Constructor Details
-
BaseTypeProducer
public BaseTypeProducer()
-
-
Method Details
-
createValue
Create object from given string. In all extends for this class this method must be specified to produce object of required type. String will be used as parameter for constructor of object or static valueOf method.- Parameters:
value- string value- Returns:
- newly created object
- Throws:
Exception- if any error occurs
-
createValue
public Object createValue(String param, javax.ws.rs.core.MultivaluedMap<String, String> values, String defaultValue) throws Exception- Specified by:
createValuein interfaceTypeProducer- Parameters:
param- parameter name, parameter name should be getting from parameter annotationvalues- all value which can be used for construct object, it can be header parameters, path parameters, query parameters, etcdefaultValue- default value which can be used if in value can't be found required value with name param- Returns:
- newly created object
- Throws:
Exception- if any errors occurs
-