| java.lang.Object org.netbeans.modules.project.ant.Util
Util | public class Util (Code) | | Utilities relating to Ant projects.
author: Jesse Glick |
defaultErrorHandler | public static ErrorHandler defaultErrorHandler()(Code) | | Create an XML error handler that rethrows errors and fatal errors and logs warnings.
a standard error handler |
findElement | public static Element findElement(Element parent, String name, String namespace)(Code) | | Search for an XML element in the direct children of a parent.
DOM provides a similar method but it does a recursive search
which we do not want. It also gives a node list and we want
only one result.
Parameters: parent - a parent element Parameters: name - the intended local name Parameters: namespace - the intended namespace the one child element with that name, or null if none or more than one |
findSubElements | public static List<Element> findSubElements(Element parent) throws IllegalArgumentException(Code) | | Find all direct child elements of an element.
More useful than
Element.getElementsByTagNameNS because it does
not recurse into recursive child elements.
Children which are all-whitespace text nodes are ignored; others cause
an exception to be thrown.
Parameters: parent - a parent element in a DOM tree a list of direct child elements (may be empty) throws: IllegalArgumentException - if there are non-element children besides whitespace |
findText | public static String findText(Element parent)(Code) | | Extract nested text from an element.
Currently does not handle coalescing text nodes, CDATA sections, etc.
Parameters: parent - a parent element the nested text, or null if none was found |
|
|