Methods Summary |
---|
public org.gudy.azureus2.plugins.utils.xml.simpleparser.SimpleXMLParserDocumentAttribute | getAttribute(java.lang.String name)
SimpleXMLParserDocumentAttribute[] attributes = getAttributes();
for (int i=0;i<attributes.length;i++){
if ( attributes[i].getName().equalsIgnoreCase( name )){
return( attributes[i] );
}
}
return( null );
|
public org.gudy.azureus2.plugins.utils.xml.simpleparser.SimpleXMLParserDocumentAttribute[] | getAttributes()
Vector v = new Vector();
// for element nodes the attributes AREN'T child elements, rather they are
// accessed via "getAttributes"
if ( node.getNodeType() == Node.ELEMENT_NODE ){
NamedNodeMap atts = node.getAttributes();
for (int i = 0; i < atts.getLength(); i++){
Node child = atts.item(i);
v.addElement( new SimpleXMLParserDocumentAttributeImpl( child.getNodeName(), child.getNodeValue()));
}
}
for (Node child = node.getFirstChild(); child != null;child = child.getNextSibling()){
int type = child.getNodeType();
if ( type == Node.ATTRIBUTE_NODE ){
v.addElement( new SimpleXMLParserDocumentAttributeImpl( child.getNodeName(), child.getNodeValue()));
}
}
SimpleXMLParserDocumentAttributeImpl[] res = new SimpleXMLParserDocumentAttributeImpl[v.size()];
v.copyInto( res );
return( res );
|
public org.gudy.azureus2.plugins.utils.xml.simpleparser.SimpleXMLParserDocumentNode | getChild(java.lang.String name)
SimpleXMLParserDocumentNode[] kids = getChildren();
for (int i=0;i<kids.length;i++){
if ( kids[i].getName().equalsIgnoreCase( name )){
return( kids[i] );
}
}
return( null );
|
public org.gudy.azureus2.plugins.utils.xml.simpleparser.SimpleXMLParserDocumentNode[] | getChildren()
if ( kids == null ){
kids = document.parseNode(node,true);
}
return( kids );
|
public java.lang.String | getName()
return( node.getLocalName());
|
protected org.w3c.dom.Node | getNode()
return( node );
|
public java.lang.String | getValue()
// if ( getChildren().length > 0 ){
//
// return( null);
if ( node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE ){
return( node.getNodeValue());
}
String res = "";
for (Node child = node.getFirstChild(); child != null;child = child.getNextSibling()){
int type = child.getNodeType();
if ( type == Node.CDATA_SECTION_NODE ||
type == Node.TEXT_NODE ||
type == Node.NOTATION_NODE ){
String str = child.getNodeValue();
res += str;
}
}
return( res );
|
protected void | print(java.lang.String indent)
String attr_str = "";
SimpleXMLParserDocumentAttribute[] attrs = getAttributes();
for (int i=0;i<attrs.length;i++){
attr_str += (i==0?"":",")+attrs[i].getName() + "=" + attrs[i].getValue();
}
System.out.println( indent + getName() + ":" + attr_str + " -> " + getValue());
SimpleXMLParserDocumentNode[] kids = getChildren();
for (int i=0;i<kids.length;i++){
((SimpleXMLParserDocumentNodeImpl)kids[i]).print( indent + " " );
}
|
public void | print()
print( "" );
|