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(BeanMethodActionRule beanMethodActionRule)
Adds the bean method action.void
applyActionRule(ConfigBeanMethodActionRule configBeanMethodActionRule)
Adds the config bean method action.void
applyActionRule(EchoActionRule echoActionRule)
Adds the echo action.void
applyActionRule(HeaderActionRule headerActionRule)
Adds the header action.void
applyActionRule(IncludeActionRule includeActionRule)
Adds the include action.Response
applyResponseRule(DispatchResponseRule dispatchResponseRule)
Apply the dispatch response rule to the response rule.Response
applyResponseRule(ForwardResponseRule forwardResponseRule)
Apply the forward response rule to the response rule.Response
applyResponseRule(RedirectResponseRule redirectResponseRule)
Apply the redirect response rule to the response rule.Response
applyResponseRule(TransformRule transformRule)
Apply the transform response 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.java.lang.Class<? extends CoreTranslet>
getTransletImplementationClass()
java.lang.Class<? extends Translet>
getTransletInterfaceClass()
boolean
hasPathVariable()
boolean
isExplicitContent()
Returns whether the content element is explicitly declared.boolean
isImplicitResponse()
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.void
setTransletImplementationClass(java.lang.Class<? extends CoreTranslet> transletImplementationClass)
void
setTransletInterfaceClass(java.lang.Class<? extends Translet> transletInterfaceClass)
java.lang.String
toString()
AspectAdviceRuleRegistry
touchAspectAdviceRuleRegistry()
ContentList
touchContentList()
Returns the content list.ContentList
touchContentList(boolean explicitContent, boolean omittable)
Returns the content list.RequestRule
touchRequestRule(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(BeanMethodActionRule beanMethodActionRule)
Description copied from interface:ActionRuleApplicable
Adds the bean method action.- Specified by:
applyActionRule
in interfaceActionRuleApplicable
- Parameters:
beanMethodActionRule
- the bean method action rule
-
applyActionRule
public void applyActionRule(ConfigBeanMethodActionRule configBeanMethodActionRule)
Description copied from interface:ActionRuleApplicable
Adds the config bean method action.- Specified by:
applyActionRule
in interfaceActionRuleApplicable
- Parameters:
configBeanMethodActionRule
- the config bean action rule
-
applyActionRule
public void applyActionRule(IncludeActionRule includeActionRule)
Description copied from interface:ActionRuleApplicable
Adds the include action.- Specified by:
applyActionRule
in interfaceActionRuleApplicable
- Parameters:
includeActionRule
- the include action rule
-
applyActionRule
public void applyActionRule(EchoActionRule echoActionRule)
Description copied from interface:ActionRuleApplicable
Adds the echo action.- Specified by:
applyActionRule
in interfaceActionRuleApplicable
- Parameters:
echoActionRule
- the echo action rule
-
applyActionRule
public void applyActionRule(HeaderActionRule headerActionRule)
Description copied from interface:ActionRuleApplicable
Adds the header action.- Specified by:
applyActionRule
in interfaceActionRuleApplicable
- Parameters:
headerActionRule
- the header 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:ResponseRuleApplicable
Apply the transform response rule to the response rule.- Specified by:
applyResponseRule
in interfaceResponseRuleApplicable
- Parameters:
transformRule
- the transform rule- Returns:
- the response
-
applyResponseRule
public Response applyResponseRule(DispatchResponseRule dispatchResponseRule)
Description copied from interface:ResponseRuleApplicable
Apply the dispatch response rule to the response rule.- Specified by:
applyResponseRule
in interfaceResponseRuleApplicable
- Parameters:
dispatchResponseRule
- the dispatch response rule- Returns:
- the response
-
applyResponseRule
public Response applyResponseRule(RedirectResponseRule redirectResponseRule)
Description copied from interface:ResponseRuleApplicable
Apply the redirect response rule to the response rule.- Specified by:
applyResponseRule
in interfaceResponseRuleApplicable
- Parameters:
redirectResponseRule
- the redirect response rule- Returns:
- the response
-
applyResponseRule
public Response applyResponseRule(ForwardResponseRule forwardResponseRule)
Description copied from interface:ResponseRuleApplicable
Apply the forward response rule to the response rule.- Specified by:
applyResponseRule
in 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: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)
-
-