public String getOsisRef() { DefaultKeyVisitor visitor = new OsisRefVisitor(); KeyUtil.visit(this, visitor); return visitor.toString(); }
public String getOsisID() { DefaultKeyVisitor visitor = new OsisIDVisitor(); KeyUtil.visit(this, visitor); return visitor.toString(); }
public String getName() { if (name != null) { return name; } DefaultKeyVisitor visitor = new NameVisitor(); KeyUtil.visit(this, visitor); return visitor.toString(); }
/** * Walk through a tree visiting the nodes and branches in the tree * * @param key * The node tree to walk through * @param visitor * The visitor to notify whenever a node is found */ public static void visit(Key key, KeyVisitor visitor) { for (Key subkey : key) { if (subkey.canHaveChildren()) { visitor.visitBranch(subkey); visit(subkey, visitor); } else { visitor.visitLeaf(subkey); } } }