Package com.aspectran.core.activity
Class CoreTranslet
- java.lang.Object
-
- com.aspectran.core.activity.CoreTranslet
-
- All Implemented Interfaces:
Translet,BeanRegistry,MessageSource
public class CoreTranslet extends java.lang.Object implements Translet
The Class CoreTranslet.This class is generally not thread-safe. It is primarily designed for use in a single thread only.
-
-
Constructor Summary
Constructors Constructor Description CoreTranslet(CoreActivity activity)Instantiates a new CoreTranslet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptsProfiles(java.lang.String... profiles)Return whether the given profile is active.booleancontainsBean(java.lang.Class<?> requiredType)Return whether a bean with the specified object type is present.booleancontainsBean(java.lang.String id)Return whether a bean with the specified id is present.voiddispatch(DispatchResponseRule dispatchResponseRule)Dispatch to other resources as the given rule.voiddispatch(java.lang.String name)Dispatch to other resources as the given name.voiddispatch(java.lang.String name, boolean immediately)Dispatch to other resources as the given name.voidextractAttributes(java.util.Map<java.lang.String,java.lang.Object> targetAttributes)Extracts all the attributes and fills in the specified map.voidextractParameters(java.util.Map<java.lang.String,java.lang.Object> targetParameters)Extracts all the parameters and fills in the specified map.voidforward(ForwardResponseRule forwardResponseRule)Forward according to a given rule.voidforward(java.lang.String transletName)Forward to the specified translet immediately.voidforward(java.lang.String transletName, boolean immediately)Forward to the specified translet.ActivityDataMapgetActivityDataMap()Returns an Activity Data Map containing the activity result data.ActivityDataMapgetActivityDataMap(boolean prefill)Returns an Activity Data Map containing the activity result data.<T> TgetAfterAdviceResult(java.lang.String aspectId)Gets the after advice result.java.util.Map<java.lang.String,java.lang.Object>getAllAttributes()Return a mutableMapof the request attributes, with attribute names as map keys and attribute value as map value.java.util.Map<java.lang.String,java.lang.Object>getAllParameters()Return an mutable Map of the request parameters, with parameter names as map keys and parameter values as map values.<T> TgetApplicationAdaptee()Returns the adaptee object to provide application information.ApplicationAdaptergetApplicationAdapter()Gets the application adapter.<T> TgetAroundAdviceResult(java.lang.String aspectId)Gets the around advice result.<T> TgetAspectAdviceBean(java.lang.String aspectId)Gets the aspect advice bean.<T> TgetAttribute(java.lang.String name)Returns the value of the named attribute as a given type, ornullif no attribute of the given name exists.java.util.Collection<java.lang.String>getAttributeNames()Returns aCollectioncontaining the names of the attributes available to this request.<T> TgetBean(java.lang.Class<T> requiredType)Return an instance of the bean that matches the given object type.<T> TgetBean(java.lang.Class<T> requiredType, java.lang.String id)Return an instance of the bean that matches the given object type.<T> TgetBean(java.lang.String id)Return an instance of the bean that matches the given id.<T> TgetBean(java.lang.String id, java.lang.Class<T> requiredType)Return an instance of the bean that matches the given id.<T> TgetBeforeAdviceResult(java.lang.String aspectId)Gets the before advice result.<T> TgetConfigBean(java.lang.Class<T> classType)Return the bean instance that matches the specified object type.ResponsegetDeclaredResponse()Returns the originally declared response.java.lang.StringgetDescription()Returns a description of thisTranslet.EnvironmentgetEnvironment()Returns the environment of the current activity context.FileParametergetFileParameter(java.lang.String name)Returns aFileParameterobject as a given activity's request parameter name, ornullif the parameter does not exist.java.util.Collection<java.lang.String>getFileParameterNames()Returns aCollectionofStringobjects containing the names of the file parameters contained in this request.FileParameter[]getFileParameterValues(java.lang.String name)Returns an array ofFileParameterobjects containing all of the values the given activity's request parameter has, ornullif the parameter does not exist.<T> TgetFinallyAdviceResult(java.lang.String aspectId)Gets the finally advice result.java.lang.StringgetMessage(java.lang.String code, java.lang.Object[] args)Try to resolve the message.java.lang.StringgetMessage(java.lang.String code, java.lang.Object[] args, java.lang.String defaultMessage)Try to resolve the message.java.lang.StringgetMessage(java.lang.String code, java.lang.Object[] args, java.lang.String defaultMessage, java.util.Locale locale)Try to resolve the message.java.lang.StringgetMessage(java.lang.String code, java.lang.Object[] args, java.util.Locale locale)Try to resolve the message.java.lang.StringgetName()Returns the name of thisTranslet.java.lang.StringgetParameter(java.lang.String name)Returns the value of an activity's request parameter as aString, ornullif the parameter does not exist.java.util.Collection<java.lang.String>getParameterNames()Returns aCollectionofStringobjects containing the names of the parameters contained in this request.java.lang.String[]getParameterValues(java.lang.String name)Returns an array ofStringobjects containing all of the values the given activity's request parameter has, ornullif the parameter does not exist.ProcessResultgetProcessResult()Returns the process result.java.lang.ObjectgetProcessResult(java.lang.String actionId)Returns a action result for the specified action id from the process result, ornullif the action does not exist.java.lang.ThrowablegetRaisedException()Returns the raised exception instance.<T> TgetRequestAdaptee()Returns the adaptee object to provide request information.RequestAdaptergetRequestAdapter()Gets the request adapter.java.lang.StringgetRequestEncoding()Returns the request encoding.MethodTypegetRequestMethod()Gets the request http method.<T> TgetResponseAdaptee()Returns the adaptee object to provide response information.ResponseAdaptergetResponseAdapter()Gets the response adapter.java.lang.StringgetResponseEncoding()Returns the response encoding.java.lang.ThrowablegetRootCauseOfRaisedException()Returns the innermost one of the chained (wrapped) exceptions.<T> TgetSessionAdaptee()Returns the adaptee object to provide session information.SessionAdaptergetSessionAdapter()Gets the session adapter.<T> TgetSetting(java.lang.String settingName)Gets the setting value in the translet scope.java.lang.Class<? extends CoreTranslet>getTransletImplementationClass()Returns an implementation class for theTranslet.java.lang.Class<? extends Translet>getTransletInterfaceClass()Returns an interface class for theTranslet.booleanhasPathVariable()booleanisExceptionRaised()Returns whether the exception was thrown.voidredirect(RedirectResponseRule redirectResponseRule)Redirect a client according to the given rule.voidredirect(java.lang.String path)Redirect a client to a new target resource.voidredirect(java.lang.String path, boolean immediately)Redirect a client to a new target resource.voidredirect(java.lang.String path, java.util.Map<java.lang.String,java.lang.String> parameters)Redirect to the other target resource.voidremoveAttribute(java.lang.String name)Removes an attribute from this request.voidremoveFileParameter(java.lang.String name)Removes the file parameter with the specified name.voidresponse()Respond immediately, and the remaining jobs will be canceled.voidresponse(Response response)Respond immediately, and the remaining jobs will be canceled.voidsetAttribute(java.lang.String name, java.lang.Object value)Stores an attribute in this request.voidsetFileParameter(java.lang.String name, FileParameter fileParameter)Sets theFileParameterobject to the file parameter with the given name.voidsetFileParameter(java.lang.String name, FileParameter[] fileParameters)Sets the value to the file parameter with the given name.voidsetParameter(java.lang.String name, java.lang.String value)Sets the value to the parameter with the given name.voidsetParameter(java.lang.String name, java.lang.String[] values)Sets the value to the parameter with the given name.voidsetProcessResult(ProcessResult processResult)Sets the process result.ProcessResulttouchProcessResult()Returns the ProcessResult.ProcessResulttouchProcessResult(java.lang.String contentsName)Returns the process result with the contents name.ProcessResulttouchProcessResult(java.lang.String contentsName, int initialCapacity)Returns the process result with the contents name.voidtransform(TransformRule transformRule)Transformation according to a given rule, and transmits this response.
-
-
-
Constructor Detail
-
CoreTranslet
public CoreTranslet(CoreActivity activity)
Instantiates a new CoreTranslet.- Parameters:
activity- the current Activity
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:TransletReturns the name of thisTranslet.
-
getDescription
public java.lang.String getDescription()
Description copied from interface:TransletReturns a description of thisTranslet.- Specified by:
getDescriptionin interfaceTranslet- Returns:
- a description of this
Translet
-
getRequestMethod
public MethodType getRequestMethod()
Description copied from interface:TransletGets the request http method.- Specified by:
getRequestMethodin interfaceTranslet- Returns:
- the request method
-
getEnvironment
public Environment getEnvironment()
Description copied from interface:TransletReturns the environment of the current activity context.- Specified by:
getEnvironmentin interfaceTranslet- Returns:
- the environment
-
getApplicationAdapter
public ApplicationAdapter getApplicationAdapter()
Description copied from interface:TransletGets the application adapter.- Specified by:
getApplicationAdapterin interfaceTranslet- Returns:
- the application adapter
-
getSessionAdapter
public SessionAdapter getSessionAdapter()
Description copied from interface:TransletGets the session adapter.- Specified by:
getSessionAdapterin interfaceTranslet- Returns:
- the session adapter
-
getRequestAdapter
public RequestAdapter getRequestAdapter()
Description copied from interface:TransletGets the request adapter.- Specified by:
getRequestAdapterin interfaceTranslet- Returns:
- the request adapter
-
getResponseAdapter
public ResponseAdapter getResponseAdapter()
Description copied from interface:TransletGets the response adapter.- Specified by:
getResponseAdapterin interfaceTranslet- Returns:
- the response adapter
-
getApplicationAdaptee
public <T> T getApplicationAdaptee()
Description copied from interface:TransletReturns the adaptee object to provide application information.- Specified by:
getApplicationAdapteein interfaceTranslet- Type Parameters:
T- the type of the application adaptee- Returns:
- the application adaptee object
-
getSessionAdaptee
public <T> T getSessionAdaptee()
Description copied from interface:TransletReturns the adaptee object to provide session information.- Specified by:
getSessionAdapteein interfaceTranslet- Type Parameters:
T- the type of the session adaptee- Returns:
- the session adaptee object
-
getRequestAdaptee
public <T> T getRequestAdaptee()
Description copied from interface:TransletReturns the adaptee object to provide request information.- Specified by:
getRequestAdapteein interfaceTranslet- Type Parameters:
T- the type of the request adaptee- Returns:
- the request adaptee object
-
getResponseAdaptee
public <T> T getResponseAdaptee()
Description copied from interface:TransletReturns the adaptee object to provide response information.- Specified by:
getResponseAdapteein interfaceTranslet- Type Parameters:
T- the type of the response adaptee- Returns:
- the response adaptee object
-
getRequestEncoding
public java.lang.String getRequestEncoding()
Description copied from interface:TransletReturns the request encoding.- Specified by:
getRequestEncodingin interfaceTranslet- Returns:
- the request encoding
-
getResponseEncoding
public java.lang.String getResponseEncoding()
Description copied from interface:TransletReturns the response encoding.- Specified by:
getResponseEncodingin interfaceTranslet- Returns:
- the response encoding
-
getProcessResult
public ProcessResult getProcessResult()
Description copied from interface:TransletReturns the process result.- Specified by:
getProcessResultin interfaceTranslet- Returns:
- the process result
-
getProcessResult
public java.lang.Object getProcessResult(java.lang.String actionId)
Description copied from interface:TransletReturns a action result for the specified action id from the process result, ornullif the action does not exist.- Specified by:
getProcessResultin interfaceTranslet- Parameters:
actionId- the specified action id- Returns:
- the action result
-
setProcessResult
public void setProcessResult(ProcessResult processResult)
Description copied from interface:TransletSets the process result.- Specified by:
setProcessResultin interfaceTranslet- Parameters:
processResult- the new process result
-
touchProcessResult
public ProcessResult touchProcessResult()
Description copied from interface:TransletReturns the ProcessResult. If not yet instantiated then create a new one.- Specified by:
touchProcessResultin interfaceTranslet- Returns:
- the process result
-
touchProcessResult
public ProcessResult touchProcessResult(java.lang.String contentsName)
Description copied from interface:TransletReturns the process result with the contents name. If not yet instantiated then create a new one.- Specified by:
touchProcessResultin interfaceTranslet- Parameters:
contentsName- the contents name- Returns:
- the process result
-
touchProcessResult
public ProcessResult touchProcessResult(java.lang.String contentsName, int initialCapacity)
Description copied from interface:TransletReturns the process result with the contents name. If not yet instantiated then create a new one.- Specified by:
touchProcessResultin interfaceTranslet- Parameters:
contentsName- the contents nameinitialCapacity- the initial capacity of the process result- Returns:
- the process result
-
getActivityDataMap
public ActivityDataMap getActivityDataMap()
Description copied from interface:TransletReturns an Activity Data Map containing the activity result data.- Specified by:
getActivityDataMapin interfaceTranslet- Returns:
- the activity data map
-
getActivityDataMap
public ActivityDataMap getActivityDataMap(boolean prefill)
Description copied from interface:TransletReturns an Activity Data Map containing the activity result data.- Specified by:
getActivityDataMapin interfaceTranslet- Parameters:
prefill- whether data pre-fill.- Returns:
- the activity data map
-
getSetting
public <T> T getSetting(java.lang.String settingName)
Description copied from interface:TransletGets the setting value in the translet scope.- Specified by:
getSettingin interfaceTranslet- Type Parameters:
T- the type of the value- Parameters:
settingName- the setting name- Returns:
- the setting value
-
getParameter
public java.lang.String getParameter(java.lang.String name)
Description copied from interface:TransletReturns the value of an activity's request parameter as aString, ornullif the parameter does not exist.- Specified by:
getParameterin interfaceTranslet- Parameters:
name- aStringspecifying the name of the parameter- Returns:
- a
Stringrepresenting the single value of the parameter - See Also:
Translet.getParameterValues(java.lang.String)
-
getParameterValues
public java.lang.String[] getParameterValues(java.lang.String name)
Description copied from interface:TransletReturns an array ofStringobjects containing all of the values the given activity's request parameter has, ornullif the parameter does not exist.- Specified by:
getParameterValuesin interfaceTranslet- Parameters:
name- aStringspecifying the name of the parameter- Returns:
- an array of
Stringobjects containing the parameter's values - See Also:
Translet.getParameter(java.lang.String)
-
getParameterNames
public java.util.Collection<java.lang.String> getParameterNames()
Description copied from interface:TransletReturns aCollectionofStringobjects containing the names of the parameters contained in this request. If the request has no parameters, the method returns an emptyCollection.- Specified by:
getParameterNamesin interfaceTranslet- Returns:
- an
CollectionofStringobjects, eachStringcontaining the name of a request parameter; or an emptyCollectionif the request has no parameters
-
setParameter
public void setParameter(java.lang.String name, java.lang.String value)Description copied from interface:TransletSets the value to the parameter with the given name.- Specified by:
setParameterin interfaceTranslet- Parameters:
name- aStringspecifying the name of the parametervalue- aStringrepresenting the single value of the parameter- See Also:
Translet.setParameter(String, String[])
-
setParameter
public void setParameter(java.lang.String name, java.lang.String[] values)Description copied from interface:TransletSets the value to the parameter with the given name.- Specified by:
setParameterin interfaceTranslet- Parameters:
name- aStringspecifying the name of the parametervalues- an array ofStringobjects containing the parameter's values- See Also:
Translet.setParameter(java.lang.String, java.lang.String)
-
getAllParameters
public java.util.Map<java.lang.String,java.lang.Object> getAllParameters()
Description copied from interface:TransletReturn an mutable Map of the request parameters, with parameter names as map keys and parameter values as map values. If the parameter value type is theStringthen map value will be of typeString. If the parameter value type is theStringarray then map value will be of typeStringarray.- Specified by:
getAllParametersin interfaceTranslet- Returns:
- the mutable parameter map
-
extractParameters
public void extractParameters(java.util.Map<java.lang.String,java.lang.Object> targetParameters)
Description copied from interface:TransletExtracts all the parameters and fills in the specified map.- Specified by:
extractParametersin interfaceTranslet- Parameters:
targetParameters- the target parameter map to be filled
-
getFileParameter
public FileParameter getFileParameter(java.lang.String name)
Description copied from interface:TransletReturns aFileParameterobject as a given activity's request parameter name, ornullif the parameter does not exist.- Specified by:
getFileParameterin interfaceTranslet- Parameters:
name- aStringspecifying the name of the file parameter- Returns:
- a
FileParameterrepresenting the single value of the parameter - See Also:
Translet.getFileParameterValues(java.lang.String)
-
getFileParameterValues
public FileParameter[] getFileParameterValues(java.lang.String name)
Description copied from interface:TransletReturns an array ofFileParameterobjects containing all of the values the given activity's request parameter has, ornullif the parameter does not exist.- Specified by:
getFileParameterValuesin interfaceTranslet- Parameters:
name- aStringspecifying the name of the file parameter- Returns:
- an array of
FileParameterobjects containing the parameter's values - See Also:
Translet.getFileParameter(java.lang.String)
-
getFileParameterNames
public java.util.Collection<java.lang.String> getFileParameterNames()
Description copied from interface:TransletReturns aCollectionofStringobjects containing the names of the file parameters contained in this request. If the request has no parameters, the method returns an emptyCollection.- Specified by:
getFileParameterNamesin interfaceTranslet- Returns:
- an
CollectionofStringobjects, eachStringcontaining the name of a file parameter; or an emptyCollectionif the request has no file parameters
-
setFileParameter
public void setFileParameter(java.lang.String name, FileParameter fileParameter)Description copied from interface:TransletSets theFileParameterobject to the file parameter with the given name.- Specified by:
setFileParameterin interfaceTranslet- Parameters:
name- aStringspecifying the name of the file parameterfileParameter- aFileParameterrepresenting the single value of the parameter- See Also:
Translet.setFileParameter(String, FileParameter[])
-
setFileParameter
public void setFileParameter(java.lang.String name, FileParameter[] fileParameters)Description copied from interface:TransletSets the value to the file parameter with the given name.- Specified by:
setFileParameterin interfaceTranslet- Parameters:
name- aStringspecifying the name of the file parameterfileParameters- an array ofFileParameterobjects containing the file parameter's values- See Also:
Translet.setFileParameter(java.lang.String, com.aspectran.core.activity.request.parameter.FileParameter)
-
removeFileParameter
public void removeFileParameter(java.lang.String name)
Description copied from interface:TransletRemoves the file parameter with the specified name.- Specified by:
removeFileParameterin interfaceTranslet- Parameters:
name- aStringspecifying the name of the file parameter
-
getAttribute
public <T> T getAttribute(java.lang.String name)
Description copied from interface:TransletReturns the value of the named attribute as a given type, ornullif no attribute of the given name exists.- Specified by:
getAttributein interfaceTranslet- Type Parameters:
T- the generic type- Parameters:
name- aStringspecifying the name of the attribute- Returns:
- an
Objectcontaining the value of the attribute, ornullif the attribute does not exist
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)Description copied from interface:TransletStores an attribute in this request.- Specified by:
setAttributein interfaceTranslet- Parameters:
name- specifying the name of the attributevalue- theObjectto be stored
-
getAttributeNames
public java.util.Collection<java.lang.String> getAttributeNames()
Description copied from interface:TransletReturns aCollectioncontaining the names of the attributes available to this request. This method returns an emptyCollectionif the request has no attributes available to it.- Specified by:
getAttributeNamesin interfaceTranslet- Returns:
- the attribute names
-
removeAttribute
public void removeAttribute(java.lang.String name)
Description copied from interface:TransletRemoves an attribute from this request.- Specified by:
removeAttributein interfaceTranslet- Parameters:
name- aStringspecifying the name of the attribute to remove
-
getAllAttributes
public java.util.Map<java.lang.String,java.lang.Object> getAllAttributes()
Description copied from interface:TransletReturn a mutableMapof the request attributes, with attribute names as map keys and attribute value as map value.- Specified by:
getAllAttributesin interfaceTranslet- Returns:
- the attribute map
-
extractAttributes
public void extractAttributes(java.util.Map<java.lang.String,java.lang.Object> targetAttributes)
Description copied from interface:TransletExtracts all the attributes and fills in the specified map.- Specified by:
extractAttributesin interfaceTranslet- Parameters:
targetAttributes- the attribute map
-
getDeclaredResponse
public Response getDeclaredResponse()
Description copied from interface:TransletReturns the originally declared response.- Specified by:
getDeclaredResponsein interfaceTranslet- Returns:
- the declared response
-
response
public void response()
Description copied from interface:TransletRespond immediately, and the remaining jobs will be canceled.
-
response
public void response(Response response)
Description copied from interface:TransletRespond immediately, and the remaining jobs will be canceled.
-
transform
public void transform(TransformRule transformRule)
Description copied from interface:TransletTransformation according to a given rule, and transmits this response.
-
dispatch
public void dispatch(DispatchResponseRule dispatchResponseRule)
Description copied from interface:TransletDispatch to other resources as the given rule.
-
dispatch
public void dispatch(java.lang.String name)
Description copied from interface:TransletDispatch to other resources as the given name.
-
dispatch
public void dispatch(java.lang.String name, boolean immediately)Description copied from interface:TransletDispatch to other resources as the given name.
-
redirect
public void redirect(RedirectResponseRule redirectResponseRule)
Description copied from interface:TransletRedirect a client according to the given rule.
-
redirect
public void redirect(java.lang.String path)
Description copied from interface:TransletRedirect a client to a new target resource. If an intended redirect response rule exists, that may be used.
-
redirect
public void redirect(java.lang.String path, boolean immediately)Description copied from interface:TransletRedirect a client to a new target resource. Ifimmediatelyis true, create a new redirect response rule and override the intended redirect response rule.
-
redirect
public void redirect(java.lang.String path, java.util.Map<java.lang.String,java.lang.String> parameters)Description copied from interface:TransletRedirect to the other target resource.
-
forward
public void forward(ForwardResponseRule forwardResponseRule)
Description copied from interface:TransletForward according to a given rule.
-
forward
public void forward(java.lang.String transletName)
Description copied from interface:TransletForward to the specified translet immediately.
-
forward
public void forward(java.lang.String transletName, boolean immediately)Description copied from interface:TransletForward to the specified translet.
-
isExceptionRaised
public boolean isExceptionRaised()
Description copied from interface:TransletReturns whether the exception was thrown.- Specified by:
isExceptionRaisedin interfaceTranslet- Returns:
- true, if is exception raised
-
getRaisedException
public java.lang.Throwable getRaisedException()
Description copied from interface:TransletReturns the raised exception instance.- Specified by:
getRaisedExceptionin interfaceTranslet- Returns:
- the raised exception instance
-
getRootCauseOfRaisedException
public java.lang.Throwable getRootCauseOfRaisedException()
Description copied from interface:TransletReturns the innermost one of the chained (wrapped) exceptions.- Specified by:
getRootCauseOfRaisedExceptionin interfaceTranslet- Returns:
- the innermost one of the chained (wrapped) exceptions
-
acceptsProfiles
public boolean acceptsProfiles(java.lang.String... profiles)
Description copied from interface:TransletReturn whether the given profile is active. If active profiles are empty whether the profile should be active by default.- Specified by:
acceptsProfilesin interfaceTranslet- Parameters:
profiles- the profiles- Returns:
trueif profile is active, otherwisefalse
-
getAspectAdviceBean
public <T> T getAspectAdviceBean(java.lang.String aspectId)
Description copied from interface:TransletGets the aspect advice bean.- Specified by:
getAspectAdviceBeanin interfaceTranslet- Type Parameters:
T- the generic type- Parameters:
aspectId- the aspect id- Returns:
- the aspect advice bean
-
getBeforeAdviceResult
public <T> T getBeforeAdviceResult(java.lang.String aspectId)
Description copied from interface:TransletGets the before advice result.- Specified by:
getBeforeAdviceResultin interfaceTranslet- Type Parameters:
T- the generic type- Parameters:
aspectId- the aspect id- Returns:
- the before advice result
-
getAfterAdviceResult
public <T> T getAfterAdviceResult(java.lang.String aspectId)
Description copied from interface:TransletGets the after advice result.- Specified by:
getAfterAdviceResultin interfaceTranslet- Type Parameters:
T- the generic type- Parameters:
aspectId- the aspect id- Returns:
- the after advice result
-
getAroundAdviceResult
public <T> T getAroundAdviceResult(java.lang.String aspectId)
Description copied from interface:TransletGets the around advice result.- Specified by:
getAroundAdviceResultin interfaceTranslet- Type Parameters:
T- the generic type- Parameters:
aspectId- the aspect id- Returns:
- the around advice result
-
getFinallyAdviceResult
public <T> T getFinallyAdviceResult(java.lang.String aspectId)
Description copied from interface:TransletGets the finally advice result.- Specified by:
getFinallyAdviceResultin interfaceTranslet- Type Parameters:
T- the generic type- Parameters:
aspectId- the aspect id- Returns:
- the finally advice result
-
getTransletInterfaceClass
public java.lang.Class<? extends Translet> getTransletInterfaceClass()
Description copied from interface:TransletReturns an interface class for theTranslet.- Specified by:
getTransletInterfaceClassin interfaceTranslet- Returns:
- the interface class for the translet
-
getTransletImplementationClass
public java.lang.Class<? extends CoreTranslet> getTransletImplementationClass()
Description copied from interface:TransletReturns an implementation class for theTranslet.- Specified by:
getTransletImplementationClassin interfaceTranslet- Returns:
- the implementation class for the translet
-
hasPathVariable
public boolean hasPathVariable()
- Specified by:
hasPathVariablein interfaceTranslet
-
getBean
public <T> T getBean(java.lang.String id)
Description copied from interface:BeanRegistryReturn an instance of the bean that matches the given id.- Specified by:
getBeanin interfaceBeanRegistry- Type Parameters:
T- the generic type- Parameters:
id- the id of the bean to retrieve- Returns:
- an instance of the bean
-
getBean
public <T> T getBean(java.lang.Class<T> requiredType)
Description copied from interface:BeanRegistryReturn an instance of the bean that matches the given object type.- Specified by:
getBeanin interfaceBeanRegistry- Type Parameters:
T- the generic type- Parameters:
requiredType- the type the bean must match; can be an interface or superclass.nullis disallowed.- Returns:
- an instance of the bean
-
getBean
public <T> T getBean(java.lang.String id, java.lang.Class<T> requiredType)Description copied from interface:BeanRegistryReturn an instance of the bean that matches the given id. If the bean is not of the required type then throw a BeanNotOfRequiredTypeException.- Specified by:
getBeanin interfaceBeanRegistry- Type Parameters:
T- the generic type- Parameters:
id- the id of the bean to retrieverequiredType- type the bean must match; can be an interface or superclass.nullis disallowed.- Returns:
- an instance of the bean
-
getBean
public <T> T getBean(java.lang.Class<T> requiredType, java.lang.String id)Description copied from interface:BeanRegistryReturn an instance of the bean that matches the given object type. If the bean is not exists ,retrieve the bean with the specified id.- Specified by:
getBeanin interfaceBeanRegistry- Type Parameters:
T- the generic type- Parameters:
requiredType- type the bean must match; can be an interface or superclass.nullis allowed.id- the id of the bean to retrieve; if requiredType isnull.- Returns:
- an instance of the bean
-
getConfigBean
public <T> T getConfigBean(java.lang.Class<T> classType)
Description copied from interface:BeanRegistryReturn the bean instance that matches the specified object type. If the bean is not of the required type then throw aBeanNotOfRequiredTypeException.- Specified by:
getConfigBeanin interfaceBeanRegistry- Type Parameters:
T- the generic type- Parameters:
classType- type the bean must match; can be an interface or superclass.nullis disallowed.- Returns:
- an instance of the bean
-
containsBean
public boolean containsBean(java.lang.String id)
Description copied from interface:BeanRegistryReturn whether a bean with the specified id is present.- Specified by:
containsBeanin interfaceBeanRegistry- Parameters:
id- the id of the bean to query- Returns:
- whether a bean with the specified id is present
-
containsBean
public boolean containsBean(java.lang.Class<?> requiredType)
Description copied from interface:BeanRegistryReturn whether a bean with the specified object type is present.- Specified by:
containsBeanin interfaceBeanRegistry- Parameters:
requiredType- the object type of the bean to query- Returns:
- whether a bean with the specified type is present
-
getMessage
public java.lang.String getMessage(java.lang.String code, java.lang.Object[] args, java.lang.String defaultMessage, java.util.Locale locale)Description copied from interface:MessageSourceTry to resolve the message. Return default message if no message was found.- Specified by:
getMessagein interfaceMessageSource- Parameters:
code- the code to lookup up, such as 'calculator.noRateSet'. Users of this class are encouraged to base message names on the relevant fully qualified class name, thus avoiding conflict and ensuring maximum clarity.args- array of arguments that will be filled in for params within the message (params look like "{0}", "{1,date}", "{2,time}" within a message), ornullif none.defaultMessage- String to return if the lookup failslocale- the Locale in which to do the lookup- Returns:
- the resolved message if the lookup was successful; otherwise the default message passed as a parameter
- See Also:
MessageFormat
-
getMessage
public java.lang.String getMessage(java.lang.String code, java.lang.Object[] args, java.util.Locale locale) throws NoSuchMessageExceptionDescription copied from interface:MessageSourceTry to resolve the message. Treat as an error if the message can't be found.- Specified by:
getMessagein interfaceMessageSource- Parameters:
code- the code to lookup up, such as 'calculator.noRateSet'args- Array of arguments that will be filled in for params within the message (params look like "{0}", "{1,date}", "{2,time}" within a message), ornullif none.locale- the Locale in which to do the lookup- Returns:
- the resolved message
- Throws:
NoSuchMessageException- if the message wasn't found- See Also:
MessageFormat
-
getMessage
public java.lang.String getMessage(java.lang.String code, java.lang.Object[] args, java.lang.String defaultMessage)Description copied from interface:TransletTry to resolve the message. Return default message if no message was found.- Specified by:
getMessagein interfaceTranslet- Parameters:
code- the code to lookup up, such as 'calculator.noRateSet'. Users of this class are encouraged to base message names on the relevant fully qualified class name, thus avoiding conflict and ensuring maximum clarity.args- array of arguments that will be filled in for params within the message (params look like "{0}", "{1,date}", "{2,time}" within a message), ornullif none.defaultMessage- String to return if the lookup fails- Returns:
- the resolved message if the lookup was successful; otherwise the default message passed as a parameter
- See Also:
MessageFormat
-
getMessage
public java.lang.String getMessage(java.lang.String code, java.lang.Object[] args) throws NoSuchMessageExceptionDescription copied from interface:TransletTry to resolve the message. Treat as an error if the message can't be found.- Specified by:
getMessagein interfaceTranslet- Parameters:
code- the code to lookup up, such as 'calculator.noRateSet'args- Array of arguments that will be filled in for params within the message (params look like "{0}", "{1,date}", "{2,time}" within a message), ornullif none.- Returns:
- the resolved message
- Throws:
NoSuchMessageException- if the message wasn't found- See Also:
MessageFormat
-
-