T - the specific type of contextpublic class ScriptedContextLookupFunction<T extends BaseContext> extends AbstractScriptEvaluator implements ContextDataLookupFunction<T,Object>
Function over a BaseContext
which calls out to a supplied script.| Modifier and Type | Field and Description |
|---|---|
private Class<T> |
inputClass
What class we want the input to test against.
|
DEFAULT_ENGINE| Modifier | Constructor and Description |
|---|---|
protected |
ScriptedContextLookupFunction(Class<T> inClass,
EvaluableScript theScript)
Constructor.
|
protected |
ScriptedContextLookupFunction(Class<T> inClass,
EvaluableScript theScript,
String extraInfo)
Constructor.
|
protected |
ScriptedContextLookupFunction(Class<T> inClass,
EvaluableScript theScript,
String extraInfo,
Class outputType)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
apply(T context) |
Object |
getCustomObject() |
(package private) static ScriptedContextLookupFunction<MessageContext> |
inlineMessageContextScript(String scriptSource)
Factory to create
ScriptedContextLookupFunction for MessageContexts from inline data. |
(package private) static ScriptedContextLookupFunction<MessageContext> |
inlineMessageContextScript(String scriptSource,
Class outputType)
Factory to create
ScriptedContextLookupFunction for MessageContexts from inline data. |
(package private) static ScriptedContextLookupFunction<MessageContext> |
inlineMessageContextScript(String engineName,
String scriptSource)
Factory to create
ScriptedContextLookupFunction for MessageContexts from inline data. |
(package private) static ScriptedContextLookupFunction<MessageContext> |
inlineMessageContextScript(String engineName,
String scriptSource,
Class outputType)
Factory to create
ScriptedContextLookupFunction for MessageContexts from inline data. |
(package private) static ScriptedContextLookupFunction<ProfileRequestContext> |
inlineScript(String scriptSource)
Factory to create
ScriptedContextLookupFunction for ProfileRequestContexts from inline data. |
(package private) static ScriptedContextLookupFunction<ProfileRequestContext> |
inlineScript(String scriptSource,
Class outputType)
Factory to create
ScriptedContextLookupFunction for ProfileRequestContexts from inline data. |
(package private) static ScriptedContextLookupFunction<ProfileRequestContext> |
inlineScript(String engineName,
String scriptSource)
Factory to create
ScriptedContextLookupFunction for ProfileRequestContexts from inline data. |
(package private) static ScriptedContextLookupFunction<ProfileRequestContext> |
inlineScript(String engineName,
String scriptSource,
Class outputType)
Factory to create
ScriptedContextLookupFunction for ProfileRequestContexts from inline data. |
protected void |
prepareContext(ScriptContext scriptContext,
Object... input) |
(package private) static ScriptedContextLookupFunction |
resourceMessageContextScript(org.springframework.core.io.Resource resource)
|
(package private) static ScriptedContextLookupFunction<MessageContext> |
resourceMessageContextScript(org.springframework.core.io.Resource resource,
Class outputType)
|
(package private) static ScriptedContextLookupFunction<MessageContext> |
resourceMessageContextScript(String engineName,
org.springframework.core.io.Resource resource)
|
(package private) static ScriptedContextLookupFunction<MessageContext> |
resourceMessageContextScript(String engineName,
org.springframework.core.io.Resource resource,
Class outputType)
|
(package private) static ScriptedContextLookupFunction<ProfileRequestContext> |
resourceScript(org.springframework.core.io.Resource resource)
Factory to create
ScriptedContextLookupFunction from a Resource. |
(package private) static ScriptedContextLookupFunction<ProfileRequestContext> |
resourceScript(org.springframework.core.io.Resource resource,
Class outputType)
|
(package private) static ScriptedContextLookupFunction<ProfileRequestContext> |
resourceScript(String engineName,
org.springframework.core.io.Resource resource)
|
(package private) static ScriptedContextLookupFunction<ProfileRequestContext> |
resourceScript(String engineName,
org.springframework.core.io.Resource resource,
Class outputType)
|
evaluate, finalizeContext, getHideExceptions, getLogPrefix, getOutputType, getReturnOnError, setCustomObject, setHideExceptions, setLogPrefix, setOutputType, setReturnOnError@Nonnull private final Class<T extends BaseContext> inputClass
protected ScriptedContextLookupFunction(@Nonnull Class<T> inClass, @Nonnull EvaluableScript theScript, @Nullable String extraInfo)
inClass - the class we accept as input.theScript - the script we will evaluate.extraInfo - debugging information.protected ScriptedContextLookupFunction(@Nonnull Class<T> inClass, @Nonnull EvaluableScript theScript)
inClass - the class we accept as input.theScript - the script we will evaluate.protected ScriptedContextLookupFunction(@Nonnull Class<T> inClass, @Nonnull EvaluableScript theScript, @Nullable String extraInfo, @Nullable Class outputType)
inClass - the class we accept as input.theScript - the script we will evaluate.extraInfo - debugging information.outputType - the type to test against.@Nullable public Object getCustomObject()
getCustomObject in class AbstractScriptEvaluatorpublic Object apply(@Nullable T context)
apply in interface com.google.common.base.Function<T extends BaseContext,Object>protected void prepareContext(@Nonnull ScriptContext scriptContext, @Nullable Object... input)
prepareContext in class AbstractScriptEvaluator@Nonnull static ScriptedContextLookupFunction<ProfileRequestContext> resourceScript(@Nonnull@NotEmpty String engineName, @Nonnull org.springframework.core.io.Resource resource) throws ScriptException, IOException
resource - the resource to look atengineName - the languageScriptException - if the compile failsIOException - if the file doesn't exist.@Nonnull static ScriptedContextLookupFunction<ProfileRequestContext> resourceScript(@Nonnull@NotEmpty String engineName, @Nonnull org.springframework.core.io.Resource resource, @Nullable Class outputType) throws ScriptException, IOException
resource - the resource to look atengineName - the languageoutputType - the type to test against.ScriptException - if the compile failsIOException - if the file doesn't exist.@Nonnull static ScriptedContextLookupFunction<ProfileRequestContext> resourceScript(org.springframework.core.io.Resource resource) throws ScriptException, IOException
ScriptedContextLookupFunction from a Resource.resource - the resource to look atScriptException - if the compile failsIOException - if the file doesn't exist.@Nonnull static ScriptedContextLookupFunction<ProfileRequestContext> resourceScript(org.springframework.core.io.Resource resource, @Nullable Class outputType) throws ScriptException, IOException
resource - the resource to look atoutputType - the type to test against.ScriptException - if the compile failsIOException - if the file doesn't exist.@Nonnull static ScriptedContextLookupFunction<ProfileRequestContext> inlineScript(@Nonnull@NotEmpty String engineName, @Nonnull@NotEmpty String scriptSource) throws ScriptException
ScriptedContextLookupFunction for ProfileRequestContexts from inline data.scriptSource - the script, as a stringengineName - the languageScriptException - if the compile fails@Nonnull static ScriptedContextLookupFunction<ProfileRequestContext> inlineScript(@Nonnull@NotEmpty String engineName, @Nonnull@NotEmpty String scriptSource, @Nullable Class outputType) throws ScriptException
ScriptedContextLookupFunction for ProfileRequestContexts from inline data.scriptSource - the script, as a stringengineName - the languageoutputType - the type to test against.ScriptException - if the compile fails@Nonnull static ScriptedContextLookupFunction<ProfileRequestContext> inlineScript(@Nonnull@NotEmpty String scriptSource) throws ScriptException
ScriptedContextLookupFunction for ProfileRequestContexts from inline data.scriptSource - the script, as a stringScriptException - if the compile fails@Nonnull static ScriptedContextLookupFunction<ProfileRequestContext> inlineScript(@Nonnull@NotEmpty String scriptSource, @Nullable Class outputType) throws ScriptException
ScriptedContextLookupFunction for ProfileRequestContexts from inline data.scriptSource - the script, as a stringoutputType - the type to test against.ScriptException - if the compile fails@Nonnull static ScriptedContextLookupFunction<MessageContext> resourceMessageContextScript(@Nonnull@NotEmpty String engineName, @Nonnull org.springframework.core.io.Resource resource) throws ScriptException, IOException
resource - the resource to look atengineName - the languageScriptException - if the compile failsIOException - if the file doesn't exist.@Nonnull static ScriptedContextLookupFunction<MessageContext> resourceMessageContextScript(@Nonnull@NotEmpty String engineName, @Nonnull org.springframework.core.io.Resource resource, @Nullable Class outputType) throws ScriptException, IOException
resource - the resource to look atengineName - the languageoutputType - the type to test against.ScriptException - if the compile failsIOException - if the file doesn't exist.@Nonnull static ScriptedContextLookupFunction resourceMessageContextScript(org.springframework.core.io.Resource resource) throws ScriptException, IOException
resource - the resource to look atScriptException - if the compile failsIOException - if the file doesn't exist.@Nonnull static ScriptedContextLookupFunction<MessageContext> resourceMessageContextScript(org.springframework.core.io.Resource resource, @Nullable Class outputType) throws ScriptException, IOException
resource - the resource to look atoutputType - the type to test against.ScriptException - if the compile failsIOException - if the file doesn't exist.@Nonnull static ScriptedContextLookupFunction<MessageContext> inlineMessageContextScript(@Nonnull@NotEmpty String engineName, @Nonnull@NotEmpty String scriptSource) throws ScriptException
ScriptedContextLookupFunction for MessageContexts from inline data.scriptSource - the script, as a stringengineName - the languageScriptException - if the compile fails@Nonnull static ScriptedContextLookupFunction<MessageContext> inlineMessageContextScript(@Nonnull@NotEmpty String engineName, @Nonnull@NotEmpty String scriptSource, @Nullable Class outputType) throws ScriptException
ScriptedContextLookupFunction for MessageContexts from inline data.scriptSource - the script, as a stringengineName - the languageoutputType - the type to test against.ScriptException - if the compile fails@Nonnull static ScriptedContextLookupFunction<MessageContext> inlineMessageContextScript(@Nonnull@NotEmpty String scriptSource) throws ScriptException
ScriptedContextLookupFunction for MessageContexts from inline data.scriptSource - the script, aMessageContexts a stringScriptException - if the compile fails@Nonnull static ScriptedContextLookupFunction<MessageContext> inlineMessageContextScript(@Nonnull@NotEmpty String scriptSource, @Nullable Class outputType) throws ScriptException
ScriptedContextLookupFunction for MessageContexts from inline data.scriptSource - the script, as a stringoutputType - the type to test against.ScriptException - if the compile failsCopyright © 1999–2020 Shibboleth Consortium. All rights reserved.