org.glassfish.admin.rest.provider
Class BaseProvider<T>

java.lang.Object
  extended by org.glassfish.admin.rest.provider.BaseProvider<T>
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<T>
Direct Known Subclasses:
ActionReportResultHtmlProvider, ActionReportResultJsonProvider, ActionReportResultXmlProvider, GetResultListHtmlProvider, GetResultListJsonProvider, GetResultListXmlProvider, OptionsResultJsonProvider, OptionsResultXmlProvider

@Provider
public abstract class BaseProvider<T>
extends java.lang.Object
implements javax.ws.rs.ext.MessageBodyWriter<T>

Author:
Jason Lee

Field Summary
protected  java.lang.Class desiredType
           
protected  org.jvnet.hk2.component.Habitat habitat
           
static java.lang.String HEADER_DEBUG
           
static java.lang.String JSONP_CALLBACK
           
protected  javax.ws.rs.core.HttpHeaders requestHeaders
           
protected  javax.ws.rs.core.MediaType supportedMediaType
           
protected  javax.ws.rs.core.UriInfo uriInfo
           
 
Constructor Summary
BaseProvider(java.lang.Class desiredType, javax.ws.rs.core.MediaType mediaType)
           
 
Method Summary
protected  boolean canShowDeprecatedItems()
           
protected  boolean canShowHiddenCommands()
           
protected  java.lang.String getCallBackJSONP()
           
abstract  java.lang.String getContent(T proxy)
           
protected  int getFormattingIndentLevel()
           
protected  java.util.Map<java.lang.String,java.lang.String> getResourceLinks(org.jvnet.hk2.config.Dom dom)
           
protected  java.util.Map<java.lang.String,java.lang.String> getResourceLinks(java.util.List<org.jvnet.hk2.config.Dom> proxyList)
           
protected  RestConfig getRestConfig()
           
 long getSize(T t, java.lang.Class<?> type, java.lang.reflect.Type type1, java.lang.annotation.Annotation[] antns, javax.ws.rs.core.MediaType mt)
           
protected  java.lang.String getXmlCommandLinks(java.lang.String[][] commandResourcesPaths, java.lang.String indent)
           
protected  boolean isDebug()
           
 boolean isWriteable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] antns, javax.ws.rs.core.MediaType mt)
           
 void writeTo(T proxy, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders, java.io.OutputStream entityStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEADER_DEBUG

public static final java.lang.String HEADER_DEBUG
See Also:
Constant Field Values

JSONP_CALLBACK

public static final java.lang.String JSONP_CALLBACK
See Also:
Constant Field Values

uriInfo

@Context
protected javax.ws.rs.core.UriInfo uriInfo

requestHeaders

@Context
protected javax.ws.rs.core.HttpHeaders requestHeaders

habitat

@Context
protected org.jvnet.hk2.component.Habitat habitat

desiredType

protected java.lang.Class desiredType

supportedMediaType

protected javax.ws.rs.core.MediaType supportedMediaType
Constructor Detail

BaseProvider

public BaseProvider(java.lang.Class desiredType,
                    javax.ws.rs.core.MediaType mediaType)
Method Detail

isWriteable

public boolean isWriteable(java.lang.Class<?> type,
                           java.lang.reflect.Type genericType,
                           java.lang.annotation.Annotation[] antns,
                           javax.ws.rs.core.MediaType mt)
Specified by:
isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<T>

getSize

public long getSize(T t,
                    java.lang.Class<?> type,
                    java.lang.reflect.Type type1,
                    java.lang.annotation.Annotation[] antns,
                    javax.ws.rs.core.MediaType mt)
Specified by:
getSize in interface javax.ws.rs.ext.MessageBodyWriter<T>

writeTo

public void writeTo(T proxy,
                    java.lang.Class<?> type,
                    java.lang.reflect.Type genericType,
                    java.lang.annotation.Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType,
                    javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders,
                    java.io.OutputStream entityStream)
             throws java.io.IOException,
                    javax.ws.rs.WebApplicationException
Specified by:
writeTo in interface javax.ws.rs.ext.MessageBodyWriter<T>
Throws:
java.io.IOException
javax.ws.rs.WebApplicationException

getContent

public abstract java.lang.String getContent(T proxy)

getFormattingIndentLevel

protected int getFormattingIndentLevel()

getRestConfig

protected RestConfig getRestConfig()

canShowHiddenCommands

protected boolean canShowHiddenCommands()

canShowDeprecatedItems

protected boolean canShowDeprecatedItems()

isDebug

protected boolean isDebug()

getCallBackJSONP

protected java.lang.String getCallBackJSONP()

getXmlCommandLinks

protected java.lang.String getXmlCommandLinks(java.lang.String[][] commandResourcesPaths,
                                              java.lang.String indent)

getResourceLinks

protected java.util.Map<java.lang.String,java.lang.String> getResourceLinks(org.jvnet.hk2.config.Dom dom)

getResourceLinks

protected java.util.Map<java.lang.String,java.lang.String> getResourceLinks(java.util.List<org.jvnet.hk2.config.Dom> proxyList)


Copyright © 2012 GlassFish Community. All Rights Reserved.