org.ucmtwine.proxy
Class ScriptProxy

java.lang.Object
  extended by intradoc.common.ScriptExtensionsAdaptor
      extended by org.ucmtwine.proxy.ScriptProxy
All Implemented Interfaces:
intradoc.common.ScriptExtensions

public class ScriptProxy
extends intradoc.common.ScriptExtensionsAdaptor


Field Summary
static int NONE
           
static int RETURN_BOOLEAN
           
static int RETURN_FLOAT
           
static int RETURN_INTEGER
           
static int RETURN_STRING
           
static int RETURN_VOID
           
 
Fields inherited from class intradoc.common.ScriptExtensionsAdaptor
m_functionDefinitionTable, m_functionTable, m_variableDefinitionTable, m_variableTable
 
Fields inherited from interface intradoc.common.ScriptExtensions
IDC_VERSION_INFO
 
Constructor Summary
ScriptProxy(Class<?> klass)
           
 
Method Summary
 boolean evaluateFunction(intradoc.common.ScriptInfo info, Object[] args, intradoc.common.ExecutionContext context)
          This is where the custom IdocScript function is evaluated.
 boolean evaluateValue(intradoc.common.ScriptInfo info, boolean[] returnBool, String[] returnString, intradoc.common.ExecutionContext context, boolean isConditional)
          This is where the custom IdocScript variable is evaluated.
 Integer getFunctionReturnType(Method m)
          Get idoc function return type.
 Object[] getInjectedValueArray(Method method, Object[] args, intradoc.common.ExecutionContext ctx)
          Enumerates the correct parameters for the delegated method.
 Integer getVariableReturnType(Method m)
          Get idoc variable type (limited to string or conditional).
 Object runFunctionMethod(int functionIndex, Object[] args, intradoc.common.ExecutionContext ctx)
          Executes the annotated method.
 Object runVariableMethod(int variableIndex, intradoc.common.ExecutionContext ctx)
           
 
Methods inherited from class intradoc.common.ScriptExtensionsAdaptor
checkNonEmpty, getFunctionDefinitionTable, getFunctionTable, getVariableDefinitionTable, getVariableTable, idcVersionInfo, load
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RETURN_VOID

public static final int RETURN_VOID
See Also:
Constant Field Values

RETURN_STRING

public static final int RETURN_STRING
See Also:
Constant Field Values

RETURN_BOOLEAN

public static final int RETURN_BOOLEAN
See Also:
Constant Field Values

RETURN_INTEGER

public static final int RETURN_INTEGER
See Also:
Constant Field Values

RETURN_FLOAT

public static final int RETURN_FLOAT
See Also:
Constant Field Values

NONE

public static final int NONE
See Also:
Constant Field Values
Constructor Detail

ScriptProxy

public ScriptProxy(Class<?> klass)
Method Detail

getFunctionReturnType

public Integer getFunctionReturnType(Method m)
Get idoc function return type.

Parameters:
m -
Returns:

getVariableReturnType

public Integer getVariableReturnType(Method m)
Get idoc variable type (limited to string or conditional).

Parameters:
m -
Returns:

evaluateFunction

public boolean evaluateFunction(intradoc.common.ScriptInfo info,
                                Object[] args,
                                intradoc.common.ExecutionContext context)
                         throws intradoc.common.ServiceException
This is where the custom IdocScript function is evaluated.

Specified by:
evaluateFunction in interface intradoc.common.ScriptExtensions
Overrides:
evaluateFunction in class intradoc.common.ScriptExtensionsAdaptor
Throws:
intradoc.common.ServiceException

getInjectedValueArray

public Object[] getInjectedValueArray(Method method,
                                      Object[] args,
                                      intradoc.common.ExecutionContext ctx)
                               throws IllegalArgumentException,
                                      intradoc.common.ServiceException
Enumerates the correct parameters for the delegated method. Injects any autowired types if present in the method signature.

Parameters:
method -
args -
ctx -
Returns:
Throws:
IllegalArgumentException
intradoc.common.ServiceException

runFunctionMethod

public Object runFunctionMethod(int functionIndex,
                                Object[] args,
                                intradoc.common.ExecutionContext ctx)
                         throws SecurityException,
                                NoSuchMethodException,
                                IllegalArgumentException,
                                intradoc.common.ServiceException,
                                IllegalAccessException,
                                InvocationTargetException
Executes the annotated method.

Parameters:
functionIndex -
args -
ctx -
Returns:
Throws:
IllegalArgumentException
intradoc.common.ServiceException
SecurityException
NoSuchMethodException
IllegalAccessException
InvocationTargetException

evaluateValue

public boolean evaluateValue(intradoc.common.ScriptInfo info,
                             boolean[] returnBool,
                             String[] returnString,
                             intradoc.common.ExecutionContext context,
                             boolean isConditional)
                      throws intradoc.common.ServiceException
This is where the custom IdocScript variable is evaluated.

Specified by:
evaluateValue in interface intradoc.common.ScriptExtensions
Overrides:
evaluateValue in class intradoc.common.ScriptExtensionsAdaptor
Throws:
intradoc.common.ServiceException

runVariableMethod

public Object runVariableMethod(int variableIndex,
                                intradoc.common.ExecutionContext ctx)
                         throws SecurityException,
                                NoSuchMethodException,
                                IllegalArgumentException,
                                intradoc.common.ServiceException,
                                IllegalAccessException,
                                InvocationTargetException
Throws:
SecurityException
NoSuchMethodException
IllegalArgumentException
intradoc.common.ServiceException
IllegalAccessException
InvocationTargetException


Copyright © 2012. All Rights Reserved.