Class MethodHandler.ClassBasedMethodHandler
- java.lang.Object
-
- org.glassfish.jersey.server.model.MethodHandler
-
- org.glassfish.jersey.server.model.MethodHandler.ClassBasedMethodHandler
-
- All Implemented Interfaces:
ResourceModelComponent
- Enclosing class:
- MethodHandler
private static class MethodHandler.ClassBasedMethodHandler extends MethodHandler
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<?>
handlerClass
private java.util.List<HandlerConstructor>
handlerConstructors
-
Constructor Summary
Constructors Constructor Description ClassBasedMethodHandler(java.lang.Class<?> handlerClass, boolean disableParamDecoding, java.util.Collection<Parameter> handlerParameters)
ClassBasedMethodHandler(java.lang.Class<?> handlerClass, java.util.Collection<Parameter> handlerParameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<? extends ResourceModelComponent>
getComponents()
Should return all existing resource model sub-components.java.util.List<HandlerConstructor>
getConstructors()
Get the resource method handler constructors.java.lang.Class<?>
getHandlerClass()
Get the resource method handler class.protected java.lang.Object
getHandlerInstance()
Get the raw handler instance that is backing this method handler.java.lang.Object
getInstance(InjectionManager injectionManager)
Get the injected resource method handler instance.boolean
isClassBased()
Return whether the method handlercreates instances
based onclasses
.java.lang.String
toString()
-
-
-
Field Detail
-
handlerClass
private final java.lang.Class<?> handlerClass
-
handlerConstructors
private final java.util.List<HandlerConstructor> handlerConstructors
-
-
Constructor Detail
-
ClassBasedMethodHandler
public ClassBasedMethodHandler(java.lang.Class<?> handlerClass, java.util.Collection<Parameter> handlerParameters)
-
ClassBasedMethodHandler
public ClassBasedMethodHandler(java.lang.Class<?> handlerClass, boolean disableParamDecoding, java.util.Collection<Parameter> handlerParameters)
-
-
Method Detail
-
getHandlerClass
public java.lang.Class<?> getHandlerClass()
Description copied from class:MethodHandler
Get the resource method handler class.- Specified by:
getHandlerClass
in classMethodHandler
- Returns:
- resource method handler class.
-
getConstructors
public java.util.List<HandlerConstructor> getConstructors()
Description copied from class:MethodHandler
Get the resource method handler constructors. The returned is empty by default. Concrete implementations may override the method to return the actual list of constructors that will be used for the handler initialization.- Overrides:
getConstructors
in classMethodHandler
- Returns:
- resource method handler constructors.
-
getInstance
public java.lang.Object getInstance(InjectionManager injectionManager)
Description copied from class:MethodHandler
Get the injected resource method handler instance.- Specified by:
getInstance
in classMethodHandler
- Parameters:
injectionManager
- injection manager that can be used to inject get the instance.- Returns:
- injected resource method handler instance.
-
isClassBased
public boolean isClassBased()
Description copied from class:MethodHandler
Return whether the method handlercreates instances
based onclasses
.- Specified by:
isClassBased
in classMethodHandler
- Returns:
- True is instances returned by this method handler are created from
classes
given toInjectionManager
, false otherwise (for example when method handler was initialized from instance)
-
getHandlerInstance
protected java.lang.Object getHandlerInstance()
Description copied from class:MethodHandler
Get the raw handler instance that is backing this method handler.- Specified by:
getHandlerInstance
in classMethodHandler
- Returns:
- raw handler instance. May return
null
if the handler isclass-based
.
-
getComponents
public java.util.List<? extends ResourceModelComponent> getComponents()
Description copied from interface:ResourceModelComponent
Should return all existing resource model sub-components.- Specified by:
getComponents
in interfaceResourceModelComponent
- Overrides:
getComponents
in classMethodHandler
- Returns:
- list of all sub-components
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-