Package com.blackrook.small.dispatch
Class DispatchComponent
java.lang.Object
com.blackrook.small.SmallComponent
com.blackrook.small.dispatch.DispatchComponent
- Direct Known Subclasses:
ControllerComponent
,FilterComponent
A component involved in HTTP request dispatching and handling.
- Author:
- Matthew Tropiano
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAttributeConstructor
(String attribName) Gets a method on this object that constructs an attribute.getModelConstructor
(String modelName) Gets a method on this object that constructs a model object.<T> T
getPartData
(Part part, Class<T> type) Converts a Multipart Part to a type.protected void
scanMethod
(Method method) Called to handle a single method scan for this component type.Methods inherited from class com.blackrook.small.SmallComponent
getInstance, toString
-
Constructor Details
-
DispatchComponent
-
-
Method Details
-
scanMethod
Description copied from class:SmallComponent
Called to handle a single method scan for this component type. If this method is overridden, it would be wise to callsuper.scanMethod(m)
.- Overrides:
scanMethod
in classSmallComponent
- Parameters:
method
- the method to inspect.
-
getAttributeConstructor
Gets a method on this object that constructs an attribute.- Parameters:
attribName
- the attribute name.- Returns:
- the corresponding entry point, or null if no such entry point.
-
getModelConstructor
Gets a method on this object that constructs a model object.- Parameters:
modelName
- the model attribute name.- Returns:
- the corresponding entry point, or null if no such entry point.
-
getPartData
Converts a Multipart Part to a type.- Type Parameters:
T
- the return type.- Parameters:
part
- the part to extract a value from.type
- the target type.- Returns:
- ClassCastException if a conversion cannot occur.
-