| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mit.csail.sdg.alloy4.XMLNode
public final class XMLNode
Immutable; this class represents an XML element node.
| Constructor Summary | |
|---|---|
| XMLNode(java.io.File file)Constructs the root XMLNode by parsing an entire XML document. | |
| XMLNode(java.io.Reader reader)Constructs the root XMLNode by parsing an entire XML document, then close the reader afterwards. | |
| XMLNode(java.io.Reader reader,
        boolean parseText)Constructs the root XMLNode by parsing an entire XML document, then close the reader afterwards. | |
| Method Summary | |
|---|---|
|  java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> | attributes()Returns an unmodifiable view of the attributes. | 
|  int | count()Returns the number of direct subnodes. | 
|  java.lang.String | getAttribute(java.lang.String name)Returns the value associated with the given attribute name; if the attribute doesn't exist, return "". | 
|  java.lang.String | getAttribute(java.lang.String name,
             java.lang.String defaultValue)Returns the value associated with the given attribute name; if the attribute doesn't exist, return the defaultValue. | 
|  java.lang.Iterable<XMLNode> | getChildren(java.lang.String type)Returns a read-only iteration of the immediate subelements whose type is equal to the given type. | 
|  java.lang.String | getText()Returns the text if this is a text node, returns "" otherwise. | 
|  java.lang.String | getType()Returns the type of the element. | 
|  boolean | is(java.lang.String type)Returns true if the type of this element is equal to the given type. | 
|  java.util.Iterator<XMLNode> | iterator()Returns a read-only iterator over the immediate subelements. | 
|  java.lang.String | toString()Dump the content to a String. | 
|  void | toString(java.lang.StringBuilder sb,
         int indent)Dump the content to a StringBuilder. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Constructor Detail | 
|---|
public XMLNode(java.io.Reader reader,
               boolean parseText)
        throws java.io.IOException
java.io.IOException
public XMLNode(java.io.Reader reader)
        throws java.io.IOException
java.io.IOException
public XMLNode(java.io.File file)
        throws java.io.IOException
java.io.IOException| Method Detail | 
|---|
public int count()
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> attributes()
public java.lang.String toString()
toString in class java.lang.Object
public void toString(java.lang.StringBuilder sb,
                     int indent)
public java.lang.String getType()
public java.lang.String getText()
public boolean is(java.lang.String type)
public java.util.Iterator<XMLNode> iterator()
iterator in interface java.lang.Iterable<XMLNode>public java.lang.Iterable<XMLNode> getChildren(java.lang.String type)
public java.lang.String getAttribute(java.lang.String name)
public java.lang.String getAttribute(java.lang.String name,
                                     java.lang.String defaultValue)
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||