Interface Node.HookKey

All Superinterfaces:
Serializable
All Known Implementing Classes:
LineNumberingNodeFactory.Numbering
Enclosing interface:
Node

public static interface Node.HookKey extends Serializable
Nodes can optional have hooks which add meta-data to the node. This meta-data is identified by a HookKey, typically an enum which implements this interface.

Since Jep 4.0 HookKey extends Serializable. Individual instances can be created as enums:

enum EnumKey implements HookKey { KEY1,KEY2 };
and get and set using setHook(EnumKey.Key1,3.0) and getHook(EnumKey.Key2). Alternatively anonymous class can be used:
 public static final HookKey ANON_KEY = new HookKey() {
           private static final long serialVersionUID = 1L;
           private Object readResolve() { return ANON_KEY; }
 };
 
The readResolve() is needed for serialisation.