Package com.aspectran.core.context.rule
Class DispatchRule
- java.lang.Object
-
- com.aspectran.core.context.rule.DispatchRule
-
- All Implemented Interfaces:
Replicable<DispatchRule>
public class DispatchRule extends java.lang.Object implements Replicable<DispatchRule>
The Class DispatchRule.Created: 2008. 03. 22 PM 5:51:58
-
-
Field Summary
Fields Modifier and Type Field Description static ResponseType
RESPONSE_TYPE
-
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 implementsViewDispatcher
.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 implementsViewDispatcher
.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 ofDispatchRule
with usedDispatcher
.
-
-
-
Field Detail
-
RESPONSE_TYPE
public static final ResponseType RESPONSE_TYPE
-
-
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 namenameTokens
- 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 implementsViewDispatcher
.- 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 implementsViewDispatcher
.- 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
-
getViewDispatcher
public ViewDispatcher getViewDispatcher()
-
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 interfaceReplicable<DispatchRule>
- Returns:
- replicated rule or new instance of Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toString
public java.lang.String toString(ViewDispatcher viewDispatcher, java.lang.String targetName)
Returns a string representation ofDispatchRule
with usedDispatcher
.- Parameters:
viewDispatcher
- the view dispatchertargetName
- 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 namedispatcherName
- the id or class name of the view dispatcher beancontentType
- the content typeencoding
- the character encodingdefaultResponse
- 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 namedispatcher
- the id or class name of the view dispatcher beancontentType
- the content typeencoding
- 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
-
-