Developing Apama Applications > Apama EPL Reference > Lexical Elements > Keywords > Escaping keywords to use them as identifiers
Escaping keywords to use them as identifiers
You can use a keyword as an identifier if you escape it with a hash symbol (#). For example:
package com.company.#monitor.client;
using com.company.#monitor.server.Event;
In a stream query, you can use a query-scope keyword as an identifier if you prefix it with a hash symbol (#). For example:
event Tick
{...
   string partition;
   ...
}
from t in all Tick() partition by t.#partition retain 5 ...
You can define a Java event type that has a field name that is the same as an EPL keyword. To refer to that field in EPL, prefix it with a hash symbol. For example:
class MyEvent extends Event {
   int integer;
   ...
}
on all MyEvent(#integer = 5): m { ... }
To avoid warning messages if you use a reserved word as an identifier, escape the reserved word with a hash symbol (#).
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.