org.webdocwf.util.loader.transformation
Class JavaScriptEvaluator

java.lang.Object
  extended byorg.webdocwf.util.loader.transformation.JavaScriptEvaluator
All Implemented Interfaces:
Transformer

public class JavaScriptEvaluator
extends java.lang.Object
implements Transformer

This class is used to evaluate javaScript expresions used to transform data in transformations. As base for this class is used rhino1.5 (Rhino is an open-source implementation of JavaScript written entirely in Java)

Version:
1.0
Author:
Zeljko Kovacevic

Field Summary
static java.lang.String CONFIG_STRING
           
 
Constructor Summary
JavaScriptEvaluator()
           
 
Method Summary
 void configure(java.lang.String s)
          Configure transformer
 java.lang.String getExpression()
          This method will return javaScript expression used for transformation.
 java.util.Vector getVariableNames()
          This method returns vector with variable names from java script.
 void release()
          Release resources if necessairly
 void setExpression(java.lang.String exppression)
          This method set javaScript expression
 void setLogger(Logger logger)
          This method set logger
 void setVariableNames(java.util.Vector vector)
          This method set variable names from java script.
 java.util.List transformValue(java.util.List valueToTransform)
          This method will transform data from input List using javaScript and return List with transformed values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_STRING

public static java.lang.String CONFIG_STRING
Constructor Detail

JavaScriptEvaluator

public JavaScriptEvaluator()
Method Detail

configure

public void configure(java.lang.String s)
Description copied from interface: Transformer
Configure transformer

Specified by:
configure in interface Transformer

release

public void release()
Description copied from interface: Transformer
Release resources if necessairly

Specified by:
release in interface Transformer

transformValue

public java.util.List transformValue(java.util.List valueToTransform)
                              throws java.lang.Exception
This method will transform data from input List using javaScript and return List with transformed values

Specified by:
transformValue in interface Transformer
Parameters:
valueToTransform - input values for transformation
Returns:
List with transformed values
Throws:
java.lang.Exception

getExpression

public java.lang.String getExpression()
This method will return javaScript expression used for transformation.

Returns:
String

setExpression

public void setExpression(java.lang.String exppression)
This method set javaScript expression

Parameters:
exppression - String which is javaScript expression

getVariableNames

public java.util.Vector getVariableNames()
This method returns vector with variable names from java script.

Returns:
vector with variable names

setVariableNames

public void setVariableNames(java.util.Vector vector)
This method set variable names from java script.

Parameters:
vector - Vector with variable names

setLogger

public void setLogger(Logger logger)
This method set logger

Parameters:
logger -


Copyright © 2002-2007 Together - the Workgroup. All Rights Reserved.