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
Constructors -
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> TgetPartData(Part part, Class<T> type) Converts a Multipart Part to a type.protected voidscanMethod(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:SmallComponentCalled to handle a single method scan for this component type. If this method is overridden, it would be wise to callsuper.scanMethod(m).- Overrides:
scanMethodin 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.
-