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 voidaddResponseRule(ResponseRule responseRule)voidapplyActionRule(Executable action)Adds an executable action instance.ExecutableapplyActionRule(AnnotatedActionRule annotatedActionRule)Adds the annotated method action rule.ExecutableapplyActionRule(ChooseRule chooseRule)Adds a list of action instances that can be executed.ExecutableapplyActionRule(EchoActionRule echoActionRule)Adds the echo action rule.ExecutableapplyActionRule(HeaderActionRule headerActionRule)Adds the header action rule.ExecutableapplyActionRule(IncludeActionRule includeActionRule)Adds the include action rule.ExecutableapplyActionRule(InvokeActionRule invokeActionRule)Adds the invoke action rule.ResponseapplyResponseRule(DispatchRule dispatchRule)Apply the dispatch rule to the response rule.ResponseapplyResponseRule(ForwardRule forwardRule)Apply the forward rule to the response rule.ResponseapplyResponseRule(RedirectRule redirectRule)Apply the redirect rule to the response rule.ResponseapplyResponseRule(TransformRule transformRule)Apply the transform rule to the response rule.voiddetermineResponseRule()MethodType[]getAllowedMethods()Returns the array of methods allowed on the requested resource.AspectAdviceRuleRegistrygetAspectAdviceRuleRegistry()ContentListgetContentList()Gets the content list.java.lang.StringgetDescription()Gets the description.ExceptionRulegetExceptionRule()FilterParametersgetFilterParameters()Gets the filter parameters.java.lang.StringgetMaskPattern()Gets the mask pattern.java.lang.StringgetName()Gets the translet name.WildcardPatterngetNamePattern()Gets the name pattern.Token[]getNameTokens()Gets the name tokens.RequestRulegetRequestRule()Gets the request rule.ResponseRulegetResponseRule()Gets the response rule.java.util.List<ResponseRule>getResponseRuleList()java.lang.StringgetScanPath()Gets the scan path.booleanhasPathVariables()Returns whether the translet name has tokens for extracting parameters or attributes.static TransletRulenewInstance(java.lang.String name, MethodType[] allowedMethods)static TransletRulenewInstance(java.lang.String name, java.lang.String method)static TransletRulenewInstance(java.lang.String name, java.lang.String scanPath, java.lang.String maskPattern, MethodType[] allowedMethods)static TransletRulenewInstance(java.lang.String name, java.lang.String scanPath, java.lang.String maskPattern, java.lang.String method)TransletRulereplicate()Creates and returns a new instance after replicating a rule or Object.static TransletRulereplicate(TransletRule transletRule)static TransletRulereplicate(TransletRule transletRule, java.lang.String newDispatchName)AspectAdviceRuleRegistryreplicateAspectAdviceRuleRegistry()voidsetAllowedMethods(MethodType[] allowedMethods)Sets the array of methods allowed on the requested resource.voidsetAspectAdviceRuleRegistry(AspectAdviceRuleRegistry aspectAdviceRuleRegistry)voidsetContentList(ContentList contentList)Sets the content list.voidsetDescription(java.lang.String description)Sets the description.voidsetExceptionRule(ExceptionRule exceptionRule)voidsetFilterParameters(FilterParameters filterParameters)Sets the filter parameters.voidsetMaskPattern(java.lang.String maskPattern)Sets the mask pattern.voidsetName(java.lang.String name)Sets the name.voidsetNamePattern(WildcardPattern namePattern)Sets the name pattern.voidsetNameTokens(Token[] nameTokens)Sets the name tokens.voidsetRequestRule(RequestRule requestRule)Sets the request rule.voidsetResponseRule(ResponseRule responseRule)Sets the response rule.voidsetResponseRuleList(java.util.List<ResponseRule> responseRuleList)voidsetScanPath(java.lang.String scanPath)Sets the scan path.java.lang.StringtoString()AspectAdviceRuleRegistrytouchAspectAdviceRuleRegistry()RequestRuletouchRequestRule(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:ActionRuleApplicableAdds the header action rule.- Specified by:
applyActionRulein interfaceActionRuleApplicable- Parameters:
headerActionRule- the header action rule- Returns:
- an instance of the executable action
-
applyActionRule
public Executable applyActionRule(EchoActionRule echoActionRule)
Description copied from interface:ActionRuleApplicableAdds the echo action rule.- Specified by:
applyActionRulein interfaceActionRuleApplicable- Parameters:
echoActionRule- the echo action rule- Returns:
- an instance of the executable action
-
applyActionRule
public Executable applyActionRule(InvokeActionRule invokeActionRule)
Description copied from interface:ActionRuleApplicableAdds the invoke action rule.- Specified by:
applyActionRulein interfaceActionRuleApplicable- Parameters:
invokeActionRule- the invoke action rule- Returns:
- an instance of the executable action
-
applyActionRule
public Executable applyActionRule(AnnotatedActionRule annotatedActionRule)
Description copied from interface:ActionRuleApplicableAdds the annotated method action rule.- Specified by:
applyActionRulein 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:ActionRuleApplicableAdds the include action rule.- Specified by:
applyActionRulein interfaceActionRuleApplicable- Parameters:
includeActionRule- the include action rule- Returns:
- an instance of the executable action
-
applyActionRule
public Executable applyActionRule(ChooseRule chooseRule)
Description copied from interface:ActionRuleApplicableAdds a list of action instances that can be executed.- Specified by:
applyActionRulein interfaceActionRuleApplicable- Parameters:
chooseRule- the choose rule- Returns:
- an instance of the executable action
-
applyActionRule
public void applyActionRule(Executable action)
Description copied from interface:ActionRuleApplicableAdds an executable action instance.- Specified by:
applyActionRulein 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:ResponseRuleApplicableApply the transform rule to the response rule.- Specified by:
applyResponseRulein interfaceResponseRuleApplicable- Parameters:
transformRule- the transform rule- Returns:
- the response
-
applyResponseRule
public Response applyResponseRule(DispatchRule dispatchRule)
Description copied from interface:ResponseRuleApplicableApply the dispatch rule to the response rule.- Specified by:
applyResponseRulein interfaceResponseRuleApplicable- Parameters:
dispatchRule- the dispatch rule- Returns:
- the response
-
applyResponseRule
public Response applyResponseRule(ForwardRule forwardRule)
Description copied from interface:ResponseRuleApplicableApply the forward rule to the response rule.- Specified by:
applyResponseRulein interfaceResponseRuleApplicable- Parameters:
forwardRule- the forward rule- Returns:
- the response
-
applyResponseRule
public Response applyResponseRule(RedirectRule redirectRule)
Description copied from interface:ResponseRuleApplicableApply the redirect rule to the response rule.- Specified by:
applyResponseRulein 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:ReplicableCreates and returns a new instance after replicating a rule or Object.- Specified by:
replicatein interfaceReplicable<TransletRule>- Returns:
- replicated rule or new instance of Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin 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)
-
-