Developing Apama Applications > Developing Apama Applications in Java > Overview of Apama Java Applications > Using EPL keywords as identifiers in Java
Using EPL keywords as identifiers in Java
If you use EPL keywords as event name or field identifiers, then in the following situations you must escape such identifiers by preceding them with hash (#) symbols:
*You refer to the Java identifier in EPL code — You must escape the identifier in the EPL code that contains the reference.
*You refer to the Java identifier in a Java event expression — You must escape the identifier in that Java event expression.
For example, consider the following Java code:
class test extends Event {
   int id;
   float price;
   int integer;
}
Now suppose you want to write the following EPL code:
on all test(id=7): f {
   print f.toString();
   emit f;
}
No escaping is necessary. However, suppose you want to write this EPL code:
print f.integer.toString();
In this case, you must escape integer as follows: print f.#integer.toString();
Likewise, you must escape integer in the following Java event expression:
new EventExpression("all test(#integer > 5)");
For a list of EPL keywords, see the Apama EPL Reference, Lexical Elements, Keywords.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.