|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.ui.options.xml.OptionDescriptorParser
public class OptionDescriptorParser
Instances of this class are used to parse an XML document, describing an options page, into a tree of option descriptors.
| Constructor Summary | |
|---|---|
OptionDescriptorParser()
Initialize this parser. |
|
| Method Summary | |
|---|---|
void |
addProperty(OptionDescriptor desc,
Node node)
Add a property to an option descriptor from a DOM node. |
OptionDescriptor.ItemDescriptor |
createItemDescriptor(Node node)
Create an item descriptor from a DOM node. |
OptionDescriptor.ListenerDescriptor |
createListenerDescriptor(Node node)
Create a listener descriptor from a DOM node. |
OptionDescriptor.ScriptDescriptor |
createScriptDescriptor(Node node)
Create a script descriptor from a DOM node. |
Node |
findFirstElement(Document doc)
Find the first node in a docuemnt that is an element node. |
OptionDescriptor |
generateTree(Node node)
Generate an OptionDescriptor tree from a DOM subtree. |
String |
getTextNodeValue(Node node)
Get the value of a node's text subelement. |
OptionDescriptor |
loadImport(Node node)
Import an external XML descriptor. |
OptionDescriptor |
parse(Reader reader)
Parse an XML document in a reader into a tree of option descriptors. |
OptionDescriptor |
parse(String docPath)
Parse an XML document in a file into a tree of option descriptors. |
void |
setListenerAttributes(Node node,
OptionDescriptor.ListenerDescriptor desc)
Set the attributes of a listener descriptor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OptionDescriptorParser()
throws Exception
Exception - if the DOM parser could not be initialized.| Method Detail |
|---|
public OptionDescriptor parse(String docPath)
throws Exception
docPath - the path to XML document to parse.
OptionDescriptor instance, root of the generated tree,
or null if the docuement could not be parsed.
Exception - if an error occurs while parsing the document.
public OptionDescriptor parse(Reader reader)
throws Exception
reader - the reader providing the XML document.
OptionDescriptor instance, root of the generated tree,
or null if the docuement could not be parsed.
Exception - if an error occurs while parsing the document.public Node findFirstElement(Document doc)
doc - the document whose children are looked up.
Node instance if one was found, or null otherwise.public OptionDescriptor generateTree(Node node)
OptionDescriptor tree from a DOM subtree.
node - the document to generate the tree from.
OptionDescriptor instance, root of the generated tree,
or null if the docuement could not be parsed.public OptionDescriptor.ItemDescriptor createItemDescriptor(Node node)
node - the node to generate the listener from.
ItemDescriptor instance.public OptionDescriptor.ListenerDescriptor createListenerDescriptor(Node node)
node - the node to generate the listener from.
ListenerDescriptor instance.
public void setListenerAttributes(Node node,
OptionDescriptor.ListenerDescriptor desc)
node - the parent listener node.desc - the listener descriptor whose attributeshave to be set.public String getTextNodeValue(Node node)
node - the node to generate whosde child is a text node.
public OptionDescriptor.ScriptDescriptor createScriptDescriptor(Node node)
node - the node to generate the listener from.
ScriptDescriptor instance.
public void addProperty(OptionDescriptor desc,
Node node)
desc - the option descriptor to add the property to.node - the node to get the property name and value from.public OptionDescriptor loadImport(Node node)
node - the node to get the import description from.
OptionDescriptor instance.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||