- public void setParent(Tree.Node p) { wrapped.setParent(p); }
- public Tree.Node getParent() { return wrapped.getParent(); }
- public XML.Attributes getAttributes() { return wrapped.getAttributes(); }
- public XML.Prefixes getPrefixes() { return wrapped.getPrefixes(); }
- public List getChildren() { return wrapped.getChildren(); }
- public String getQName() { return wrapped.getQName(); }
- public String getLocalName() { return wrapped.getLocalName(); }
- public String getPrefix() { return wrapped.getPrefix(); }
- public String getUri() { return wrapped.getUri(); }
-
- /** Works up the Element object model until an instance of a JSScope is found. */
- private static JSScope findScope(Tree.Node e) {
- while (e != null && !(e instanceof JSScope)) e = e.getParent();
- return (JSScope)e;
+ public void setParent(Tree.Node p) { wrapped.setParent(p); }
+ public Tree.Node getParent() { return wrapped.getParent(); }
+
+ public static class Node extends JSLeaf implements Tree.Node {
+ public Node(Tree.Node wrapped) {
+ super(wrapped);
+ List c = wrapped.getChildren();
+ for (int i=0; i < c.size(); i++) ((Tree.Leaf)c.get(i)).setParent(this);
+ }
+
+ public List getChildren() { return ((Tree.Node)wrapped).getChildren(); }
+ }
+
+ public static class Element extends Node implements Tree.Element {
+ public Element(Tree.Element wrapped) { super(wrapped); }
+
+ public Tree.Attributes getAttributes() { return ((Tree.Element)wrapped).getAttributes(); }
+ public Tree.Prefixes getPrefixes() { return ((Tree.Element)wrapped).getPrefixes(); }
+
+ public String getQName() { return ((Tree.Element)wrapped).getQName(); }
+ public String getLocalName() { return ((Tree.Element)wrapped).getLocalName(); }
+ public String getPrefix() { return ((Tree.Element)wrapped).getPrefix(); }
+ public String getUri() { return ((Tree.Element)wrapped).getUri(); }