Class BaseCollectionProducer
java.lang.Object
org.exoplatform.services.rest.impl.method.BaseCollectionProducer
- All Implemented Interfaces:
TypeProducer
- Direct Known Subclasses:
CollectionStringConstructorProducer,CollectionStringProducer,CollectionStringValueOfProducer
- Version:
- $Id: $
- Author:
- Andrey Parfonov
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseCollectionProducer(Class<?> collectionClass) Constructs BaseCollectionProducer. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ObjectcreateValue(String value) Create collection's element.createValue(String param, javax.ws.rs.core.MultivaluedMap<String, String> values, String defaultValue) Create Object (it is Collection) and add in it elements.
-
Constructor Details
-
Method Details
-
createValue
Create collection's element.- Parameters:
value- this String will be used for creation object, usually String will be used as parameter for constructor or static methodvalueOf- Returns:
- newly created collection's element
- Throws:
Exception- if any error occurs
-
createValue
public Object createValue(String param, javax.ws.rs.core.MultivaluedMap<String, String> values, String defaultValue) throws ExceptionCreate Object (it is Collection) and add in it elements. Elements must either:- To be a Sting
- Have a constructor that accepts a single String argument.
- Have a static method named
valueOfthat accepts a single String argument.
- 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
-