public Node getNode(Object o) {
Node n = (Node)map.get(o);
if (n == null) {
if(o instanceof OMElement){
n = new ElementImpl((OMElement)o, this);
} else if (o instanceof OMDocument) {
n = new DocumentImpl((OMDocument)o, this);
} else if (o instanceof OMComment) {
n = new CommentImpl((OMComment)o, this);
} else if (o instanceof OMDocType) {
n = new DoctypeImpl((OMDocType)o, this);
} else if (o instanceof OMText){
n = new TextImpl((OMText)o, this);
} else if (o instanceof OMProcessingInstruction){
n = new ProcessingInstructionImpl((OMProcessingInstruction)o, this);
}
map.put(o, n);
}
return n;
}
|