public abstract class EscapeReference extends Object implements ReferenceInsertionEventHandler, RuntimeServicesAware
String escape(String text)String getMatchAttribute()By default, all references are escaped. However, by setting the match attribute
in the configuration file to a regular expression, users can specify which references
to escape. For example the following configuration property tells the EscapeSqlReference
event handler to only escape references that start with "sql".
(e.g. $sql, $sql.toString(),, etc).
eventhandler.escape.sql.match = /sql.*/
Regular expressions should follow the "Perl5" format used by the ORO regular expression
library. More info is at
http://jakarta.apache.org/oro/api/org/apache/oro/text/perl/package-summary.html.ReferenceInsertionEventHandler.referenceInsertExecutor| Constructor and Description |
|---|
EscapeReference() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract String |
escape(Object text)
Escape the given text.
|
protected abstract String |
getMatchAttribute()
Specify the configuration attribute that specifies the
regular expression.
|
protected RuntimeServices |
getRuntimeServices()
Retrieve a reference to RuntimeServices.
|
Object |
referenceInsert(String reference,
Object value)
Escape the provided text if it matches the configured regular expression.
|
void |
setRuntimeServices(RuntimeServices rs)
Called automatically when event cartridge is initialized.
|
protected abstract String escape(Object text)
text - the text to escapeprotected abstract String getMatchAttribute()
eventhandler.escape.XYZ.match
where XYZ is the type of escaping being done.
public Object referenceInsert(String reference, Object value)
referenceInsert in interface ReferenceInsertionEventHandlerreference - value - public void setRuntimeServices(RuntimeServices rs)
setRuntimeServices in interface RuntimeServicesAwarers - instance of RuntimeServicesprotected RuntimeServices getRuntimeServices()
Copyright © 2000–2016. All rights reserved.