/** * Sets the specified Node as the root Node. * Resets the current position in the tree. * @param rootNode The Node to set as the root of the tree. * @throws NullPointerException if rootNode is null. */ public void setRootNode(Node rootNode) throws NullPointerException { initRootNode(rootNode); }
/** * Convert this nodelist into the equivalent HTML. * @return The contents of the list as HTML text. */ public String toHtml () { return (toHtml (false)); }
/** * Filter the list with the given filter non-recursively. * @param filter The filter to use. * @return A new node array containing the nodes accepted by the filter. * This is a linear list and preserves the nested structure of the returned * nodes only. */ public NodeList extractAllNodesThatMatch (NodeFilter filter) { return (extractAllNodesThatMatch (filter, false)); }
/** * Add another node list to this one. * @param list The list to add. */ public void add (NodeList list) { for (int i = 0; i < list.size; i++) add (list.nodeData[i]); }
/** * Decode a string containing references. * Change all numeric character reference and character entity references * to unicode characters. * @param string The string to translate. */ public static String decode (String string) { return decode(string, null); }
/** * Split the input string in a string array, * considering the tags as delimiter for splitting. * <BR>Use NodeFilter class as input parameter * instead of tags[] string array. * @see ParserUtils#splitTags (String input, String[] tags, boolean recursive, boolean insideTag). */ public static String[] splitTags (String input, NodeFilter filter) throws ParserException, UnsupportedEncodingException { return splitTags (input, filter, true, true); }
public void removeAll () { size = 0; capacity = INITIAL_CAPACITY; nodeData = newNodeArrayFor (capacity); capacityIncrement = capacity * 2; }
/** * Trim all tags in the input string and * return a string like the input one * without the tags and their content. * @see ParserUtils#trimTags (String input, String[] tags, boolean recursive, boolean insideTag). */ public static String trimTags (String input, String[] tags) throws ParserException, UnsupportedEncodingException { return trimTags (input, tags, true, true); }
public void add (Node node) { if (size == capacity) adjustVectorCapacity (); nodeData[size++] = node; }
/** * Convert a character to a numeric character reference. * Convert a unicode character to a numeric character reference of * the form &#xxxx;. * @param character The character to convert. * @return The converted character. * @deprecated Use {@link #encode(int) encode}. */ public static String convertToString (int character) { return (encode (character)); }
public static String removeEscapeCharacters(String inputString) { inputString = ParserUtils.removeChars(inputString, '\r'); inputString = ParserUtils.removeChars(inputString, '\n'); inputString = ParserUtils.removeChars(inputString, '\t'); return inputString; }
/** * Filter the list with the given filter non-recursively. * @param filter The filter to use. * @return A new node array containing the nodes accepted by the filter. * This is a linear list and preserves the nested structure of the returned * nodes only. */ public NodeList extractAllNodesThatMatch (NodeFilter filter) { return (extractAllNodesThatMatch (filter, false)); }
/** * Create a one element node list. * @param node The initial node to add. */ public NodeList(Node node) { this (); add (node); }
public ObjectFindingVisitor(Class classTypeToFind,boolean recurse) { super(recurse, true); this.classTypeToFind = classTypeToFind; this.tags = new NodeList(); }
/** * Convert this nodelist into the equivalent HTML. * @deprecated Use {@link #toHtml}. * @return The contents of the list as HTML text. */ public String asHtml() { return (toHtml ()); }
/** * Split the input string in a string array, * considering the tags as delimiter for splitting. * @see ParserUtils#splitTags (String input, String[] tags, boolean recursive, boolean insideTag). */ public static String[] splitTags (String input, String[] tags) throws ParserException, UnsupportedEncodingException { return splitTags (input, tags, true, true); }
public void removeAll() { size = 0; capacity = INITIAL_CAPACITY; nodeData = newNodeArrayFor(capacity); capacityIncrement = capacity*2; numberOfAdjustments = 0; }
/** * Trim all tags in the input string and * return a string like the input one * without the tags and their content. * @see ParserUtils#trimTags (String input, String[] tags, boolean recursive, boolean insideTag). */ public static String trimTags (String input, String[] tags) throws ParserException, UnsupportedEncodingException { return trimTags (input, tags, true, true); }
/** * Split the input string in a string array, * considering the tags as delimiter for splitting. * @see ParserUtils#splitTags (String input, String[] tags, boolean recursive, boolean insideTag). */ public static String[] splitTags (String input, String[] tags) throws ParserException, UnsupportedEncodingException { return splitTags (input, tags, true, true); }