public class EntityExpansionUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
EXPAND_PARAM
Name of the expand query parameter.
|
Modifier and Type | Method and Description |
---|---|
static com.atlassian.plugins.rest.common.expand.parameter.ExpandParameter |
getExpandParameter(javax.servlet.http.HttpServletRequest request)
Returns a ExpandParameter representing the expand query parameter from an HttpServletRequest.
|
static boolean |
shouldExpandField(Class clazz,
String fieldName,
com.atlassian.plugins.rest.common.expand.parameter.ExpandParameter expandParameter)
Returns whether a field of the specified entity class should be expanded.
|
static boolean |
shouldExpandField(Class clazz,
String fieldName,
javax.servlet.http.HttpServletRequest request)
Returns whether a field of the specified entity class should be expanded.
|
public static final String EXPAND_PARAM
public static boolean shouldExpandField(Class clazz, String fieldName, javax.servlet.http.HttpServletRequest request)
E.g. a client may perform a request to /user?expand=attributes which instructs the server to expand the attributes field of the user entity.
clazz
- the class of the field to check for expansion.fieldName
- name of the field to check for expansion.request
- HttpServletRequest to extract the expand query param from.public static boolean shouldExpandField(Class clazz, String fieldName, com.atlassian.plugins.rest.common.expand.parameter.ExpandParameter expandParameter)
shouldExpandField(Class, String, HttpServletRequest)
to extract the expand query
parameter from a HttpServletRequest.clazz
- the class of the field to check for expansion.fieldName
- name of the field to check for expansion.expandParameter
- ExpandParameter to check for expansion.IllegalArgumentException
- if the field name could not be found in the class.public static com.atlassian.plugins.rest.common.expand.parameter.ExpandParameter getExpandParameter(javax.servlet.http.HttpServletRequest request)
request
- HttpServletRequest.Copyright © 2021 Atlassian. All rights reserved.