Package com.adobe.granite.rest.converter
Class ResourceConverterContext
- java.lang.Object
-
- com.adobe.granite.rest.converter.ResourceConverterContext
-
public class ResourceConverterContext extends java.lang.Object
TheResourceConverterContext
provides context information which are necessary or useful for converting aresource
.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_LIMIT
Default page size limit.static boolean
DEFAULT_SHOW_ALL_PROPERTIES
Default show all properties flag.static boolean
DEFAULT_USE_ABSOLUTE_URIS
Default indicator if absolute URIs should be used.
-
Constructor Summary
Constructors Constructor Description ResourceConverterContext()
Create a newResourceConverterContext
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getContextPath()
Returns the portion of the request URI that indicates the context.Filter<Resource>
getFilter()
Returns the filter.int
getLimit()
Returns the limit.java.util.Map<java.lang.String,java.lang.String[]>
getModelFilters()
int
getOffset()
Returns the offset.java.util.Map<java.lang.String,java.lang.String[]>
getParameters()
Returns the request parameters.java.lang.String
getQuery()
Returns the query.RequestPathInfo
getRequestPathInfo()
Returns theRequestPathInfo
.java.lang.String
getRootContextPath()
Get the Root Context Path Value as defined in OSGI config for ApiEndpointResourceProviderFactoryjava.lang.String
getScheme()
Returns the name of the scheme.java.lang.String
getServerName()
Returns the host name of the server.int
getServerPort()
Returns the port number.java.lang.String[]
getShowProperties()
Retrieves the properties to show.boolean
isAbsolutURI()
Indicator if absolute URI's are used.boolean
isShowAllProperties()
Indicator if all properties should be shown.ResourceConverterContext
setAbsolutURI(boolean useAbsoluteURI)
Sets the property to use absolute URI's.ResourceConverterContext
setContextPath(java.lang.String contextPath)
Sets the portion of the request URI that indicates the context.ResourceConverterContext
setFilter(Filter<Resource> filter)
Sets the filter.ResourceConverterContext
setLimit(int limit)
Sets the limit.void
setModelFilters(java.util.Map<java.lang.String,java.lang.String[]> filters)
ResourceConverterContext
setOffset(int offset)
Set the offset.ResourceConverterContext
setParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)
Sets the request parameters.ResourceConverterContext
setQuery(java.lang.String query)
Sets the query.ResourceConverterContext
setRequestPathInfo(RequestPathInfo requestPathInfo)
Sets theRequestPathInfo
.void
setRootContextPath(java.lang.String rootContextPath)
Set the root context pathResourceConverterContext
setScheme(java.lang.String scheme)
Sets the name of the scheme.ResourceConverterContext
setServerName(java.lang.String serverName)
Sets the host name of the server.ResourceConverterContext
setServerPort(int serverPort)
Sets the port number.ResourceConverterContext
setShowAllProperties(boolean showAllProperties)
Sets the property to show all properties.ResourceConverterContext
setShowProperties(java.lang.String[] showProperties)
Sets the properties to show.
-
-
-
Field Detail
-
DEFAULT_LIMIT
public static final int DEFAULT_LIMIT
Default page size limit.- See Also:
- Constant Field Values
-
DEFAULT_USE_ABSOLUTE_URIS
public static final boolean DEFAULT_USE_ABSOLUTE_URIS
Default indicator if absolute URIs should be used.- See Also:
- Constant Field Values
-
DEFAULT_SHOW_ALL_PROPERTIES
public static final boolean DEFAULT_SHOW_ALL_PROPERTIES
Default show all properties flag.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ResourceConverterContext
public ResourceConverterContext()
Create a newResourceConverterContext
.
-
-
Method Detail
-
getRootContextPath
public java.lang.String getRootContextPath()
Get the Root Context Path Value as defined in OSGI config for ApiEndpointResourceProviderFactory- Returns:
- The root context path.
-
setRootContextPath
public void setRootContextPath(java.lang.String rootContextPath)
Set the root context path- Parameters:
rootContextPath
- The root context path
-
getOffset
public int getOffset()
Returns the offset.- Returns:
- The offset value
-
setOffset
public ResourceConverterContext setOffset(int offset)
Set the offset.- Parameters:
offset
- Offset value- Returns:
- reference to self
-
getLimit
public int getLimit()
Returns the limit.- Returns:
- The limit value
-
setLimit
public ResourceConverterContext setLimit(int limit)
Sets the limit.- Parameters:
limit
- Limit value- Returns:
- reference to self
-
setFilter
public ResourceConverterContext setFilter(Filter<Resource> filter)
Sets the filter.- Parameters:
filter
- A filter- Returns:
- reference to self
-
getScheme
public java.lang.String getScheme()
Returns the name of the scheme.- Returns:
- Scheme name
-
setScheme
public ResourceConverterContext setScheme(java.lang.String scheme)
Sets the name of the scheme.- Parameters:
scheme
- Scheme name- Returns:
- reference to self
-
getServerName
public java.lang.String getServerName()
Returns the host name of the server.- Returns:
- Server host name
-
setServerName
public ResourceConverterContext setServerName(java.lang.String serverName)
Sets the host name of the server.- Parameters:
serverName
- Server host name- Returns:
- reference to self
-
getServerPort
public int getServerPort()
Returns the port number.- Returns:
- Server port
-
setServerPort
public ResourceConverterContext setServerPort(int serverPort)
Sets the port number.- Parameters:
serverPort
- Server port- Returns:
- reference to self
-
getContextPath
public java.lang.String getContextPath()
Returns the portion of the request URI that indicates the context.- Returns:
- Context path
-
setContextPath
public ResourceConverterContext setContextPath(java.lang.String contextPath)
Sets the portion of the request URI that indicates the context.- Parameters:
contextPath
- Context path- Returns:
- reference to self
-
getRequestPathInfo
public RequestPathInfo getRequestPathInfo()
Returns theRequestPathInfo
.- Returns:
- RequestPathInfo
-
setRequestPathInfo
public ResourceConverterContext setRequestPathInfo(RequestPathInfo requestPathInfo)
Sets theRequestPathInfo
.- Parameters:
requestPathInfo
- A RequestPathInfo- Returns:
- reference to self
-
getParameters
public java.util.Map<java.lang.String,java.lang.String[]> getParameters()
Returns the request parameters.- Returns:
- A
Map
of request parameter keys and values
-
setParameters
public ResourceConverterContext setParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)
Sets the request parameters.- Parameters:
parameters
- Request parameters- Returns:
- reference to self
-
getQuery
public java.lang.String getQuery()
Returns the query.- Returns:
- Query value
-
setQuery
public ResourceConverterContext setQuery(java.lang.String query)
Sets the query.- Parameters:
query
- Query value- Returns:
- reference to self
-
isAbsolutURI
public boolean isAbsolutURI()
Indicator if absolute URI's are used.- Returns:
true
if URIs are absolute,false
otherwise
-
setAbsolutURI
public ResourceConverterContext setAbsolutURI(boolean useAbsoluteURI)
Sets the property to use absolute URI's.- Parameters:
useAbsoluteURI
- Indicator to use absolute URIs- Returns:
- reference to self
-
isShowAllProperties
public boolean isShowAllProperties()
Indicator if all properties should be shown.- Returns:
- the showAllProperties
-
setShowAllProperties
public ResourceConverterContext setShowAllProperties(boolean showAllProperties)
Sets the property to show all properties.- Parameters:
showAllProperties
- Indicator to show all properties- Returns:
- reference to self
-
getShowProperties
public java.lang.String[] getShowProperties()
Retrieves the properties to show.- Returns:
- A list of property names to show.
-
setShowProperties
public ResourceConverterContext setShowProperties(java.lang.String[] showProperties)
Sets the properties to show.- Parameters:
showProperties
- Property names to show.- Returns:
- references to self
-
getModelFilters
public java.util.Map<java.lang.String,java.lang.String[]> getModelFilters()
-
setModelFilters
public void setModelFilters(java.util.Map<java.lang.String,java.lang.String[]> filters)
-
-