@ProviderType public interface PlatformConverterService
Modifier and Type | Field and Description |
---|---|
static SortOrder |
DEFAULT_SORTORDER |
static java.lang.String |
HEADER_LINK |
static java.lang.String |
JSON_NAME_CHILDREN |
static java.lang.String |
JSON_NAME_HREF |
static java.lang.String |
JSON_NAME_LINKS |
static java.lang.String |
JSON_NAME_PAGE |
static java.lang.String |
PARAM_LIMIT |
static java.lang.String |
PARAM_ORDERBY |
static java.lang.String |
PARAM_SORTORDER |
static java.lang.String |
PARAM_START |
static java.lang.String |
PROP_COUNT |
static java.lang.String |
PROP_NAME |
static java.lang.String |
PROP_NEXT |
static java.lang.String |
PROP_PAGE |
static java.lang.String |
PROP_PROPERTY |
static java.lang.String |
PROP_TYPE |
static java.lang.String |
REL_ADOBECLOUD |
static java.lang.String |
REL_ADOBECLOUD_DELETE |
static java.lang.String |
REL_ADOBECLOUD_DIRECTORY |
static java.lang.String |
REL_COLLECTION |
static java.lang.String |
REL_LATEST_VERSION |
static java.lang.String |
REL_PARENT |
static java.lang.String |
REL_SELF |
Modifier and Type | Method and Description |
---|---|
org.json.JSONArray |
buildChildren(ConverterContext context,
ModelDescription description,
HypermediaConverter converter)
Build the children JSONArray that can be added to the response body.
|
org.json.JSONObject |
buildLinksObject(ConverterContext context,
Resource resource,
ModelDescription description)
Builds the links JSONObject that can be added to the response body.
|
org.json.JSONObject |
buildPageObject(ConverterContext context,
java.lang.String nextValue,
java.lang.String resourcePath,
java.lang.String category,
int count)
Build the page JSONObject that can be added to the response body.
|
java.util.Map<java.lang.String,java.lang.Object> |
buildProps(Resource resource,
ModelDescription description,
ApiProperty.SCOPE scope)
Build a map of the properties to be serialized into the response body, filtered by the provided scope.
|
java.lang.String |
buildURL(ConverterContext context,
java.lang.String resourcePath)
Builds a URL for a resource that can be used in the response.
|
java.lang.String |
getApiPrefix(ConverterContext context,
java.lang.String category)
Get the API prefix that can be used when building URLs for API managed resources.
|
java.util.List<OrderByDetails> |
getOrderBy(HttpServletRequest request)
Get the ordering parameters from the request that will be used to build a paginated child entity list.
|
int |
getPaginationLimitValue(HttpServletRequest request)
Get the pagination limit value that will be used to build a paginated child entity list.
|
java.lang.String |
getPaginationStartValue(HttpServletRequest request)
Get the pagination start value that will be used to build a paginated child entity list.
|
void |
populateHeaders(ConverterResponseBuilder builder,
ModelDescription description)
Builds the response headers as defined in the model using the ApiHeader annotations and sets them in the response
builder.
|
void |
populateLinkHeader(ConverterResponseBuilder builder,
ConverterContext context,
Resource resource,
ModelDescription description,
ApiLink.SCOPE scope)
Builds the link header for the response based on the ApiHeader annotations in the model, filtered by the scope
parameter supplied.
|
static final java.lang.String REL_ADOBECLOUD
static final java.lang.String REL_ADOBECLOUD_DIRECTORY
static final java.lang.String REL_ADOBECLOUD_DELETE
static final java.lang.String REL_SELF
static final java.lang.String REL_PARENT
static final java.lang.String REL_LATEST_VERSION
static final java.lang.String REL_COLLECTION
static final java.lang.String HEADER_LINK
static final java.lang.String PARAM_START
static final java.lang.String PARAM_LIMIT
static final java.lang.String PARAM_ORDERBY
static final java.lang.String PARAM_SORTORDER
static final java.lang.String PROP_NEXT
static final java.lang.String PROP_PAGE
static final java.lang.String PROP_PROPERTY
static final java.lang.String PROP_TYPE
static final java.lang.String PROP_COUNT
static final java.lang.String PROP_NAME
static final java.lang.String JSON_NAME_PAGE
static final java.lang.String JSON_NAME_LINKS
static final java.lang.String JSON_NAME_CHILDREN
static final java.lang.String JSON_NAME_HREF
static final SortOrder DEFAULT_SORTORDER
void populateHeaders(ConverterResponseBuilder builder, ModelDescription description)
builder
- The ConverterResponseBuilder responsible for building the response.description
- The metadata description of the model.void populateLinkHeader(ConverterResponseBuilder builder, ConverterContext context, Resource resource, ModelDescription description, ApiLink.SCOPE scope) throws java.net.URISyntaxException, java.io.UnsupportedEncodingException
builder
- The ConverterResponseBuilder responsible for building the response.context
- The ConverterContext providing information about the request.resource
- The resource being serialized.description
- The metadata description of the model.scope
- The scope a link should satisfy in order to be serialized into the link header.java.io.UnsupportedEncodingException
- If encoding is not supported.java.net.URISyntaxException
@Nonnull org.json.JSONObject buildLinksObject(ConverterContext context, Resource resource, ModelDescription description) throws org.json.JSONException, java.net.URISyntaxException, java.io.UnsupportedEncodingException
context
- The ConverterContext providing information about the request.resource
- The resource being serialized.description
- The metadata description of the model.org.json.JSONException
- If an error occurs when creating the links object.java.net.URISyntaxException
- If an error occurs building the URL.java.io.UnsupportedEncodingException
- If encoding is not supported.@Nonnull java.util.Map<java.lang.String,java.lang.Object> buildProps(Resource resource, ModelDescription description, ApiProperty.SCOPE scope)
resource
- The resource being serialized.description
- The metadata description of the model.scope
- The scope a property should satisfy in order to be serialized into the Map.@Nonnull org.json.JSONArray buildChildren(ConverterContext context, ModelDescription description, HypermediaConverter converter)
context
- The ConverterContext providing information about the request.description
- The metadata description of the model.converter
- The HypermediaConverter to be used to render the children resources as sub entities.@CheckForNull org.json.JSONObject buildPageObject(ConverterContext context, java.lang.String nextValue, java.lang.String resourcePath, java.lang.String category, int count) throws org.json.JSONException
context
- The ConverterContext providing information about the request.nextValue
- The value to be used to get the next page.resourcePath
- The path to the resource.category
- The API category.count
- The number of resources contained in the children array.org.json.JSONException
- If an error occurs when creating the JSONObject.@Nonnull java.lang.String buildURL(ConverterContext context, java.lang.String resourcePath) throws java.net.URISyntaxException, java.io.UnsupportedEncodingException
context
- The ConverterContext providing information about the request.resourcePath
- The path to the resource.java.net.URISyntaxException
- If an error occurs building the URL.java.io.UnsupportedEncodingException
- If encoding is not supported.@Nonnull java.lang.String getApiPrefix(ConverterContext context, java.lang.String category)
context
- The ConverterContext providing information about the request.category
- The API category the resource is being managed under.@CheckForNull java.lang.String getPaginationStartValue(HttpServletRequest request)
request
- The HTTPServletRequest.int getPaginationLimitValue(HttpServletRequest request)
request
- The HTTPServletRequest.@Nonnull java.util.List<OrderByDetails> getOrderBy(HttpServletRequest request)
request
- The HTTPServletRequest.Copyright © 2010 - 2020 Adobe. All Rights Reserved