Class DispatchRule

java.lang.Object
com.aspectran.core.context.rule.DispatchRule
All Implemented Interfaces:
Replicable<DispatchRule>

public class DispatchRule extends Object implements Replicable<DispatchRule>
The Class DispatchRule.

Created: 2008. 03. 22 PM 5:51:58

  • Field Details

    • RESPONSE_TYPE

      public static final ResponseType RESPONSE_TYPE
  • Constructor Details

    • DispatchRule

      public DispatchRule()
  • Method Details

    • getName

      public String getName()
      Gets the dispatch name.
      Returns:
      the dispatch name
    • getName

      public String getName(Activity activity)
      Gets the dispatch name.
      Parameters:
      activity - the activity
      Returns:
      the dispatch name
    • setName

      public void setName(String name)
      Sets the dispatch name.
      Parameters:
      name - the new dispatch name
    • setName

      public void setName(String name, Token[] nameTokens)
      Sets the dispatch name and its name tokens.
      Parameters:
      name - the new dispatch name
      nameTokens - the name tokens
    • getNameTokens

      public Token[] getNameTokens()
      Gets the tokens of the dispatch name.
      Returns:
      the tokens of the dispatch name
    • getDispatcherName

      public String getDispatcherName()
      Gets the id or class name of the view dispatcher bean that implements ViewDispatcher.
      Returns:
      the id or class name of the view dispatcher bean
    • setDispatcherName

      public void setDispatcherName(String dispatcherName)
      Gets the id or class name of the view dispatcher bean that implements ViewDispatcher.
      Parameters:
      dispatcherName - the id or class name of the view dispatcher bean
    • getContentType

      public String getContentType()
      Gets the content type.
      Returns:
      the content type
    • setContentType

      public void setContentType(String contentType)
      Sets the content type.
      Parameters:
      contentType - the new content type
    • getEncoding

      public String getEncoding()
      Gets the character encoding.
      Returns:
      the character encoding
    • setEncoding

      public void setEncoding(String encoding)
      Sets the character encoding.
      Parameters:
      encoding - the character encoding to set
    • getViewDispatcher

      public ViewDispatcher getViewDispatcher()
    • setViewDispatcher

      public void setViewDispatcher(ViewDispatcher viewDispatcher)
    • getDefaultResponse

      public Boolean getDefaultResponse()
      Returns whether the default response.
      Returns:
      whether the default response
    • isDefaultResponse

      public boolean isDefaultResponse()
      Returns whether the default response.
      Returns:
      true, if is default response
    • setDefaultResponse

      public void setDefaultResponse(Boolean defaultResponse)
      Sets whether the default response.
      Parameters:
      defaultResponse - whether the default response
    • replicate

      public DispatchRule replicate()
      Description copied from interface: Replicable
      Creates and returns a new instance after replicating a rule or Object.
      Specified by:
      replicate in interface Replicable<DispatchRule>
      Returns:
      replicated rule or new instance of Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(ViewDispatcher viewDispatcher, String targetName)
      Returns a string representation of DispatchRule with used Dispatcher.
      Parameters:
      viewDispatcher - the view dispatcher
      targetName - the new dispatch name
      Returns:
      a string representation of DispatchRule.
    • newInstance

      @NonNull public static DispatchRule newInstance(String name, String dispatcherName, String contentType, String encoding, Boolean defaultResponse) throws IllegalRuleException
      Returns a new instance of DispatchRule.
      Parameters:
      name - the dispatch name
      dispatcherName - the id or class name of the view dispatcher bean
      contentType - the content type
      encoding - the character encoding
      defaultResponse - whether it is the default response
      Returns:
      an instance of DispatchRule
      Throws:
      IllegalRuleException - if an illegal rule is found
    • newInstance

      @NonNull public static DispatchRule newInstance(String name, String dispatcher, String contentType, String encoding) throws IllegalRuleException
      Returns a new instance of DispatchRule.
      Parameters:
      name - the dispatch name
      dispatcher - the id or class name of the view dispatcher bean
      contentType - the content type
      encoding - the character encoding
      Returns:
      the dispatch rule
      Throws:
      IllegalRuleException - if an illegal rule is found
    • newInstance

      @NonNull public static DispatchRule newInstance(String name) throws IllegalRuleException
      Returns a new instance of DispatchRule.
      Parameters:
      name - the dispatch name
      Returns:
      the dispatch rule
      Throws:
      IllegalRuleException - if an illegal rule is found
    • replicate

      @NonNull public static DispatchRule replicate(@NonNull DispatchRule dispatchRule)
      Returns a new derived instance of DispatchRule.
      Parameters:
      dispatchRule - an instance of DispatchRule
      Returns:
      the dispatch rule