Class DispatchRule

    • Constructor Summary

      Constructors 
      Constructor Description
      DispatchRule()  
    • Method Summary

      Modifier and Type Method Description
      java.lang.String getContentType()
      Gets the content type.
      java.lang.Boolean getDefaultResponse()
      Returns whether the default response.
      java.lang.String getDispatcherName()
      Gets the id or class name of the view dispatcher bean that implements ViewDispatcher.
      java.lang.String getEncoding()
      Gets the character encoding.
      java.lang.String getName()
      Gets the dispatch name.
      java.lang.String getName​(Activity activity)
      Gets the dispatch name.
      Token[] getNameTokens()
      Gets the tokens of the dispatch name.
      ViewDispatcher getViewDispatcher()  
      boolean isDefaultResponse()
      Returns whether the default response.
      static DispatchRule newInstance​(java.lang.String name)
      Returns a new instance of DispatchRule.
      static DispatchRule newInstance​(java.lang.String name, java.lang.String dispatcher, java.lang.String contentType, java.lang.String encoding)
      Returns a new instance of DispatchRule.
      static DispatchRule newInstance​(java.lang.String name, java.lang.String dispatcherName, java.lang.String contentType, java.lang.String encoding, java.lang.Boolean defaultResponse)
      Returns a new instance of DispatchRule.
      DispatchRule replicate()
      Creates and returns a new instance after replicating a rule or Object.
      static DispatchRule replicate​(DispatchRule dispatchRule)
      Returns a new derived instance of DispatchRule.
      void setContentType​(java.lang.String contentType)
      Sets the content type.
      void setDefaultResponse​(java.lang.Boolean defaultResponse)
      Sets whether the default response.
      void setDispatcherName​(java.lang.String dispatcherName)
      Gets the id or class name of the view dispatcher bean that implements ViewDispatcher.
      void setEncoding​(java.lang.String encoding)
      Sets the character encoding.
      void setName​(java.lang.String name)
      Sets the dispatch name.
      void setName​(java.lang.String name, Token[] nameTokens)
      Sets the dispatch name and its name tokens.
      void setViewDispatcher​(ViewDispatcher viewDispatcher)  
      java.lang.String toString()  
      java.lang.String toString​(ViewDispatcher viewDispatcher, java.lang.String targetName)
      Returns a string representation of DispatchRule with used Dispatcher.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • RESPONSE_TYPE

        public static final ResponseType RESPONSE_TYPE
    • Constructor Detail

      • DispatchRule

        public DispatchRule()
    • Method Detail

      • getName

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

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

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

        public void setName​(java.lang.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 java.lang.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​(java.lang.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 java.lang.String getContentType()
        Gets the content type.
        Returns:
        the content type
      • setContentType

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

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

        public void setEncoding​(java.lang.String encoding)
        Sets the character encoding.
        Parameters:
        encoding - the character encoding to set
      • setViewDispatcher

        public void setViewDispatcher​(ViewDispatcher viewDispatcher)
      • getDefaultResponse

        public java.lang.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​(java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toString

        public java.lang.String toString​(ViewDispatcher viewDispatcher,
                                         java.lang.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

        public static DispatchRule newInstance​(java.lang.String name,
                                               java.lang.String dispatcherName,
                                               java.lang.String contentType,
                                               java.lang.String encoding,
                                               java.lang.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

        public static DispatchRule newInstance​(java.lang.String name,
                                               java.lang.String dispatcher,
                                               java.lang.String contentType,
                                               java.lang.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

        public static DispatchRule newInstance​(java.lang.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

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