Package com.aspectran.core.context.rule
Class TransletRule
- java.lang.Object
-
- com.aspectran.core.context.rule.TransletRule
-
- All Implemented Interfaces:
ActionRuleApplicable
,Replicable<TransletRule>
,ResponseRuleApplicable
public class TransletRule extends java.lang.Object implements ActionRuleApplicable, ResponseRuleApplicable, Replicable<TransletRule>
The Class TransletRule.Created: 2008. 03. 22 PM 5:48:09
-
-
Constructor Summary
Constructors Constructor Description TransletRule()
Instantiates a new TransletRule.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addResponseRule(ResponseRule responseRule)
void
applyActionRule(Executable action)
Adds an executable action instance.Executable
applyActionRule(AnnotatedActionRule annotatedActionRule)
Adds the annotated method action rule.Executable
applyActionRule(ChooseRule chooseRule)
Adds a list of action instances that can be executed.Executable
applyActionRule(EchoActionRule echoActionRule)
Adds the echo action rule.Executable
applyActionRule(HeaderActionRule headerActionRule)
Adds the header action rule.Executable
applyActionRule(IncludeActionRule includeActionRule)
Adds the include action rule.Executable
applyActionRule(InvokeActionRule invokeActionRule)
Adds the invoke action rule.Response
applyResponseRule(DispatchRule dispatchRule)
Apply the dispatch rule to the response rule.Response
applyResponseRule(ForwardRule forwardRule)
Apply the forward rule to the response rule.Response
applyResponseRule(RedirectRule redirectRule)
Apply the redirect rule to the response rule.Response
applyResponseRule(TransformRule transformRule)
Apply the transform rule to the response rule.void
determineResponseRule()
MethodType[]
getAllowedMethods()
Returns the array of methods allowed on the requested resource.AspectAdviceRuleRegistry
getAspectAdviceRuleRegistry()
ContentList
getContentList()
Gets the content list.java.lang.String
getDescription()
Gets the description.ExceptionRule
getExceptionRule()
FilterParameters
getFilterParameters()
Gets the filter parameters.java.lang.String
getMaskPattern()
Gets the mask pattern.java.lang.String
getName()
Gets the translet name.WildcardPattern
getNamePattern()
Gets the name pattern.Token[]
getNameTokens()
Gets the name tokens.RequestRule
getRequestRule()
Gets the request rule.ResponseRule
getResponseRule()
Gets the response rule.java.util.List<ResponseRule>
getResponseRuleList()
java.lang.String
getScanPath()
Gets the scan path.boolean
hasPathVariables()
Returns whether the translet name has tokens for extracting parameters or attributes.static TransletRule
newInstance(java.lang.String name, MethodType[] allowedMethods)
static TransletRule
newInstance(java.lang.String name, java.lang.String method)
static TransletRule
newInstance(java.lang.String name, java.lang.String scanPath, java.lang.String maskPattern, MethodType[] allowedMethods)
static TransletRule
newInstance(java.lang.String name, java.lang.String scanPath, java.lang.String maskPattern, java.lang.String method)
TransletRule
replicate()
Creates and returns a new instance after replicating a rule or Object.static TransletRule
replicate(TransletRule transletRule)
static TransletRule
replicate(TransletRule transletRule, java.lang.String newDispatchName)
AspectAdviceRuleRegistry
replicateAspectAdviceRuleRegistry()
void
setAllowedMethods(MethodType[] allowedMethods)
Sets the array of methods allowed on the requested resource.void
setAspectAdviceRuleRegistry(AspectAdviceRuleRegistry aspectAdviceRuleRegistry)
void
setContentList(ContentList contentList)
Sets the content list.void
setDescription(java.lang.String description)
Sets the description.void
setExceptionRule(ExceptionRule exceptionRule)
void
setFilterParameters(FilterParameters filterParameters)
Sets the filter parameters.void
setMaskPattern(java.lang.String maskPattern)
Sets the mask pattern.void
setName(java.lang.String name)
Sets the name.void
setNamePattern(WildcardPattern namePattern)
Sets the name pattern.void
setNameTokens(Token[] nameTokens)
Sets the name tokens.void
setRequestRule(RequestRule requestRule)
Sets the request rule.void
setResponseRule(ResponseRule responseRule)
Sets the response rule.void
setResponseRuleList(java.util.List<ResponseRule> responseRuleList)
void
setScanPath(java.lang.String scanPath)
Sets the scan path.java.lang.String
toString()
AspectAdviceRuleRegistry
touchAspectAdviceRuleRegistry()
RequestRule
touchRequestRule(boolean explicit)
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the translet name.- Returns:
- the translet name
-
setName
public void setName(java.lang.String name)
Sets the name.- Parameters:
name
- the new name
-
getAllowedMethods
public MethodType[] getAllowedMethods()
Returns the array of methods allowed on the requested resource.- Returns:
- the allowed methods
-
setAllowedMethods
public void setAllowedMethods(MethodType[] allowedMethods)
Sets the array of methods allowed on the requested resource.- Parameters:
allowedMethods
- the allowed methods
-
getNamePattern
public WildcardPattern getNamePattern()
Gets the name pattern.- Returns:
- the name pattern
-
setNamePattern
public void setNamePattern(WildcardPattern namePattern)
Sets the name pattern.- Parameters:
namePattern
- the new name pattern
-
getNameTokens
public Token[] getNameTokens()
Gets the name tokens.- Returns:
- the name tokens
-
setNameTokens
public void setNameTokens(Token[] nameTokens)
Sets the name tokens.- Parameters:
nameTokens
- the new name tokens
-
getScanPath
public java.lang.String getScanPath()
Gets the scan path.- Returns:
- the scan path
-
setScanPath
public void setScanPath(java.lang.String scanPath)
Sets the scan path.- Parameters:
scanPath
- the new scan path
-
getMaskPattern
public java.lang.String getMaskPattern()
Gets the mask pattern.- Returns:
- the mask pattern
-
setMaskPattern
public void setMaskPattern(java.lang.String maskPattern)
Sets the mask pattern.- Parameters:
maskPattern
- the new mask pattern
-
getFilterParameters
public FilterParameters getFilterParameters()
Gets the filter parameters.- Returns:
- the filter parameters
-
setFilterParameters
public void setFilterParameters(FilterParameters filterParameters)
Sets the filter parameters.- Parameters:
filterParameters
- the new filter parameters
-
getRequestRule
public RequestRule getRequestRule()
Gets the request rule.- Returns:
- the request rule
-
setRequestRule
public void setRequestRule(RequestRule requestRule)
Sets the request rule.- Parameters:
requestRule
- the new request rule
-
touchRequestRule
public RequestRule touchRequestRule(boolean explicit)
-
getContentList
public ContentList getContentList()
Gets the content list.- Returns:
- the content list
-
setContentList
public void setContentList(ContentList contentList)
Sets the content list.- Parameters:
contentList
- the new content list
-
hasPathVariables
public boolean hasPathVariables()
Returns whether the translet name has tokens for extracting parameters or attributes.- Returns:
- true if the translet name has tokens for extracting parameters or attributes
-
applyActionRule
public Executable applyActionRule(HeaderActionRule headerActionRule)
Description copied from interface:ActionRuleApplicable
Adds the header action rule.- Specified by:
applyActionRule
in interfaceActionRuleApplicable
- Parameters:
headerActionRule
- the header action rule- Returns:
- an instance of the executable action
-
applyActionRule
public Executable applyActionRule(EchoActionRule echoActionRule)
Description copied from interface:ActionRuleApplicable
Adds the echo action rule.- Specified by:
applyActionRule
in interfaceActionRuleApplicable
- Parameters:
echoActionRule
- the echo action rule- Returns:
- an instance of the executable action
-
applyActionRule
public Executable applyActionRule(InvokeActionRule invokeActionRule)
Description copied from interface:ActionRuleApplicable
Adds the invoke action rule.- Specified by:
applyActionRule
in interfaceActionRuleApplicable
- Parameters:
invokeActionRule
- the invoke action rule- Returns:
- an instance of the executable action
-
applyActionRule
public Executable applyActionRule(AnnotatedActionRule annotatedActionRule)
Description copied from interface:ActionRuleApplicable
Adds the annotated method action rule.- Specified by:
applyActionRule
in interfaceActionRuleApplicable
- Parameters:
annotatedActionRule
- the annotated method action rule- Returns:
- an instance of the executable action
-
applyActionRule
public Executable applyActionRule(IncludeActionRule includeActionRule)
Description copied from interface:ActionRuleApplicable
Adds the include action rule.- Specified by:
applyActionRule
in interfaceActionRuleApplicable
- Parameters:
includeActionRule
- the include action rule- Returns:
- an instance of the executable action
-
applyActionRule
public Executable applyActionRule(ChooseRule chooseRule)
Description copied from interface:ActionRuleApplicable
Adds a list of action instances that can be executed.- Specified by:
applyActionRule
in interfaceActionRuleApplicable
- Parameters:
chooseRule
- the choose rule- Returns:
- an instance of the executable action
-
applyActionRule
public void applyActionRule(Executable action)
Description copied from interface:ActionRuleApplicable
Adds an executable action instance.- Specified by:
applyActionRule
in interfaceActionRuleApplicable
- Parameters:
action
- an executable action instance
-
getResponseRule
public ResponseRule getResponseRule()
Gets the response rule.- Returns:
- the response rule
-
setResponseRule
public void setResponseRule(ResponseRule responseRule)
Sets the response rule.- Parameters:
responseRule
- the new response rule
-
getResponseRuleList
public java.util.List<ResponseRule> getResponseRuleList()
-
setResponseRuleList
public void setResponseRuleList(java.util.List<ResponseRule> responseRuleList)
-
addResponseRule
public void addResponseRule(ResponseRule responseRule)
-
applyResponseRule
public Response applyResponseRule(TransformRule transformRule)
Description copied from interface:ResponseRuleApplicable
Apply the transform rule to the response rule.- Specified by:
applyResponseRule
in interfaceResponseRuleApplicable
- Parameters:
transformRule
- the transform rule- Returns:
- the response
-
applyResponseRule
public Response applyResponseRule(DispatchRule dispatchRule)
Description copied from interface:ResponseRuleApplicable
Apply the dispatch rule to the response rule.- Specified by:
applyResponseRule
in interfaceResponseRuleApplicable
- Parameters:
dispatchRule
- the dispatch rule- Returns:
- the response
-
applyResponseRule
public Response applyResponseRule(ForwardRule forwardRule)
Description copied from interface:ResponseRuleApplicable
Apply the forward rule to the response rule.- Specified by:
applyResponseRule
in interfaceResponseRuleApplicable
- Parameters:
forwardRule
- the forward rule- Returns:
- the response
-
applyResponseRule
public Response applyResponseRule(RedirectRule redirectRule)
Description copied from interface:ResponseRuleApplicable
Apply the redirect rule to the response rule.- Specified by:
applyResponseRule
in interfaceResponseRuleApplicable
- Parameters:
redirectRule
- the redirect rule- Returns:
- the response
-
determineResponseRule
public void determineResponseRule()
-
getExceptionRule
public ExceptionRule getExceptionRule()
-
setExceptionRule
public void setExceptionRule(ExceptionRule exceptionRule)
-
getAspectAdviceRuleRegistry
public AspectAdviceRuleRegistry getAspectAdviceRuleRegistry()
-
setAspectAdviceRuleRegistry
public void setAspectAdviceRuleRegistry(AspectAdviceRuleRegistry aspectAdviceRuleRegistry)
-
touchAspectAdviceRuleRegistry
public AspectAdviceRuleRegistry touchAspectAdviceRuleRegistry()
-
replicateAspectAdviceRuleRegistry
public AspectAdviceRuleRegistry replicateAspectAdviceRuleRegistry()
-
getDescription
public java.lang.String getDescription()
Gets the description.- Returns:
- the description
-
setDescription
public void setDescription(java.lang.String description)
Sets the description.- Parameters:
description
- the new description
-
replicate
public TransletRule replicate()
Description copied from interface:Replicable
Creates and returns a new instance after replicating a rule or Object.- Specified by:
replicate
in interfaceReplicable<TransletRule>
- Returns:
- replicated rule or new instance of Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
newInstance
public static TransletRule newInstance(java.lang.String name, java.lang.String scanPath, java.lang.String maskPattern, java.lang.String method) throws IllegalRuleException
- Throws:
IllegalRuleException
-
newInstance
public static TransletRule newInstance(java.lang.String name, java.lang.String scanPath, java.lang.String maskPattern, MethodType[] allowedMethods)
-
newInstance
public static TransletRule newInstance(java.lang.String name, java.lang.String method) throws IllegalRuleException
- Throws:
IllegalRuleException
-
newInstance
public static TransletRule newInstance(java.lang.String name, MethodType[] allowedMethods)
-
replicate
public static TransletRule replicate(TransletRule transletRule)
-
replicate
public static TransletRule replicate(TransletRule transletRule, java.lang.String newDispatchName)
-
-