Stellent
HowToComponents
JavaDoc

intradoc.common
Class ScriptCommonEvaluations

java.lang.Object
  |
  +--intradoc.common.ScriptExtensionsAdaptor
        |
        +--intradoc.common.ScriptCommonEvaluations
All Implemented Interfaces:
ScriptExtensions

public class ScriptCommonEvaluations
extends ScriptExtensionsAdaptor

Provides standard evaluations of variables and functions in Intradoc.


Field Summary
static java.lang.String[] COMMON_FUNCTIONS
          List of functions that are supported and configuration data for each function.
static int[][] COMMON_FUNCTIONS_CONFIG
          Configuration data for functions.
protected static java.lang.String m_overflowChars
           
protected static int m_overflowCharsLength
           
 
Fields inherited from class intradoc.common.ScriptExtensionsAdaptor
m_functionDefinitionTable, m_functionTable, m_variableDefinitionTable, m_variableTable
 
Constructor Summary
ScriptCommonEvaluations()
           
 
Method Summary
protected  java.lang.String doPad(java.lang.String str, int left, int right)
          adds white space to the left and right of the string passed, or returns the string if either pad numbers are negative.
static java.lang.Object doRegex(int function, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3)
          execute a regEx method
protected static boolean doRegexInit()
          Use reflection to initialize the regular expression Java methods (1.4 only)
 boolean evaluateFunction(ScriptInfo info, java.lang.Object[] args, ExecutionContext cxt)
          Evaluate standard functions.
 void load(ScriptRegistrator reg)
          Initializes configuration hashtable.
protected static java.lang.String stringFill(java.lang.String str, java.lang.String fill, long len, boolean isRight)
          This function either right or left fills the given string with the specified character up the desired length.
protected static java.lang.String stringReplace(java.lang.String str, java.lang.String fromStr, java.lang.String toStr)
          This function works on the first parameter replacing all occurrences of fromStr with toStr.
protected static java.lang.String stringReplaceIgnoreCase(java.lang.String str, java.lang.String fromStr, java.lang.String toStr)
           
 
Methods inherited from class intradoc.common.ScriptExtensionsAdaptor
evaluateValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_overflowChars

protected static java.lang.String m_overflowChars

m_overflowCharsLength

protected static int m_overflowCharsLength

COMMON_FUNCTIONS

public static final java.lang.String[] COMMON_FUNCTIONS
List of functions that are supported and configuration data for each function.


COMMON_FUNCTIONS_CONFIG

public static final int[][] COMMON_FUNCTIONS_CONFIG
Configuration data for functions. This list must align with the "COMMON_FUNCTIONS" list. In order the values are function id, Number of arguments", "First argument type", "Second argument type", "Return Type". Return type has the following possible values: 0 generic object 1 boolean 2 integer 3 double. The value "-1" means the value is unspecified.

Constructor Detail

ScriptCommonEvaluations

public ScriptCommonEvaluations()
Method Detail

load

public void load(ScriptRegistrator reg)
Initializes configuration hashtable.

Specified by:
load in interface ScriptExtensions
Overrides:
load in class ScriptExtensionsAdaptor

evaluateFunction

public boolean evaluateFunction(ScriptInfo info,
                                java.lang.Object[] args,
                                ExecutionContext cxt)
                         throws ServiceException
Evaluate standard functions. Returns false if function was not a standard function.

Specified by:
evaluateFunction in interface ScriptExtensions
Overrides:
evaluateFunction in class ScriptExtensionsAdaptor
ServiceException

stringReplace

protected static java.lang.String stringReplace(java.lang.String str,
                                                java.lang.String fromStr,
                                                java.lang.String toStr)
This function works on the first parameter replacing all occurrences of fromStr with toStr.


stringReplaceIgnoreCase

protected static java.lang.String stringReplaceIgnoreCase(java.lang.String str,
                                                          java.lang.String fromStr,
                                                          java.lang.String toStr)

stringFill

protected static java.lang.String stringFill(java.lang.String str,
                                             java.lang.String fill,
                                             long len,
                                             boolean isRight)
This function either right or left fills the given string with the specified character up the desired length.


doPad

protected java.lang.String doPad(java.lang.String str,
                                 int left,
                                 int right)
adds white space to the left and right of the string passed, or returns the string if either pad numbers are negative.


doRegexInit

protected static boolean doRegexInit()
Use reflection to initialize the regular expression Java methods (1.4 only)

Returns:

doRegex

public static java.lang.Object doRegex(int function,
                                       java.lang.String arg1,
                                       java.lang.String arg2,
                                       java.lang.String arg3)
                                throws ServiceException
execute a regEx method

Parameters:
function - 41-matches, 42-replaceFirst, 43-replaceAll
arg1 - haystack
arg2 - needle
arg3 - replacement needle, can be null
Returns:
Throws:
ServiceException


(c) 1996-2005  All rights reserved.  Stellent, Inc.