Class BaseProvider<T>
- java.lang.Object
-
- org.glassfish.admin.rest.provider.BaseProvider<T>
-
- All Implemented Interfaces:
jakarta.ws.rs.ext.MessageBodyWriter<T>
- Direct Known Subclasses:
AbstractStaxProvider,ActionReportJsonProvider,ActionReportResultHtmlProvider,ActionReportResultJsonProvider,ActionReportResultXmlProvider,ActionReportXmlProvider,AdminCommandStateJsonProvider,CollectionWriter,GetResultListHtmlProvider,GetResultListJsonProvider,GetResultListXmlProvider,MapWriter,OptionsResultJsonProvider,OptionsResultXmlProvider,ProgressStatusEventJsonProvider,ProgressStatusJsonProvider,ResponseBodyWriter,RestCollectionProvider,RestModelWriter
@Provider public abstract class BaseProvider<T> extends Object implements jakarta.ws.rs.ext.MessageBodyWriter<T>
- Author:
- Jason Lee
-
-
Field Summary
Fields Modifier and Type Field Description protected ClassdesiredTypeprotected org.glassfish.hk2.api.ServiceLocatorhabitatstatic StringHEADER_DEBUGstatic StringJSONP_CALLBACKprotected jakarta.inject.Provider<jakarta.ws.rs.core.HttpHeaders>requestHeadersprotected jakarta.ws.rs.core.MediaType[]supportedMediaTypesprotected jakarta.inject.Provider<jakarta.ws.rs.core.UriInfo>uriInfo
-
Constructor Summary
Constructors Constructor Description BaseProvider(Class desiredType, jakarta.ws.rs.core.MediaType... mediaType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleancanShowDeprecatedItems()returns true if the HTML viewer displays the deprecated elements or attributes of a config beanprotected booleancanShowHiddenCommands()returns true if the HTML viewer displays the hidden CLI command linksprotected StringgetCallBackJSONP()if a query param of name "jsoncallback" is there, returns its value or returns null otherwise.abstract StringgetContent(T proxy)protected Map<String,String>getResourceLinks(List<Dom> proxyList)protected Map<String,String>getResourceLinks(Dom dom)longgetSize(T t, Class<?> type, Type type1, Annotation[] antns, jakarta.ws.rs.core.MediaType mt)protected StringgetXmlCommandLinks(String[][] commandResourcesPaths, String indent)protected booleanisDebug()check for the __debug request headerprotected booleanisGivenTypeWritable(Class<?> type, Type genericType)Overwrite this if you need different test of type compatibility.booleanisWriteable(Class<?> type, Type genericType, Annotation[] antns, jakarta.ws.rs.core.MediaType mt)voidwriteTo(T proxy, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)
-
-
-
Field Detail
-
HEADER_DEBUG
public static final String HEADER_DEBUG
- See Also:
- Constant Field Values
-
JSONP_CALLBACK
public static final String JSONP_CALLBACK
- See Also:
- Constant Field Values
-
uriInfo
@Context protected jakarta.inject.Provider<jakarta.ws.rs.core.UriInfo> uriInfo
-
requestHeaders
@Context protected jakarta.inject.Provider<jakarta.ws.rs.core.HttpHeaders> requestHeaders
-
habitat
@Context protected org.glassfish.hk2.api.ServiceLocator habitat
-
desiredType
protected Class desiredType
-
supportedMediaTypes
protected jakarta.ws.rs.core.MediaType[] supportedMediaTypes
-
-
Constructor Detail
-
BaseProvider
public BaseProvider(Class desiredType, jakarta.ws.rs.core.MediaType... mediaType)
-
-
Method Detail
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] antns, jakarta.ws.rs.core.MediaType mt)
- Specified by:
isWriteablein interfacejakarta.ws.rs.ext.MessageBodyWriter<T>
-
isGivenTypeWritable
protected boolean isGivenTypeWritable(Class<?> type, Type genericType)
Overwrite this if you need different test of type compatibility. Used from isWritable method.
-
getSize
public long getSize(T t, Class<?> type, Type type1, Annotation[] antns, jakarta.ws.rs.core.MediaType mt)
- Specified by:
getSizein interfacejakarta.ws.rs.ext.MessageBodyWriter<T>
-
writeTo
public void writeTo(T proxy, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream) throws IOException, jakarta.ws.rs.WebApplicationException
- Specified by:
writeToin interfacejakarta.ws.rs.ext.MessageBodyWriter<T>- Throws:
IOExceptionjakarta.ws.rs.WebApplicationException
-
canShowHiddenCommands
protected boolean canShowHiddenCommands()
returns true if the HTML viewer displays the hidden CLI command links
-
canShowDeprecatedItems
protected boolean canShowDeprecatedItems()
returns true if the HTML viewer displays the deprecated elements or attributes of a config bean
-
isDebug
protected boolean isDebug()
check for the __debug request header
-
getCallBackJSONP
protected String getCallBackJSONP()
if a query param of name "jsoncallback" is there, returns its value or returns null otherwise.
-
getXmlCommandLinks
protected String getXmlCommandLinks(String[][] commandResourcesPaths, String indent)
-
-