org.springframework.extensions.webscripts.processor
Class GroovyScriptProcessor

java.lang.Object
  extended by org.springframework.extensions.webscripts.processor.BaseProcessor
      extended by org.springframework.extensions.webscripts.processor.BaseRegisterableScriptProcessor
          extended by org.springframework.extensions.webscripts.processor.AbstractScriptProcessor
              extended by org.springframework.extensions.webscripts.processor.GroovyScriptProcessor
All Implemented Interfaces:
EventListener, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener, Processor, ScriptProcessor

public class GroovyScriptProcessor
extends AbstractScriptProcessor

Author:
muzquiano

Field Summary
 
Fields inherited from class org.springframework.extensions.webscripts.processor.BaseProcessor
processorExtensions
 
Constructor Summary
GroovyScriptProcessor()
           
 
Method Summary
 Object executeGroovyString(String script, Map<String,Object> model)
           
 Object executeScript(ScriptContent scriptContent, Map<String,Object> model)
          Execute script
 Object executeScript(String path, Map<String,Object> model)
          Execute script
 ScriptContent findScript(String path)
          Find a script at the specified path (within registered Web Script stores)
 String getExtension()
          The file extension that the processor is associated with, null if none.
 String getName()
          Get the name of the processor
 void init()
          Inits the processor
 void reset()
          Reset script cache
 Object unwrapValue(Object value)
          Unwrap value returned by script TODO: Remove this method when value conversion is truly hidden within script engine
 
Methods inherited from class org.springframework.extensions.webscripts.processor.AbstractScriptProcessor
addProcessorModelExtensions, getScriptLoader, getSearchPath, initLoaders, register, setSearchPath
 
Methods inherited from class org.springframework.extensions.webscripts.processor.BaseRegisterableScriptProcessor
getScriptProcessorRegistry, onApplicationEvent, setApplicationContext, setScriptProcessorRegistry
 
Methods inherited from class org.springframework.extensions.webscripts.processor.BaseProcessor
registerProcessorExtension
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContext
 

Constructor Detail

GroovyScriptProcessor

public GroovyScriptProcessor()
Method Detail

getExtension

public String getExtension()
Description copied from interface: Processor
The file extension that the processor is associated with, null if none.

Returns:
the extension

getName

public String getName()
Description copied from interface: Processor
Get the name of the processor

Returns:
the name of the processor

executeGroovyString

public Object executeGroovyString(String script,
                                  Map<String,Object> model)
See Also:
org.alfresco.service.cmr.repository.ScriptProcessor#executeString(java.lang.String, java.util.Map)

init

public void init()
Description copied from class: BaseRegisterableScriptProcessor
Inits the processor

Overrides:
init in class AbstractScriptProcessor

findScript

public ScriptContent findScript(String path)
Description copied from interface: ScriptProcessor
Find a script at the specified path (within registered Web Script stores)

Parameters:
path - script path
Returns:
script location (or null, if not found)

executeScript

public Object executeScript(String path,
                            Map<String,Object> model)
Description copied from interface: ScriptProcessor
Execute script

Parameters:
path - script path
model - model
Returns:
script result

executeScript

public Object executeScript(ScriptContent scriptContent,
                            Map<String,Object> model)
Description copied from interface: ScriptProcessor
Execute script

Parameters:
scriptContent - script location
model - model
Returns:
script result

unwrapValue

public Object unwrapValue(Object value)
Description copied from interface: ScriptProcessor
Unwrap value returned by script TODO: Remove this method when value conversion is truly hidden within script engine

Parameters:
value - value to unwrap
Returns:
unwrapped value

reset

public void reset()
Description copied from interface: ScriptProcessor
Reset script cache



Copyright © 2009 SpringSource, Inc. All Rights Reserved.