Package com.adobe.granite.rest.converter
Class ResourceConverterContext
- java.lang.Object
-
- com.adobe.granite.rest.converter.ResourceConverterContext
-
-
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 StringgetContextPath()Returns the portion of the request URI that indicates the context.Filter<Resource>getFilter()Returns the filter.intgetLimit()Returns the limit.Map<String,String[]>getModelFilters()intgetOffset()Returns the offset.Map<String,String[]>getParameters()Returns the request parameters.StringgetQuery()Returns the query.RequestPathInfogetRequestPathInfo()Returns theRequestPathInfo.StringgetRootContextPath()Get the Root Context Path Value as defined in OSGI config for ApiEndpointResourceProviderFactoryStringgetScheme()Returns the name of the scheme.StringgetServerName()Returns the host name of the server.intgetServerPort()Returns the port number.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(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(Map<String,String[]> filters)ResourceConverterContextsetOffset(int offset)Set the offset.ResourceConverterContextsetParameters(Map<String,String[]> parameters)Sets the request parameters.ResourceConverterContextsetQuery(String query)Sets the query.ResourceConverterContextsetRequestPathInfo(RequestPathInfo requestPathInfo)Sets theRequestPathInfo.voidsetRootContextPath(String rootContextPath)Set the root context pathResourceConverterContextsetScheme(String scheme)Sets the name of the scheme.ResourceConverterContextsetServerName(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(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 String getRootContextPath()
Get the Root Context Path Value as defined in OSGI config for ApiEndpointResourceProviderFactory- Returns:
- The root context path.
-
setRootContextPath
public void setRootContextPath(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 String getScheme()
Returns the name of the scheme.- Returns:
- Scheme name
-
setScheme
public ResourceConverterContext setScheme(String scheme)
Sets the name of the scheme.- Parameters:
scheme- Scheme name- Returns:
- reference to self
-
getServerName
public String getServerName()
Returns the host name of the server.- Returns:
- Server host name
-
setServerName
public ResourceConverterContext setServerName(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 String getContextPath()
Returns the portion of the request URI that indicates the context.- Returns:
- Context path
-
setContextPath
public ResourceConverterContext setContextPath(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 Map<String,String[]> getParameters()
Returns the request parameters.- Returns:
- A
Mapof request parameter keys and values
-
setParameters
public ResourceConverterContext setParameters(Map<String,String[]> parameters)
Sets the request parameters.- Parameters:
parameters- Request parameters- Returns:
- reference to self
-
getQuery
public String getQuery()
Returns the query.- Returns:
- Query value
-
setQuery
public ResourceConverterContext setQuery(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 String[] getShowProperties()
Retrieves the properties to show.- Returns:
- A list of property names to show.
-
setShowProperties
public ResourceConverterContext setShowProperties(String[] showProperties)
Sets the properties to show.- Parameters:
showProperties- Property names to show.- Returns:
- references to self
-
-