| Method from org.apache.axiom.c14n.omwrapper.ElementImpl Detail: |
public NamedNodeMap getAttributes() {
if (nnm == null) { // ok now nnm == null implies this is the first time call to this method
list = new ArrayList();
nnm = new NamedNodeMapImpl(list, e, fac);
Iterator itr = e.getAllAttributes();
while (itr.hasNext()) {
list.add(itr.next());
}
itr = e.getAllDeclaredNamespaces();
while (itr.hasNext()) {
list.add(itr.next());
}
Object parent = e.getParent();
if (parent instanceof OMElement) {
OMNamespace defaultNS = e.getDefaultNamespace();
OMNamespace defaultParentNS = ((OMElement) parent).getDefaultNamespace();
if (defaultNS != null && defaultParentNS != null &&
defaultNS.getNamespaceURI().equals(defaultParentNS.getNamespaceURI())) {
list.remove(defaultNS);
}
}
}
return nnm;
}
|
public NodeList getChildNodes() {
Iterator itr = null;
if (nl == null) { // ok then this is the first call to this method
nodes = new ArrayList();
nl = new NodeListImpl(nodes, fac);
itr = e.getChildren();
while(itr.hasNext()) {
nodes.add(itr.next());
}
}
return nl;
}
|
public Node getFirstChild() {
return fac.getNode(e.getFirstOMChild());
}
|
public String getNamespaceURI() {
OMNamespace ns = e.getNamespace();
if (ns != null){
return ns.getNamespaceURI();
}
return null;
}
|
public String getNodeName() {
// overriden getNodeName()
QName qn = e.getQName();
if (qn.getPrefix() == null || "".equals(qn.getPrefix())) {
return qn.getLocalPart();
} else {
return qn.getPrefix() + ":" + qn.getLocalPart();
}
}
|
public short getNodeType() {
return Node.ELEMENT_NODE;
}
|
public String getPrefix() {
String prefix = e.getQName().getPrefix();
if (prefix == null || "".equals(prefix)){
return null;
}
return prefix;
}
|
public String getTagName() {
// for Element type getTagName() is similar to its getNodeName();
return getNodeName();
}
|
public boolean hasAttributes() {
// no worries only the first time call would be expensive
return getAttributes().getLength() != 0;
}
|
public String toString() {
return e.toString();
}
|