public abstract class AbstractJavascriptFilter<HEADER,TYPE>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected javax.script.Bindings |
bindings
javascript bindings
|
static java.lang.String |
DEFAULT_HEADER_KEY |
Modifier | Constructor and Description |
---|---|
protected |
AbstractJavascriptFilter(java.io.File scriptFile,
HEADER header)
constructor using a java.io.File script, compiles the script, puts
'header' in the bindings
|
protected |
AbstractJavascriptFilter(java.io.Reader scriptReader,
HEADER header)
Constructor, compiles script, put header in the bindings
|
protected |
AbstractJavascriptFilter(java.lang.String scriptExpression,
HEADER header)
constructor using a java.lang.String script, compiles the script, puts
'header' in the bindings
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept(TYPE record)
Evaluates this predicate on the given argument
|
java.lang.String |
getHeaderKey()
returns key used for header binding
|
abstract java.lang.String |
getRecordKey()
returns key used for record binding
|
public static final java.lang.String DEFAULT_HEADER_KEY
protected javax.script.Bindings bindings
protected AbstractJavascriptFilter(java.io.File scriptFile, HEADER header) throws java.io.IOException
java.io.IOException
protected AbstractJavascriptFilter(java.lang.String scriptExpression, HEADER header)
protected AbstractJavascriptFilter(java.io.Reader scriptReader, HEADER header)
scriptReader
- reader containing the script. will be closed.header
- the header to be injected in the javascript contextpublic java.lang.String getHeaderKey()
public abstract java.lang.String getRecordKey()
protected boolean accept(TYPE record)
record
- the record to test. It will be inject in the javascript
context using getRecordKey()