|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Dictionary
sunlabs.brazil.sunlabs.XmlTree (view source)
public class XmlTree
Create a tree representation of an xml file whose parts may be referenced as a dictionary. This is currently "read only".
Nested Class Summary | |
---|---|
static class |
XmlTree.DefaultNodeName
The node is named by the specified attribute. |
static class |
XmlTree.IllegalXmlException
Do some more reasonable error handling. |
static class |
XmlTree.Node
This describes a node of the XML tree |
static interface |
XmlTree.NodeName
|
static class |
XmlTree.XmlErrorInfo
|
Constructor Summary | |
---|---|
XmlTree()
Make an empty tree. |
|
XmlTree(String src)
Given an XML string, build the tree. |
Method Summary | |
---|---|
Enumeration |
elements()
|
static void |
elements(XmlTree.Node n,
Vector v)
|
Object |
get(Object k)
Given a node description, return the value, if any. |
static String |
getFile(InputStream in)
|
static String |
getFile(String s)
|
String |
getPart(String s)
Given a node descriptor, return the result. |
XmlTree.Node |
getRoot()
|
Hashtable |
getTags()
|
void |
ignoreUnknownTags(boolean flag)
set unknown tag disposition |
boolean |
isEmpty()
The current object state is the "default"; "save" does not need to write out any state. |
Enumeration |
keys()
|
void |
keys(XmlTree.Node n,
String prefix,
String delim,
Vector v)
|
void |
load(InputStream in)
Recreate the object from the ascii representation stored as a Properties format file. |
static void |
main(String[] args)
|
Vector |
match(String pattern)
Find all nodes that match a glob pattern, starting at the root. |
void |
match(XmlTree.Node node,
StringTokenizer st,
Vector results)
Find all nodes that match a glob pattern, starting at any node. |
Object |
put(Object k,
Object v)
|
Object |
remove(Object o)
|
void |
replace(String src)
Replace the XmlTree with new markup. |
void |
save(OutputStream out,
String header)
Create an ascii representation of this object in a Java Properties format. |
XmlTree.Node |
search(String s)
Find a node in the tree by name, starting at the root. |
XmlTree.Node |
search(XmlTree.Node node,
StringTokenizer st)
Find a node in the tree by name, starting under any node. |
boolean |
setAttribute(String name,
String key,
String value)
|
boolean |
setCdata(String name,
String data)
|
void |
setComparator(XmlTree.NodeName nodeName)
Set the class that determines a node's name. |
void |
setDelim(String delim)
set the node delimiter. |
boolean |
setDflt(String dflt)
|
void |
setIdent(String ident)
|
void |
setPrefix(String prefix)
set the name of this tree |
void |
setTag(String tag)
Add an element to the tag process list. |
void |
setTags(Hashtable tags)
Set the list of tags to process |
int |
size()
|
String |
toString()
|
void |
toString(XmlTree.Node node,
StringBuffer sb,
int level)
Print a tree |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XmlTree()
public XmlTree(String src) throws IllegalArgumentException
IllegalArgumentException
Method Detail |
---|
public void ignoreUnknownTags(boolean flag)
public void setIdent(String ident)
public XmlTree.Node getRoot()
public void setTag(String tag)
public void setTags(Hashtable tags)
public Hashtable getTags()
public void setPrefix(String prefix)
public void setDelim(String delim)
public boolean setDflt(String dflt)
public void setComparator(XmlTree.NodeName nodeName)
public String toString()
toString
in class Object
public void toString(XmlTree.Node node, StringBuffer sb, int level)
node
- The starting nodesb
- where to append the results tolevel
- the nesting levelpublic void replace(String src) throws XmlTree.IllegalXmlException
src
- the xml data
XmlTree.IllegalXmlException
public boolean setAttribute(String name, String key, String value)
public boolean setCdata(String name, String data)
public XmlTree.Node search(String s)
s
- The node pathname
public XmlTree.Node search(XmlTree.Node node, StringTokenizer st)
public Vector match(String pattern)
public void match(XmlTree.Node node, StringTokenizer st, Vector results)
public Enumeration elements()
elements
in class Dictionary
public static void elements(XmlTree.Node n, Vector v)
public Enumeration keys()
keys
in class Dictionary
public void keys(XmlTree.Node n, String prefix, String delim, Vector v)
public Object get(Object k)
get
in class Dictionary
public String getPart(String s)
public Object put(Object k, Object v)
put
in class Dictionary
public Object remove(Object o)
remove
in class Dictionary
public int size()
size
in class Dictionary
public boolean isEmpty()
PropertiesCacheManager.Saveable
isEmpty
in interface PropertiesCacheManager.Saveable
isEmpty
in class Dictionary
public void load(InputStream in) throws IOException
PropertiesCacheManager.Saveable
load
in interface PropertiesCacheManager.Saveable
IOException
public void save(OutputStream out, String header) throws IOException
PropertiesCacheManager.Saveable
save
in interface PropertiesCacheManager.Saveable
IOException
public static void main(String[] args)
public static String getFile(String s) throws IOException
IOException
public static String getFile(InputStream in) throws IOException
IOException
|
Version Kenai-svn-r24, Generated 08/18/09 Copyright (c) 2001-2009, Sun Microsystems. |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |