*
* @since 3.0
*/
- public static final LexicalScope ROOT = new LexicalScope(null, ""); //$NON-NLS-1$
+ public static final LexicalScope ROOT = new RootScope();
/**
* Trace string
* @since 3.0
*
*/
- public static final LexicalScope PACKET_HEADER = new LexicalScope(PACKET, "header"); //$NON-NLS-1$
+ public static final LexicalScope PACKET_HEADER = new PacketHeaderScope();
/**
* Stream packet scope
*/
public static final LexicalScope STREAM_EVENT_HEADER = new LexicalScope(STREAM_EVENT, "header"); //$NON-NLS-1$
+ /**
+ * Event header
+ *
+ * @since 3.1
+ */
+ public static final LexicalScope EVENT_HEADER = new EventHeaderScope(EVENT, "header"); //$NON-NLS-1$
+
/**
* Fields in an event
*
* @since 3.0
*/
- public static final LexicalScope FIELDS = new LexicalScope(ROOT, "fields"); //$NON-NLS-1$
+ public static final LexicalScope FIELDS = new FieldsScope(ROOT, "fields"); //$NON-NLS-1$
/**
* Context of an event
private final String fPath;
private final Map<String, LexicalScope> fChildren;
-
/**
* The scope constructor
*
pathString = pathString.substring(1);
}
if (pathString == null) {
- // we should get an NPE on pathString.startsWith before getting this
+ // we should get an NPE on pathString.startsWith before getting
+ // this
throw new IllegalStateException(
"Lexical scope constructor had null pathstring for " + //$NON-NLS-1$
parent.toString() + " and " + name); //$NON-NLS-1$
@Override
public String toString() {
- return fPath + '.' + fName;
+ return (fPath.isEmpty() ? fName : fPath + '.' + fName);
}
@Override