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(BeanActionRule beanActionRule)Adds the bean action.voidapplyActionRule(EchoActionRule echoActionRule)Adds the echo action.voidapplyActionRule(HeadingActionRule headingActionRule)Adds the heading action.voidapplyActionRule(IncludeActionRule includeActionRule)Adds the process-call action.voidapplyActionRule(MethodActionRule methodActionRule)Adds the method action.ResponseapplyResponseRule(DispatchResponseRule dispatchResponseRule)Apply the dispatch response rule to the response rule.ResponseapplyResponseRule(ForwardResponseRule forwardResponseRule)Apply the forward response rule to the response rule.ResponseapplyResponseRule(RedirectResponseRule redirectResponseRule)Apply the redirect response rule to the response rule.ResponseapplyResponseRule(TransformRule transformRule)Apply the transform response 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.java.lang.Class<? extends CoreTranslet>getTransletImplementationClass()java.lang.Class<? extends Translet>getTransletInterfaceClass()booleanhasPathVariable()booleanisExplicitContent()Returns whether the content element is explicitly declared.booleanisImplicitResponse()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.voidsetTransletImplementationClass(java.lang.Class<? extends CoreTranslet> transletImplementationClass)voidsetTransletInterfaceClass(java.lang.Class<? extends Translet> transletInterfaceClass)java.lang.StringtoString()AspectAdviceRuleRegistrytouchAspectAdviceRuleRegistry()ContentListtouchContentList()Returns the content list.ContentListtouchContentList(boolean explicitContent, boolean omittable)Returns the content list.RequestRuletouchRequestRule(boolean implicit)
-
-
-
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 implicit)
-
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
-
touchContentList
public ContentList touchContentList()
Returns the content list. If not yet instantiated then create a new one.- Returns:
- the content list
-
touchContentList
public ContentList touchContentList(boolean explicitContent, boolean omittable)
Returns the content list. If not yet instantiated then create a new one.- Parameters:
explicitContent- whether the content element is explicitly declaredomittable- whether the content list can be omitted- Returns:
- the content list
-
isExplicitContent
public boolean isExplicitContent()
Returns whether the content element is explicitly declared.- Returns:
- whether the content element is explicitly declared
-
hasPathVariable
public boolean hasPathVariable()
-
applyActionRule
public void applyActionRule(BeanActionRule beanActionRule)
Description copied from interface:ActionRuleApplicableAdds the bean action.- Specified by:
applyActionRulein interfaceActionRuleApplicable- Parameters:
beanActionRule- the bean action rule
-
applyActionRule
public void applyActionRule(MethodActionRule methodActionRule)
Description copied from interface:ActionRuleApplicableAdds the method action.- Specified by:
applyActionRulein interfaceActionRuleApplicable- Parameters:
methodActionRule- the bean action rule
-
applyActionRule
public void applyActionRule(IncludeActionRule includeActionRule)
Description copied from interface:ActionRuleApplicableAdds the process-call action.- Specified by:
applyActionRulein interfaceActionRuleApplicable- Parameters:
includeActionRule- the process call action rule
-
applyActionRule
public void applyActionRule(EchoActionRule echoActionRule)
Description copied from interface:ActionRuleApplicableAdds the echo action.- Specified by:
applyActionRulein interfaceActionRuleApplicable- Parameters:
echoActionRule- the echo action rule
-
applyActionRule
public void applyActionRule(HeadingActionRule headingActionRule)
Description copied from interface:ActionRuleApplicableAdds the heading action.- Specified by:
applyActionRulein interfaceActionRuleApplicable- Parameters:
headingActionRule- the heading action rule
-
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)
-
isImplicitResponse
public boolean isImplicitResponse()
-
applyResponseRule
public Response applyResponseRule(TransformRule transformRule)
Description copied from interface:ResponseRuleApplicableApply the transform response rule to the response rule.- Specified by:
applyResponseRulein interfaceResponseRuleApplicable- Parameters:
transformRule- the transform rule- Returns:
- the response
-
applyResponseRule
public Response applyResponseRule(DispatchResponseRule dispatchResponseRule)
Description copied from interface:ResponseRuleApplicableApply the dispatch response rule to the response rule.- Specified by:
applyResponseRulein interfaceResponseRuleApplicable- Parameters:
dispatchResponseRule- the dispatch response rule- Returns:
- the response
-
applyResponseRule
public Response applyResponseRule(RedirectResponseRule redirectResponseRule)
Description copied from interface:ResponseRuleApplicableApply the redirect response rule to the response rule.- Specified by:
applyResponseRulein interfaceResponseRuleApplicable- Parameters:
redirectResponseRule- the redirect response rule- Returns:
- the response
-
applyResponseRule
public Response applyResponseRule(ForwardResponseRule forwardResponseRule)
Description copied from interface:ResponseRuleApplicableApply the forward response rule to the response rule.- Specified by:
applyResponseRulein interfaceResponseRuleApplicable- Parameters:
forwardResponseRule- the forward response rule- Returns:
- the response
-
determineResponseRule
public void determineResponseRule()
-
getExceptionRule
public ExceptionRule getExceptionRule()
-
setExceptionRule
public void setExceptionRule(ExceptionRule exceptionRule)
-
getTransletInterfaceClass
public java.lang.Class<? extends Translet> getTransletInterfaceClass()
-
setTransletInterfaceClass
public void setTransletInterfaceClass(java.lang.Class<? extends Translet> transletInterfaceClass)
-
getTransletImplementationClass
public java.lang.Class<? extends CoreTranslet> getTransletImplementationClass()
-
setTransletImplementationClass
public void setTransletImplementationClass(java.lang.Class<? extends CoreTranslet> transletImplementationClass)
-
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)
-
-