I tried adding a custom method to the Node class but ended up creating a new class that holds a node object in a variable.
so the question is. is it even possible?
I did this:
public class Trip implements org.w3c.dom.Node {
[...generated methods...]
public String myMethod(){
return "";
}
}
but I was getting lots of errors so I ended up doing this
public class Trip {
private Node mNode;
public void Trip(Node tripNode){
this.mNode = tripNode;
}
public String myMethod(){
return "";
}
}
org.w3c.dom.Node is an interface, therefore your posted code won’t work.
You don’t want to start trying to implement your own DOM, so I suggest you think of a different approach. What is it you want to do?
You might be able to make use of get and setUserData to accomplish your goal.