public abstract class EscapeReference extends java.lang.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| 构造器和说明 |
|---|
EscapeReference() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected abstract java.lang.String |
escape(java.lang.Object text)
Escape the given text.
|
protected abstract java.lang.String |
getMatchAttribute()
Specify the configuration attribute that specifies the
regular expression.
|
protected RuntimeServices |
getRuntimeServices()
Retrieve a reference to RuntimeServices.
|
java.lang.Object |
referenceInsert(java.lang.String reference,
java.lang.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 java.lang.String escape(java.lang.Object text)
text - the text to escapeprotected abstract java.lang.String getMatchAttribute()
eventhandler.escape.XYZ.match
where XYZ is the type of escaping being done.
public java.lang.Object referenceInsert(java.lang.String reference,
java.lang.Object value)
referenceInsert 在接口中 ReferenceInsertionEventHandlerreference - value - public void setRuntimeServices(RuntimeServices rs)
setRuntimeServices 在接口中 RuntimeServicesAwarers - instance of RuntimeServicesprotected RuntimeServices getRuntimeServices()