public class RootNodeList
extends java.lang.Object
The list is flat with a root element of 'roots' and all 'node' elements enclosed within that root element. Each node element has a single 'filename' attribute with the root node file name. No nesting of nodes is provided or supported.
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ATTR_FILE
The filename that is associated with a root node.
|
private static java.lang.String |
ATTR_FOLDER
The folder name that is associated with a node.
|
private static java.lang.String |
ATTR_PATTERN
The pattern used to list files from a folder.
|
private static java.lang.String |
ATTR_RECURSIVE
Attribute flag indicating if a folder will be searched recursively.
|
private static java.lang.String |
ELEM_NODE
Represents a single root entry point.
|
private static java.lang.String |
ELEM_ROOT
Root element containing the list.
|
private java.io.File |
file
XML filename for persisting the registry.
|
private java.util.ArrayList<java.lang.String> |
nodes
Stores the root node list.
|
private static java.lang.String |
ROOTFILE_KEY
Key for the global root node list filename configuration parameter.
|
Constructor and Description |
---|
RootNodeList()
Constructor which looks up the root node list filename and initializes
its data structures based on reading that file, if it exists.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getList()
Accesses the list of root nodes as read from the master XML file.
|
private void |
load()
Read the source XML document and build the list from the stored
elements.
|
private static final java.lang.String ROOTFILE_KEY
private static final java.lang.String ELEM_ROOT
private static final java.lang.String ELEM_NODE
private static final java.lang.String ATTR_FILE
private static final java.lang.String ATTR_FOLDER
private static final java.lang.String ATTR_RECURSIVE
private static final java.lang.String ATTR_PATTERN
private java.io.File file
private java.util.ArrayList<java.lang.String> nodes
public RootNodeList() throws ConfigurationException, AstException, java.io.FileNotFoundException
ConfigurationException
- if the root node list file is not configured properly.AstException
- if the XML parser has a failure during parsing or in its
file system operations.java.io.FileNotFoundException
- if a root file or folder does not exist.public java.lang.String[] getList()
null
if
there are no entries in the list.private void load() throws AstException, java.io.FileNotFoundException
AstException
- if the XML parser has a failure during parsing or in its
file system operations.java.lang.IllegalArgumentException
- if the input file is invalid or doesn't exist.java.io.FileNotFoundException
- if a root file or folder does not exist.