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 Class
desiredType
protected org.glassfish.hk2.api.ServiceLocator
habitat
static String
HEADER_DEBUG
static String
JSONP_CALLBACK
protected jakarta.inject.Provider<jakarta.ws.rs.core.HttpHeaders>
requestHeaders
protected jakarta.ws.rs.core.MediaType[]
supportedMediaTypes
protected 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 boolean
canShowDeprecatedItems()
returns true if the HTML viewer displays the deprecated elements or attributes of a config beanprotected boolean
canShowHiddenCommands()
returns true if the HTML viewer displays the hidden CLI command linksprotected String
getCallBackJSONP()
if a query param of name "jsoncallback" is there, returns its value or returns null otherwise.abstract String
getContent(T proxy)
protected Map<String,String>
getResourceLinks(List<Dom> proxyList)
protected Map<String,String>
getResourceLinks(Dom dom)
long
getSize(T t, Class<?> type, Type type1, Annotation[] antns, jakarta.ws.rs.core.MediaType mt)
protected String
getXmlCommandLinks(String[][] commandResourcesPaths, String indent)
protected boolean
isDebug()
check for the __debug request headerprotected boolean
isGivenTypeWritable(Class<?> type, Type genericType)
Overwrite this if you need different test of type compatibility.boolean
isWriteable(Class<?> type, Type genericType, Annotation[] antns, jakarta.ws.rs.core.MediaType mt)
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)
-
-
-
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:
isWriteable
in 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:
getSize
in 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:
writeTo
in interfacejakarta.ws.rs.ext.MessageBodyWriter<T>
- Throws:
IOException
jakarta.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)
-
-