Package org.xwiki.filter.script
Class AbstractFilterScriptService
- java.lang.Object
-
- org.xwiki.filter.script.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 Summary
Fields Modifier and Type Field Description protected org.xwiki.context.ExecutionexecutionProvides access to the current context.static StringEXTENSIONERROR_KEYThe key under which the last encountered error is stored in the current execution context.protected org.xwiki.script.internal.safe.ScriptSafeProviderscriptProvider
-
Constructor Summary
Constructors Constructor Description AbstractFilterScriptService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExceptiongetLastError()Get the error generated while performing the previously called action.protected voidresetError()Reset error status.protected <T> Tsafe(T unsafe)protected voidsetError(Exception e)Store a caught exception in the context, so that it can be later retrieved usinggetLastError().
-
-
-
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.
-
-
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
nullif 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 usinggetLastError().- Parameters:
e- the exception to store, can benullto clear the previously stored exception- See Also:
getLastError()
-
-