Class 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
      boolean acceptsProfiles​(java.lang.String... profiles)
      Return whether the given profile is active.
      boolean containsBean​(java.lang.Class<?> requiredType)
      Return whether a bean with the specified object type is present.
      boolean containsBean​(java.lang.String id)
      Return whether a bean with the specified id is present.
      void dispatch​(DispatchResponseRule dispatchResponseRule)
      Dispatch to other resources as the given rule.
      void dispatch​(java.lang.String name)
      Dispatch to other resources as the given name.
      void dispatch​(java.lang.String name, boolean immediately)
      Dispatch to other resources as the given name.
      void extractAttributes​(java.util.Map<java.lang.String,java.lang.Object> targetAttributes)
      Extracts all the attributes and fills in the specified map.
      void extractParameters​(java.util.Map<java.lang.String,java.lang.Object> targetParameters)
      Extracts all the parameters and fills in the specified map.
      void forward​(ForwardResponseRule forwardResponseRule)
      Forward according to a given rule.
      void forward​(java.lang.String transletName)
      Forward to the specified translet immediately.
      void forward​(java.lang.String transletName, boolean immediately)
      Forward to the specified translet.
      ActivityDataMap getActivityDataMap()
      Returns an Activity Data Map containing the activity result data.
      ActivityDataMap getActivityDataMap​(boolean prefill)
      Returns an Activity Data Map containing the activity result data.
      <T> T getAfterAdviceResult​(java.lang.String aspectId)
      Gets the after advice result.
      java.util.Map<java.lang.String,java.lang.Object> getAllAttributes()
      Return a mutable Map of 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> T getApplicationAdaptee()
      Returns the adaptee object to provide application information.
      ApplicationAdapter getApplicationAdapter()
      Gets the application adapter.
      <T> T getAroundAdviceResult​(java.lang.String aspectId)
      Gets the around advice result.
      <T> T getAspectAdviceBean​(java.lang.String aspectId)
      Gets the aspect advice bean.
      <T> T getAttribute​(java.lang.String name)
      Returns the value of the named attribute as a given type, or null if no attribute of the given name exists.
      java.util.Collection<java.lang.String> getAttributeNames()
      Returns a Collection containing the names of the attributes available to this request.
      <T> T getBean​(java.lang.Class<T> requiredType)
      Return an instance of the bean that matches the given object type.
      <T> T getBean​(java.lang.Class<T> requiredType, java.lang.String id)
      Return an instance of the bean that matches the given object type.
      <T> T getBean​(java.lang.String id)
      Return an instance of the bean that matches the given id.
      <T> T getBean​(java.lang.String id, java.lang.Class<T> requiredType)
      Return an instance of the bean that matches the given id.
      <T> T getBeforeAdviceResult​(java.lang.String aspectId)
      Gets the before advice result.
      <T> T getConfigBean​(java.lang.Class<T> classType)
      Return the bean instance that matches the specified object type.
      Response getDeclaredResponse()
      Returns the originally declared response.
      java.lang.String getDescription()
      Returns a description of this Translet.
      Environment getEnvironment()
      Returns the environment of the current activity context.
      FileParameter getFileParameter​(java.lang.String name)
      Returns a FileParameter object as a given activity's request parameter name, or null if the parameter does not exist.
      java.util.Collection<java.lang.String> getFileParameterNames()
      Returns a Collection of String objects containing the names of the file parameters contained in this request.
      FileParameter[] getFileParameterValues​(java.lang.String name)
      Returns an array of FileParameter objects containing all of the values the given activity's request parameter has, or null if the parameter does not exist.
      <T> T getFinallyAdviceResult​(java.lang.String aspectId)
      Gets the finally advice result.
      java.lang.String getMessage​(java.lang.String code, java.lang.Object[] args)
      Try to resolve the message.
      java.lang.String getMessage​(java.lang.String code, java.lang.Object[] args, java.lang.String defaultMessage)
      Try to resolve the message.
      java.lang.String getMessage​(java.lang.String code, java.lang.Object[] args, java.lang.String defaultMessage, java.util.Locale locale)
      Try to resolve the message.
      java.lang.String getMessage​(java.lang.String code, java.lang.Object[] args, java.util.Locale locale)
      Try to resolve the message.
      java.lang.String getName()
      Returns the name of this Translet.
      java.lang.String getParameter​(java.lang.String name)
      Returns the value of an activity's request parameter as a String, or null if the parameter does not exist.
      java.util.Collection<java.lang.String> getParameterNames()
      Returns a Collection of String objects containing the names of the parameters contained in this request.
      java.lang.String[] getParameterValues​(java.lang.String name)
      Returns an array of String objects containing all of the values the given activity's request parameter has, or null if the parameter does not exist.
      ProcessResult getProcessResult()
      Returns the process result.
      java.lang.Object getProcessResult​(java.lang.String actionId)
      Returns a action result for the specified action id from the process result, or null if the action does not exist.
      java.lang.Throwable getRaisedException()
      Returns the raised exception instance.
      <T> T getRequestAdaptee()
      Returns the adaptee object to provide request information.
      RequestAdapter getRequestAdapter()
      Gets the request adapter.
      java.lang.String getRequestEncoding()
      Returns the request encoding.
      MethodType getRequestMethod()
      Gets the request http method.
      <T> T getResponseAdaptee()
      Returns the adaptee object to provide response information.
      ResponseAdapter getResponseAdapter()
      Gets the response adapter.
      java.lang.String getResponseEncoding()
      Returns the response encoding.
      java.lang.Throwable getRootCauseOfRaisedException()
      Returns the innermost one of the chained (wrapped) exceptions.
      <T> T getSessionAdaptee()
      Returns the adaptee object to provide session information.
      SessionAdapter getSessionAdapter()
      Gets the session adapter.
      <T> T getSetting​(java.lang.String settingName)
      Gets the setting value in the translet scope.
      java.lang.Class<? extends CoreTranslet> getTransletImplementationClass()
      Returns an implementation class for the Translet.
      java.lang.Class<? extends Translet> getTransletInterfaceClass()
      Returns an interface class for the Translet.
      boolean hasPathVariable()  
      boolean isExceptionRaised()
      Returns whether the exception was thrown.
      void redirect​(RedirectResponseRule redirectResponseRule)
      Redirect a client according to the given rule.
      void redirect​(java.lang.String path)
      Redirect a client to a new target resource.
      void redirect​(java.lang.String path, boolean immediately)
      Redirect a client to a new target resource.
      void redirect​(java.lang.String path, java.util.Map<java.lang.String,java.lang.String> parameters)
      Redirect to the other target resource.
      void removeAttribute​(java.lang.String name)
      Removes an attribute from this request.
      void removeFileParameter​(java.lang.String name)
      Removes the file parameter with the specified name.
      void response()
      Respond immediately, and the remaining jobs will be canceled.
      void response​(Response response)
      Respond immediately, and the remaining jobs will be canceled.
      void setAttribute​(java.lang.String name, java.lang.Object value)
      Stores an attribute in this request.
      void setFileParameter​(java.lang.String name, FileParameter fileParameter)
      Sets the FileParameter object to the file parameter with the given name.
      void setFileParameter​(java.lang.String name, FileParameter[] fileParameters)
      Sets the value to the file parameter with the given name.
      void setParameter​(java.lang.String name, java.lang.String value)
      Sets the value to the parameter with the given name.
      void setParameter​(java.lang.String name, java.lang.String[] values)
      Sets the value to the parameter with the given name.
      void setProcessResult​(ProcessResult processResult)
      Sets the process result.
      ProcessResult touchProcessResult()
      Returns the ProcessResult.
      ProcessResult touchProcessResult​(java.lang.String contentsName)
      Returns the process result with the contents name.
      ProcessResult touchProcessResult​(java.lang.String contentsName, int initialCapacity)
      Returns the process result with the contents name.
      void transform​(TransformRule transformRule)
      Transformation according to a given rule, and transmits this response.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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: Translet
        Returns the name of this Translet.
        Specified by:
        getName in interface Translet
        Returns:
        the translet name
      • getDescription

        public java.lang.String getDescription()
        Description copied from interface: Translet
        Returns a description of this Translet.
        Specified by:
        getDescription in interface Translet
        Returns:
        a description of this Translet
      • getRequestMethod

        public MethodType getRequestMethod()
        Description copied from interface: Translet
        Gets the request http method.
        Specified by:
        getRequestMethod in interface Translet
        Returns:
        the request method
      • getEnvironment

        public Environment getEnvironment()
        Description copied from interface: Translet
        Returns the environment of the current activity context.
        Specified by:
        getEnvironment in interface Translet
        Returns:
        the environment
      • getApplicationAdaptee

        public <T> T getApplicationAdaptee()
        Description copied from interface: Translet
        Returns the adaptee object to provide application information.
        Specified by:
        getApplicationAdaptee in interface Translet
        Type Parameters:
        T - the type of the application adaptee
        Returns:
        the application adaptee object
      • getSessionAdaptee

        public <T> T getSessionAdaptee()
        Description copied from interface: Translet
        Returns the adaptee object to provide session information.
        Specified by:
        getSessionAdaptee in interface Translet
        Type Parameters:
        T - the type of the session adaptee
        Returns:
        the session adaptee object
      • getRequestAdaptee

        public <T> T getRequestAdaptee()
        Description copied from interface: Translet
        Returns the adaptee object to provide request information.
        Specified by:
        getRequestAdaptee in interface Translet
        Type Parameters:
        T - the type of the request adaptee
        Returns:
        the request adaptee object
      • getResponseAdaptee

        public <T> T getResponseAdaptee()
        Description copied from interface: Translet
        Returns the adaptee object to provide response information.
        Specified by:
        getResponseAdaptee in interface Translet
        Type Parameters:
        T - the type of the response adaptee
        Returns:
        the response adaptee object
      • getRequestEncoding

        public java.lang.String getRequestEncoding()
        Description copied from interface: Translet
        Returns the request encoding.
        Specified by:
        getRequestEncoding in interface Translet
        Returns:
        the request encoding
      • getResponseEncoding

        public java.lang.String getResponseEncoding()
        Description copied from interface: Translet
        Returns the response encoding.
        Specified by:
        getResponseEncoding in interface Translet
        Returns:
        the response encoding
      • getProcessResult

        public java.lang.Object getProcessResult​(java.lang.String actionId)
        Description copied from interface: Translet
        Returns a action result for the specified action id from the process result, or null if the action does not exist.
        Specified by:
        getProcessResult in interface Translet
        Parameters:
        actionId - the specified action id
        Returns:
        the action result
      • setProcessResult

        public void setProcessResult​(ProcessResult processResult)
        Description copied from interface: Translet
        Sets the process result.
        Specified by:
        setProcessResult in interface Translet
        Parameters:
        processResult - the new process result
      • touchProcessResult

        public ProcessResult touchProcessResult()
        Description copied from interface: Translet
        Returns the ProcessResult. If not yet instantiated then create a new one.
        Specified by:
        touchProcessResult in interface Translet
        Returns:
        the process result
      • touchProcessResult

        public ProcessResult touchProcessResult​(java.lang.String contentsName)
        Description copied from interface: Translet
        Returns the process result with the contents name. If not yet instantiated then create a new one.
        Specified by:
        touchProcessResult in interface Translet
        Parameters:
        contentsName - the contents name
        Returns:
        the process result
      • touchProcessResult

        public ProcessResult touchProcessResult​(java.lang.String contentsName,
                                                int initialCapacity)
        Description copied from interface: Translet
        Returns the process result with the contents name. If not yet instantiated then create a new one.
        Specified by:
        touchProcessResult in interface Translet
        Parameters:
        contentsName - the contents name
        initialCapacity - the initial capacity of the process result
        Returns:
        the process result
      • getActivityDataMap

        public ActivityDataMap getActivityDataMap()
        Description copied from interface: Translet
        Returns an Activity Data Map containing the activity result data.
        Specified by:
        getActivityDataMap in interface Translet
        Returns:
        the activity data map
      • getActivityDataMap

        public ActivityDataMap getActivityDataMap​(boolean prefill)
        Description copied from interface: Translet
        Returns an Activity Data Map containing the activity result data.
        Specified by:
        getActivityDataMap in interface Translet
        Parameters:
        prefill - whether data pre-fill.
        Returns:
        the activity data map
      • getSetting

        public <T> T getSetting​(java.lang.String settingName)
        Description copied from interface: Translet
        Gets the setting value in the translet scope.
        Specified by:
        getSetting in interface Translet
        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: Translet
        Returns the value of an activity's request parameter as a String, or null if the parameter does not exist.
        Specified by:
        getParameter in interface Translet
        Parameters:
        name - a String specifying the name of the parameter
        Returns:
        a String representing 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: Translet
        Returns an array of String objects containing all of the values the given activity's request parameter has, or null if the parameter does not exist.
        Specified by:
        getParameterValues in interface Translet
        Parameters:
        name - a String specifying the name of the parameter
        Returns:
        an array of String objects 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: Translet
        Returns a Collection of String objects containing the names of the parameters contained in this request. If the request has no parameters, the method returns an empty Collection.
        Specified by:
        getParameterNames in interface Translet
        Returns:
        an Collection of String objects, each String containing the name of a request parameter; or an empty Collection if the request has no parameters
      • setParameter

        public void setParameter​(java.lang.String name,
                                 java.lang.String value)
        Description copied from interface: Translet
        Sets the value to the parameter with the given name.
        Specified by:
        setParameter in interface Translet
        Parameters:
        name - a String specifying the name of the parameter
        value - a String representing 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: Translet
        Sets the value to the parameter with the given name.
        Specified by:
        setParameter in interface Translet
        Parameters:
        name - a String specifying the name of the parameter
        values - an array of String objects 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: Translet
        Return 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 the String then map value will be of type String. If the parameter value type is the String array then map value will be of type String array.
        Specified by:
        getAllParameters in interface Translet
        Returns:
        the mutable parameter map
      • extractParameters

        public void extractParameters​(java.util.Map<java.lang.String,java.lang.Object> targetParameters)
        Description copied from interface: Translet
        Extracts all the parameters and fills in the specified map.
        Specified by:
        extractParameters in interface Translet
        Parameters:
        targetParameters - the target parameter map to be filled
      • getFileParameter

        public FileParameter getFileParameter​(java.lang.String name)
        Description copied from interface: Translet
        Returns a FileParameter object as a given activity's request parameter name, or null if the parameter does not exist.
        Specified by:
        getFileParameter in interface Translet
        Parameters:
        name - a String specifying the name of the file parameter
        Returns:
        a FileParameter representing 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: Translet
        Returns an array of FileParameter objects containing all of the values the given activity's request parameter has, or null if the parameter does not exist.
        Specified by:
        getFileParameterValues in interface Translet
        Parameters:
        name - a String specifying the name of the file parameter
        Returns:
        an array of FileParameter objects 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: Translet
        Returns a Collection of String objects containing the names of the file parameters contained in this request. If the request has no parameters, the method returns an empty Collection.
        Specified by:
        getFileParameterNames in interface Translet
        Returns:
        an Collection of String objects, each String containing the name of a file parameter; or an empty Collection if the request has no file parameters
      • setFileParameter

        public void setFileParameter​(java.lang.String name,
                                     FileParameter fileParameter)
        Description copied from interface: Translet
        Sets the FileParameter object to the file parameter with the given name.
        Specified by:
        setFileParameter in interface Translet
        Parameters:
        name - a String specifying the name of the file parameter
        fileParameter - a FileParameter representing the single value of the parameter
        See Also:
        Translet.setFileParameter(String, FileParameter[])
      • removeFileParameter

        public void removeFileParameter​(java.lang.String name)
        Description copied from interface: Translet
        Removes the file parameter with the specified name.
        Specified by:
        removeFileParameter in interface Translet
        Parameters:
        name - a String specifying the name of the file parameter
      • getAttribute

        public <T> T getAttribute​(java.lang.String name)
        Description copied from interface: Translet
        Returns the value of the named attribute as a given type, or null if no attribute of the given name exists.
        Specified by:
        getAttribute in interface Translet
        Type Parameters:
        T - the generic type
        Parameters:
        name - a String specifying the name of the attribute
        Returns:
        an Object containing the value of the attribute, or null if the attribute does not exist
      • setAttribute

        public void setAttribute​(java.lang.String name,
                                 java.lang.Object value)
        Description copied from interface: Translet
        Stores an attribute in this request.
        Specified by:
        setAttribute in interface Translet
        Parameters:
        name - specifying the name of the attribute
        value - the Object to be stored
      • getAttributeNames

        public java.util.Collection<java.lang.String> getAttributeNames()
        Description copied from interface: Translet
        Returns a Collection containing the names of the attributes available to this request. This method returns an empty Collection if the request has no attributes available to it.
        Specified by:
        getAttributeNames in interface Translet
        Returns:
        the attribute names
      • removeAttribute

        public void removeAttribute​(java.lang.String name)
        Description copied from interface: Translet
        Removes an attribute from this request.
        Specified by:
        removeAttribute in interface Translet
        Parameters:
        name - a String specifying the name of the attribute to remove
      • getAllAttributes

        public java.util.Map<java.lang.String,java.lang.Object> getAllAttributes()
        Description copied from interface: Translet
        Return a mutable Map of the request attributes, with attribute names as map keys and attribute value as map value.
        Specified by:
        getAllAttributes in interface Translet
        Returns:
        the attribute map
      • extractAttributes

        public void extractAttributes​(java.util.Map<java.lang.String,java.lang.Object> targetAttributes)
        Description copied from interface: Translet
        Extracts all the attributes and fills in the specified map.
        Specified by:
        extractAttributes in interface Translet
        Parameters:
        targetAttributes - the attribute map
      • getDeclaredResponse

        public Response getDeclaredResponse()
        Description copied from interface: Translet
        Returns the originally declared response.
        Specified by:
        getDeclaredResponse in interface Translet
        Returns:
        the declared response
      • response

        public void response()
        Description copied from interface: Translet
        Respond immediately, and the remaining jobs will be canceled.
        Specified by:
        response in interface Translet
      • response

        public void response​(Response response)
        Description copied from interface: Translet
        Respond immediately, and the remaining jobs will be canceled.
        Specified by:
        response in interface Translet
        Parameters:
        response - the response
      • transform

        public void transform​(TransformRule transformRule)
        Description copied from interface: Translet
        Transformation according to a given rule, and transmits this response.
        Specified by:
        transform in interface Translet
        Parameters:
        transformRule - the transformation rule
      • dispatch

        public void dispatch​(DispatchResponseRule dispatchResponseRule)
        Description copied from interface: Translet
        Dispatch to other resources as the given rule.
        Specified by:
        dispatch in interface Translet
        Parameters:
        dispatchResponseRule - the dispatch response rule
      • dispatch

        public void dispatch​(java.lang.String name)
        Description copied from interface: Translet
        Dispatch to other resources as the given name.
        Specified by:
        dispatch in interface Translet
        Parameters:
        name - the dispatch name
      • dispatch

        public void dispatch​(java.lang.String name,
                             boolean immediately)
        Description copied from interface: Translet
        Dispatch to other resources as the given name.
        Specified by:
        dispatch in interface Translet
        Parameters:
        name - the dispatch name
        immediately - whether to override the intended dispatch response rule
      • redirect

        public void redirect​(RedirectResponseRule redirectResponseRule)
        Description copied from interface: Translet
        Redirect a client according to the given rule.
        Specified by:
        redirect in interface Translet
        Parameters:
        redirectResponseRule - the redirect response rule
      • redirect

        public void redirect​(java.lang.String path)
        Description copied from interface: Translet
        Redirect a client to a new target resource. If an intended redirect response rule exists, that may be used.
        Specified by:
        redirect in interface Translet
        Parameters:
        path - the redirect path
      • redirect

        public void redirect​(java.lang.String path,
                             boolean immediately)
        Description copied from interface: Translet
        Redirect a client to a new target resource. If immediately is true, create a new redirect response rule and override the intended redirect response rule.
        Specified by:
        redirect in interface Translet
        Parameters:
        path - the redirect path
        immediately - whether to 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: Translet
        Redirect to the other target resource.
        Specified by:
        redirect in interface Translet
        Parameters:
        path - the redirect path
        parameters - the parameters
      • forward

        public void forward​(ForwardResponseRule forwardResponseRule)
        Description copied from interface: Translet
        Forward according to a given rule.
        Specified by:
        forward in interface Translet
        Parameters:
        forwardResponseRule - the forward response rule
      • forward

        public void forward​(java.lang.String transletName)
        Description copied from interface: Translet
        Forward to the specified translet immediately.
        Specified by:
        forward in interface Translet
        Parameters:
        transletName - the translet name of the target to be forwarded
      • forward

        public void forward​(java.lang.String transletName,
                            boolean immediately)
        Description copied from interface: Translet
        Forward to the specified translet.
        Specified by:
        forward in interface Translet
        Parameters:
        transletName - the translet name
        immediately - whether forwarding immediately
      • isExceptionRaised

        public boolean isExceptionRaised()
        Description copied from interface: Translet
        Returns whether the exception was thrown.
        Specified by:
        isExceptionRaised in interface Translet
        Returns:
        true, if is exception raised
      • getRaisedException

        public java.lang.Throwable getRaisedException()
        Description copied from interface: Translet
        Returns the raised exception instance.
        Specified by:
        getRaisedException in interface Translet
        Returns:
        the raised exception instance
      • getRootCauseOfRaisedException

        public java.lang.Throwable getRootCauseOfRaisedException()
        Description copied from interface: Translet
        Returns the innermost one of the chained (wrapped) exceptions.
        Specified by:
        getRootCauseOfRaisedException in interface Translet
        Returns:
        the innermost one of the chained (wrapped) exceptions
      • acceptsProfiles

        public boolean acceptsProfiles​(java.lang.String... profiles)
        Description copied from interface: Translet
        Return whether the given profile is active. If active profiles are empty whether the profile should be active by default.
        Specified by:
        acceptsProfiles in interface Translet
        Parameters:
        profiles - the profiles
        Returns:
        true if profile is active, otherwise false
      • getAspectAdviceBean

        public <T> T getAspectAdviceBean​(java.lang.String aspectId)
        Description copied from interface: Translet
        Gets the aspect advice bean.
        Specified by:
        getAspectAdviceBean in interface Translet
        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: Translet
        Gets the before advice result.
        Specified by:
        getBeforeAdviceResult in interface Translet
        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: Translet
        Gets the after advice result.
        Specified by:
        getAfterAdviceResult in interface Translet
        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: Translet
        Gets the around advice result.
        Specified by:
        getAroundAdviceResult in interface Translet
        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: Translet
        Gets the finally advice result.
        Specified by:
        getFinallyAdviceResult in interface Translet
        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: Translet
        Returns an interface class for the Translet.
        Specified by:
        getTransletInterfaceClass in interface Translet
        Returns:
        the interface class for the translet
      • getTransletImplementationClass

        public java.lang.Class<? extends CoreTranslet> getTransletImplementationClass()
        Description copied from interface: Translet
        Returns an implementation class for the Translet.
        Specified by:
        getTransletImplementationClass in interface Translet
        Returns:
        the implementation class for the translet
      • getBean

        public <T> T getBean​(java.lang.String id)
        Description copied from interface: BeanRegistry
        Return an instance of the bean that matches the given id.
        Specified by:
        getBean in interface BeanRegistry
        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: BeanRegistry
        Return an instance of the bean that matches the given object type.
        Specified by:
        getBean in interface BeanRegistry
        Type Parameters:
        T - the generic type
        Parameters:
        requiredType - the type the bean must match; can be an interface or superclass. null is 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: BeanRegistry
        Return 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:
        getBean in interface BeanRegistry
        Type Parameters:
        T - the generic type
        Parameters:
        id - the id of the bean to retrieve
        requiredType - type the bean must match; can be an interface or superclass. null is 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: BeanRegistry
        Return 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:
        getBean in interface BeanRegistry
        Type Parameters:
        T - the generic type
        Parameters:
        requiredType - type the bean must match; can be an interface or superclass. null is allowed.
        id - the id of the bean to retrieve; if requiredType is null.
        Returns:
        an instance of the bean
      • getConfigBean

        public <T> T getConfigBean​(java.lang.Class<T> classType)
        Description copied from interface: BeanRegistry
        Return the bean instance that matches the specified object type. If the bean is not of the required type then throw a BeanNotOfRequiredTypeException.
        Specified by:
        getConfigBean in interface BeanRegistry
        Type Parameters:
        T - the generic type
        Parameters:
        classType - type the bean must match; can be an interface or superclass. null is disallowed.
        Returns:
        an instance of the bean
      • containsBean

        public boolean containsBean​(java.lang.String id)
        Description copied from interface: BeanRegistry
        Return whether a bean with the specified id is present.
        Specified by:
        containsBean in interface BeanRegistry
        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: BeanRegistry
        Return whether a bean with the specified object type is present.
        Specified by:
        containsBean in interface BeanRegistry
        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: MessageSource
        Try to resolve the message. Return default message if no message was found.
        Specified by:
        getMessage in interface MessageSource
        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), or null if none.
        defaultMessage - String to return if the lookup fails
        locale - 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 NoSuchMessageException
        Description copied from interface: MessageSource
        Try to resolve the message. Treat as an error if the message can't be found.
        Specified by:
        getMessage in interface MessageSource
        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), or null if 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: Translet
        Try to resolve the message. Return default message if no message was found.
        Specified by:
        getMessage in interface Translet
        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), or null if 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 NoSuchMessageException
        Description copied from interface: Translet
        Try to resolve the message. Treat as an error if the message can't be found.
        Specified by:
        getMessage in interface Translet
        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), or null if none.
        Returns:
        the resolved message
        Throws:
        NoSuchMessageException - if the message wasn't found
        See Also:
        MessageFormat