Class AbstractFilterScriptService

  • All Implemented Interfaces:
    org.xwiki.script.service.ScriptService
    Direct Known Subclasses:
    FilterScriptService

    public abstract class AbstractFilterScriptService
    extends Object
    implements org.xwiki.script.service.ScriptService
    Base class for all FilterStream related script services.
    Since:
    6.2M1
    Version:
    $Id: 123c0b7138ea17548bdad058d51381783260eeeb $
    • Field Detail

      • EXTENSIONERROR_KEY

        public static final String EXTENSIONERROR_KEY
        The key under which the last encountered error is stored in the current execution context.
        See Also:
        Constant Field Values
      • scriptProvider

        @Inject
        protected org.xwiki.script.internal.safe.ScriptSafeProvider scriptProvider
      • execution

        @Inject
        protected org.xwiki.context.Execution execution
        Provides access to the current context.
    • Constructor Detail

      • AbstractFilterScriptService

        public AbstractFilterScriptService()
    • Method Detail

      • safe

        protected <T> T safe​(T unsafe)
        Type Parameters:
        T - the type of the object
        Parameters:
        unsafe - the unsafe object
        Returns:
        the safe version of the passed object
      • getLastError

        public Exception getLastError()
        Get the error generated while performing the previously called action.
        Returns:
        an eventual exception or null if no exception was thrown
      • resetError

        protected void resetError()
        Reset error status.
      • setError

        protected void setError​(Exception e)
        Store a caught exception in the context, so that it can be later retrieved using getLastError().
        Parameters:
        e - the exception to store, can be null to clear the previously stored exception
        See Also:
        getLastError()