Package com.adobe.granite.rest.converter
Class ResourceConverterContext
- java.lang.Object
-
- com.adobe.granite.rest.converter.ResourceConverterContext
-
public class ResourceConverterContext extends java.lang.ObjectTheResourceConverterContextprovides context information which are necessary or useful for converting aresource.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_LIMITDefault page size limit.static booleanDEFAULT_SHOW_ALL_PROPERTIESDefault show all properties flag.static booleanDEFAULT_USE_ABSOLUTE_URISDefault 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.StringgetContextPath()Returns the portion of the request URI that indicates the context.Filter<Resource>getFilter()Returns the filter.intgetLimit()Returns the limit.java.util.Map<java.lang.String,java.lang.String[]>getModelFilters()intgetOffset()Returns the offset.java.util.Map<java.lang.String,java.lang.String[]>getParameters()Returns the request parameters.java.lang.StringgetQuery()Returns the query.RequestPathInfogetRequestPathInfo()Returns theRequestPathInfo.java.lang.StringgetRootContextPath()Get the Root Context Path Value as defined in OSGI config for ApiEndpointResourceProviderFactoryjava.lang.StringgetScheme()Returns the name of the scheme.java.lang.StringgetServerName()Returns the host name of the server.intgetServerPort()Returns the port number.java.lang.String[]getShowProperties()Retrieves the properties to show.booleanisAbsolutURI()Indicator if absolute URI's are used.booleanisShowAllProperties()Indicator if all properties should be shown.ResourceConverterContextsetAbsolutURI(boolean useAbsoluteURI)Sets the property to use absolute URI's.ResourceConverterContextsetContextPath(java.lang.String contextPath)Sets the portion of the request URI that indicates the context.ResourceConverterContextsetFilter(Filter<Resource> filter)Sets the filter.ResourceConverterContextsetLimit(int limit)Sets the limit.voidsetModelFilters(java.util.Map<java.lang.String,java.lang.String[]> filters)ResourceConverterContextsetOffset(int offset)Set the offset.ResourceConverterContextsetParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)Sets the request parameters.ResourceConverterContextsetQuery(java.lang.String query)Sets the query.ResourceConverterContextsetRequestPathInfo(RequestPathInfo requestPathInfo)Sets theRequestPathInfo.voidsetRootContextPath(java.lang.String rootContextPath)Set the root context pathResourceConverterContextsetScheme(java.lang.String scheme)Sets the name of the scheme.ResourceConverterContextsetServerName(java.lang.String serverName)Sets the host name of the server.ResourceConverterContextsetServerPort(int serverPort)Sets the port number.ResourceConverterContextsetShowAllProperties(boolean showAllProperties)Sets the property to show all properties.ResourceConverterContextsetShowProperties(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
Mapof 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:
trueif URIs are absolute,falseotherwise
-
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)
-
-