Class Params
- java.lang.Object
-
- org.alfresco.rest.framework.resource.parameters.Params
-
- All Implemented Interfaces:
Parameters
public class Params extends java.lang.Object implements Parameters
Parameters passed in from a Rest client for use in calls to the rest api.- Author:
- Gethin James
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Params.RecognizedParams
A formal set of params that any rest service could potentially have passed in as request params
-
Constructor Summary
Constructors Modifier Constructor Description protected
Params(java.lang.Boolean isCollectionResource, java.lang.String entityId, java.lang.String relationshipId, java.lang.String relationship2Id, java.lang.Object passedIn, java.io.InputStream stream, java.lang.String addressedProperty, Params.RecognizedParams recognizedParams, BasicContentInfo contentInfo, org.springframework.extensions.webscripts.WebScriptRequest request)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getBinaryProperty()
Gets the name of the property that was requested.BasicContentInfo
getContentInfo()
Gets the basic information about content, typically taken from a HTTPServletRequest.java.lang.String
getEntityId()
BeanPropertiesFilter
getFilter()
Returns aBeanPropertiesFilter
for filtering out properties.java.util.List<java.lang.String>
getInclude()
A list of property names passed in the request using the json pointer syntax Specified by the "INCLUDE" request parameter.Paging
getPaging()
Returns a representation of the Paging of collections of resources, with skip count and max items.java.lang.String
getParameter(java.lang.String parameterName)
Gets a single request query parameter passed in by the user.org.apache.poi.ss.formula.functions.T
getParameter(java.lang.String parameterName, java.lang.Class<org.apache.poi.ss.formula.functions.T> clazz)
Gets a single request parameter passed in by the user.java.lang.Object
getPassedIn()
Query
getQuery()
Represents a Query specified by the client.java.util.Map<java.lang.String,BeanPropertiesFilter>
getRelationsFilter()
java.lang.String
getRelationship2Id()
java.lang.String
getRelationshipId()
org.springframework.extensions.webscripts.WebScriptRequest
getRequest()
Gets access to the entire webscript request.java.util.List<java.lang.String>
getSelectedProperties()
A list of property names passed in the request using the json pointer syntax Specified by the "SELECT" request parameter.java.util.List<SortColumn>
getSorting()
Returns a List ofSortColumn
for sorting properties.java.io.InputStream
getStream()
boolean
hasBinaryProperty(java.lang.String propertyName)
Indicates if the specified property was requested.boolean
includeSource()
Indicates if the source entity should be includes in the request.boolean
isCollectionResource()
java.lang.String
toString()
static Params
valueOf(boolean isCollectionResource, java.lang.String entityId, java.lang.String relationshipId, java.lang.String relationship2Id, java.lang.Object passedIn, java.io.InputStream stream, java.lang.String addressedProperty, Params.RecognizedParams recognizedParams, BasicContentInfo contentInfo, org.springframework.extensions.webscripts.WebScriptRequest request)
static Params
valueOf(java.lang.String entityId, java.lang.String relationshipId, java.lang.Object passedIn, java.io.InputStream stream, java.lang.String addressedProperty, Params.RecognizedParams recognizedParams, BasicContentInfo contentInfo, org.springframework.extensions.webscripts.WebScriptRequest request)
static Params
valueOf(java.lang.String entityId, java.lang.String relationshipId, Params.RecognizedParams recognizedParams, java.lang.Object passedIn, org.springframework.extensions.webscripts.WebScriptRequest request)
static Params
valueOf(java.lang.String entityId, java.lang.String relationshipId, org.springframework.extensions.webscripts.WebScriptRequest request)
static Params
valueOf(java.lang.String entityId, Params.RecognizedParams recognizedParams, java.lang.Object passedIn, org.springframework.extensions.webscripts.WebScriptRequest request)
static Params
valueOf(BeanPropertiesFilter paramFilter, java.lang.String entityId, org.springframework.extensions.webscripts.WebScriptRequest request)
static Params
valueOf(Params.RecognizedParams recognizedParams, java.lang.String entityId, java.lang.String relationshipId, org.springframework.extensions.webscripts.WebScriptRequest request)
-
-
-
Constructor Detail
-
Params
protected Params(java.lang.Boolean isCollectionResource, java.lang.String entityId, java.lang.String relationshipId, java.lang.String relationship2Id, java.lang.Object passedIn, java.io.InputStream stream, java.lang.String addressedProperty, Params.RecognizedParams recognizedParams, BasicContentInfo contentInfo, org.springframework.extensions.webscripts.WebScriptRequest request)
-
-
Method Detail
-
valueOf
public static Params valueOf(BeanPropertiesFilter paramFilter, java.lang.String entityId, org.springframework.extensions.webscripts.WebScriptRequest request)
-
valueOf
public static Params valueOf(java.lang.String entityId, java.lang.String relationshipId, org.springframework.extensions.webscripts.WebScriptRequest request)
-
valueOf
public static Params valueOf(Params.RecognizedParams recognizedParams, java.lang.String entityId, java.lang.String relationshipId, org.springframework.extensions.webscripts.WebScriptRequest request)
-
valueOf
public static Params valueOf(java.lang.String entityId, Params.RecognizedParams recognizedParams, java.lang.Object passedIn, org.springframework.extensions.webscripts.WebScriptRequest request)
-
valueOf
public static Params valueOf(java.lang.String entityId, java.lang.String relationshipId, Params.RecognizedParams recognizedParams, java.lang.Object passedIn, org.springframework.extensions.webscripts.WebScriptRequest request)
-
valueOf
public static Params valueOf(java.lang.String entityId, java.lang.String relationshipId, java.lang.Object passedIn, java.io.InputStream stream, java.lang.String addressedProperty, Params.RecognizedParams recognizedParams, BasicContentInfo contentInfo, org.springframework.extensions.webscripts.WebScriptRequest request)
-
valueOf
public static Params valueOf(boolean isCollectionResource, java.lang.String entityId, java.lang.String relationshipId, java.lang.String relationship2Id, java.lang.Object passedIn, java.io.InputStream stream, java.lang.String addressedProperty, Params.RecognizedParams recognizedParams, BasicContentInfo contentInfo, org.springframework.extensions.webscripts.WebScriptRequest request)
-
getEntityId
public java.lang.String getEntityId()
- Specified by:
getEntityId
in interfaceParameters
-
getPassedIn
public java.lang.Object getPassedIn()
-
getRelationshipId
public java.lang.String getRelationshipId()
- Specified by:
getRelationshipId
in interfaceParameters
-
getRelationship2Id
public java.lang.String getRelationship2Id()
- Specified by:
getRelationship2Id
in interfaceParameters
-
isCollectionResource
public boolean isCollectionResource()
- Specified by:
isCollectionResource
in interfaceParameters
-
getQuery
public Query getQuery()
Description copied from interface:Parameters
Represents a Query specified by the client. Specified by the "WHERE" request parameter.- Specified by:
getQuery
in interfaceParameters
- Returns:
- Query
Query
-
getPaging
public Paging getPaging()
Description copied from interface:Parameters
Returns a representation of the Paging of collections of resources, with skip count and max items. SeePaging
Specified by the "skipCount" and "maxItems" request parameters.- Specified by:
getPaging
in interfaceParameters
- Returns:
- Paging Paging information
-
getFilter
public BeanPropertiesFilter getFilter()
Description copied from interface:Parameters
Returns aBeanPropertiesFilter
for filtering out properties. Specified by the "properties" request parameter.- Specified by:
getFilter
in interfaceParameters
- Returns:
- BeanPropertiesFilter
BeanPropertiesFilter
-
includeSource
public boolean includeSource()
Description copied from interface:Parameters
Indicates if the source entity should be includes in the request. This will normally be done by the framework but implentations may prefer to do it themselves.- Specified by:
includeSource
in interfaceParameters
- Returns:
- true if the source should be included.
-
getRelationsFilter
public java.util.Map<java.lang.String,BeanPropertiesFilter> getRelationsFilter()
-
getStream
public java.io.InputStream getStream()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getParameter
public java.lang.String getParameter(java.lang.String parameterName)
Description copied from interface:Parameters
Gets a single request query parameter passed in by the user. Currently doesn't support multiple values.- Specified by:
getParameter
in interfaceParameters
- Parameters:
parameterName
- String- Returns:
- String The Parameter value
-
getParameter
public org.apache.poi.ss.formula.functions.T getParameter(java.lang.String parameterName, java.lang.Class<org.apache.poi.ss.formula.functions.T> clazz) throws InvalidArgumentException
Description copied from interface:Parameters
Gets a single request parameter passed in by the user. Attempts to convert the parameter to the specified type. If unable to convert the parameter to the specified type then throws an InvalidArgumentException. Currently doesn't support multiple values.- Specified by:
getParameter
in interfaceParameters
- Parameters:
parameterName
- Stringclazz
- - type to use for conversion.- Returns:
- The Parameter value
- Throws:
InvalidArgumentException
-
hasBinaryProperty
public boolean hasBinaryProperty(java.lang.String propertyName)
Description copied from interface:Parameters
Indicates if the specified property was requested.- Specified by:
hasBinaryProperty
in interfaceParameters
- Parameters:
propertyName
- the property Specified as part of the url request.- Returns:
- true if the propertyName was specified as part of the url request
-
getSorting
public java.util.List<SortColumn> getSorting()
Description copied from interface:Parameters
Returns a List ofSortColumn
for sorting properties. Specified by the "orderBy" request parameter.- Specified by:
getSorting
in interfaceParameters
- Returns:
- List of
SortColumn
-
getBinaryProperty
public java.lang.String getBinaryProperty()
Description copied from interface:Parameters
Gets the name of the property that was requested.- Specified by:
getBinaryProperty
in interfaceParameters
- Returns:
- String the propertyName
-
getSelectedProperties
public java.util.List<java.lang.String> getSelectedProperties()
Description copied from interface:Parameters
A list of property names passed in the request using the json pointer syntax Specified by the "SELECT" request parameter.- Specified by:
getSelectedProperties
in interfaceParameters
-
getInclude
public java.util.List<java.lang.String> getInclude()
Description copied from interface:Parameters
A list of property names passed in the request using the json pointer syntax Specified by the "INCLUDE" request parameter.- Specified by:
getInclude
in interfaceParameters
- Returns:
- the propertyNames
-
getContentInfo
public BasicContentInfo getContentInfo()
Description copied from interface:Parameters
Gets the basic information about content, typically taken from a HTTPServletRequest.- Specified by:
getContentInfo
in interfaceParameters
- Returns:
- BasicContentInfo the content info
-
getRequest
public org.springframework.extensions.webscripts.WebScriptRequest getRequest()
Description copied from interface:Parameters
Gets access to the entire webscript request.- Specified by:
getRequest
in interfaceParameters
- Returns:
- WebScriptRequest
-
-