Class SegmentParser

  • Direct Known Subclasses:
    RecordUsageAnalyser

    public class SegmentParser
    extends Object
    SegmentParser serves as a base class for parsing segments.

    This base class provides means for parsing segments into their various kinds of record. Descendants typically parametrise its behaviour by overriding the on...() methods as needed. By default those methods just initiate the traversal of the same named record.

    A typical usage for e.g. printing out the sizes of all templates would look as follows:

          new TestParser() {
              protected void onTemplate(RecordId parentId, RecordId templateId) {
                  TemplateInfo templateInfo = parseTemplate(parentId, templateId);
                  System.out.println(templateInfo.size);
              }
         }.parseNode(null, nodeId);