Class DispatchComponent

java.lang.Object
com.blackrook.small.SmallComponent
com.blackrook.small.dispatch.DispatchComponent
Direct Known Subclasses:
ControllerComponent, FilterComponent

public abstract class DispatchComponent extends SmallComponent
A component involved in HTTP request dispatching and handling.
Author:
Matthew Tropiano
  • Constructor Details

    • DispatchComponent

      protected DispatchComponent(Object instance)
  • Method Details

    • scanMethod

      protected void scanMethod(Method method)
      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 call super.scanMethod(m).
      Overrides:
      scanMethod in class SmallComponent
      Parameters:
      method - the method to inspect.
    • getAttributeConstructor

      public DispatchEntryPoint<?> getAttributeConstructor(String attribName)
      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

      public DispatchEntryPoint<?> getModelConstructor(String modelName)
      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

      public <T> T getPartData(Part part, Class<T> type)
      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.