|
HTML Parser Home Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.htmlparser.util.ParserUtils
public class ParserUtils
Constructor Summary | |
---|---|
ParserUtils()
|
Method Summary | |
---|---|
static Parser |
createParserParsingAnInputString(String input)
Create a Parser Object having a String Object as input (instead of a url or a string representing the url location). |
static Node[] |
findTypeInNode(Node node,
Class type)
Search given node and pick up any objects of given type. |
static String |
removeChars(String s,
char occur)
|
static String |
removeEscapeCharacters(String inputString)
|
static String |
removeTrailingBlanks(String text)
|
static String[] |
splitButChars(String input,
String charsDoNotBeRemoved)
Split the input string considering as string separator all the characters with the only exception of the characters specified in charsDoNotBeRemoved param. |
static String[] |
splitButDigits(String input,
String charsDoNotBeRemoved)
Split the input string considering as string separator all the not numerical characters with the only exception of the characters specified in charsDoNotBeRemoved param. |
static String[] |
splitChars(String input,
String charsToBeRemoved)
Split the input string considering as string separator the chars specified in the input variable charsToBeRemoved. |
static String[] |
splitSpaces(String input,
String charsToBeRemoved)
Split the input string considering as string separator all the spaces and tabs like chars and the chars specified in the input variable charsToBeRemoved. |
static String[] |
splitTags(String input,
Class nodeType)
Split the input string in a string array, considering the tags as delimiter for splitting. |
static String[] |
splitTags(String input,
Class nodeType,
boolean recursive,
boolean insideTag)
Split the input string in a string array, considering the tags as delimiter for splitting. |
static String[] |
splitTags(String input,
NodeFilter filter)
Split the input string in a string array, considering the tags as delimiter for splitting. |
static String[] |
splitTags(String input,
NodeFilter filter,
boolean recursive,
boolean insideTag)
Split the input string in a string array, considering the tags as delimiter for splitting. |
static String[] |
splitTags(String input,
String[] tags)
Split the input string in a string array, considering the tags as delimiter for splitting. |
static String[] |
splitTags(String input,
String[] tags,
boolean recursive,
boolean insideTag)
Split the input string in a string array, considering the tags as delimiter for splitting. |
static String |
trimAllTags(String input,
boolean inside)
Trim the input string, removing all the tags in the input string. |
static String |
trimButChars(String input,
String charsDoNotBeRemoved)
Remove from the input string all the characters with the only exception of the characters specified in charsDoNotBeRemoved param. |
static String |
trimButCharsBeginEnd(String input,
String charsDoNotBeRemoved)
Remove from the beginning and the end of the input string all the characters with the only exception of the characters specified in charsDoNotBeRemoved param. |
static String |
trimButDigits(String input,
String charsDoNotBeRemoved)
Remove from the input string all the not numerical characters with the only exception of the characters specified in charsDoNotBeRemoved param. |
static String |
trimButDigitsBeginEnd(String input,
String charsDoNotBeRemoved)
Remove from the beginning and the end of the input string all the not numerical characters with the only exception of the characters specified in charsDoNotBeRemoved param. |
static String |
trimChars(String input,
String charsToBeRemoved)
Remove from the input string all the chars specified in the input variable charsToBeRemoved. |
static String |
trimCharsBeginEnd(String input,
String charsToBeRemoved)
Remove from the beginning and the end of the input string all the chars specified in the input variable charsToBeRemoved. |
static String |
trimSpaces(String input,
String charsToBeRemoved)
Remove from the input string all the spaces and tabs like chars. |
static String |
trimSpacesBeginEnd(String input,
String charsToBeRemoved)
Remove from the beginning and the end of the input string all the spaces and tabs like chars. |
static String |
trimTags(String input,
Class nodeType)
Trim all tags in the input string and return a string like the input one without the tags and their content. |
static String |
trimTags(String input,
Class nodeType,
boolean recursive,
boolean insideTag)
Trim all tags in the input string and return a string like the input one without the tags and their content (optional). |
static String |
trimTags(String input,
NodeFilter filter)
Trim all tags in the input string and return a string like the input one without the tags and their content. |
static String |
trimTags(String input,
NodeFilter filter,
boolean recursive,
boolean insideTag)
Trim all tags in the input string and return a string like the input one without the tags and their content (optional). |
static String |
trimTags(String input,
String[] tags)
Trim all tags in the input string and return a string like the input one without the tags and their content. |
static String |
trimTags(String input,
String[] tags,
boolean recursive,
boolean insideTag)
Trim all tags in the input string and return a string like the input one without the tags and their content (optional). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ParserUtils()
Method Detail |
---|
public static String removeChars(String s, char occur)
public static String removeEscapeCharacters(String inputString)
public static String removeTrailingBlanks(String text)
public static Node[] findTypeInNode(Node node, Class type)
node
- The node to search.type
- The class to search for.
public static String[] splitButDigits(String input, String charsDoNotBeRemoved)
input
- The string in input.charsDoNotBeRemoved
- The chars that do not be removed.
public static String trimButDigits(String input, String charsDoNotBeRemoved)
input
- The string in input.charsDoNotBeRemoved
- The chars that do not be removed.
public static String trimButDigitsBeginEnd(String input, String charsDoNotBeRemoved)
input
- - The string in input.charsDoNotBeRemoved
- - The chars that do not be removed.
public static String[] splitSpaces(String input, String charsToBeRemoved)
input
- The string in input.charsToBeRemoved
- The chars to be removed.
public static String trimSpaces(String input, String charsToBeRemoved)
input
- The string in input.charsToBeRemoved
- The chars to be removed.
public static String trimSpacesBeginEnd(String input, String charsToBeRemoved)
input
- The string in input.charsToBeRemoved
- The chars to be removed.
public static String[] splitButChars(String input, String charsDoNotBeRemoved)
input
- The string in input.charsDoNotBeRemoved
- The chars that do not be removed.
public static String trimButChars(String input, String charsDoNotBeRemoved)
input
- The string in input.charsDoNotBeRemoved
- The chars that do not be removed.
public static String trimButCharsBeginEnd(String input, String charsDoNotBeRemoved)
input
- The string in input.charsDoNotBeRemoved
- The chars that do not be removed.
public static String[] splitChars(String input, String charsToBeRemoved)
input
- The string in input.charsToBeRemoved
- The chars to be removed.
public static String trimChars(String input, String charsToBeRemoved)
input
- The string in input.charsToBeRemoved
- The chars to be removed.
public static String trimCharsBeginEnd(String input, String charsToBeRemoved)
input
- The string in input.charsToBeRemoved
- The chars to be removed.
public static String[] splitTags(String input, String[] tags) throws ParserException, UnsupportedEncodingException
ParserException
UnsupportedEncodingException
(String input, String[] tags, boolean recursive, boolean insideTag).
public static String[] splitTags(String input, String[] tags, boolean recursive, boolean insideTag) throws ParserException, UnsupportedEncodingException
input
- The string in input.tags
- The tags to be used as splitting delimiter.recursive
- Optional parameter (true if not present), if true delete all the tags recursively.insideTag
- Optional parameter (true if not present), if true delete also the content of the tags.
ParserException
UnsupportedEncodingException
public static String[] splitTags(String input, Class nodeType) throws ParserException, UnsupportedEncodingException
ParserException
UnsupportedEncodingException
(String input, String[] tags, boolean recursive, boolean insideTag).
public static String[] splitTags(String input, Class nodeType, boolean recursive, boolean insideTag) throws ParserException, UnsupportedEncodingException
ParserException
UnsupportedEncodingException
(String input, String[] tags, boolean recursive, boolean insideTag).
public static String[] splitTags(String input, NodeFilter filter) throws ParserException, UnsupportedEncodingException
ParserException
UnsupportedEncodingException
(String input, String[] tags, boolean recursive, boolean insideTag).
public static String[] splitTags(String input, NodeFilter filter, boolean recursive, boolean insideTag) throws ParserException, UnsupportedEncodingException
ParserException
UnsupportedEncodingException
(String input, String[] tags, boolean recursive, boolean insideTag).
public static String trimAllTags(String input, boolean inside)
input
- The string in input.inside
- If true, it forces the method to delete also what is inside the tags.
public static String trimTags(String input, String[] tags) throws ParserException, UnsupportedEncodingException
ParserException
UnsupportedEncodingException
(String input, String[] tags, boolean recursive, boolean insideTag).
public static String trimTags(String input, String[] tags, boolean recursive, boolean insideTag) throws ParserException, UnsupportedEncodingException
input
- The string in input.tags
- The tags to be removed.recursive
- Optional parameter (true if not present), if true delete all the tags recursively.insideTag
- Optional parameter (true if not present), if true delete also the content of the tags.
ParserException
UnsupportedEncodingException
public static String trimTags(String input, Class nodeType) throws ParserException, UnsupportedEncodingException
ParserException
UnsupportedEncodingException
(String input, String[] tags, boolean recursive, boolean insideTag).
public static String trimTags(String input, Class nodeType, boolean recursive, boolean insideTag) throws ParserException, UnsupportedEncodingException
ParserException
UnsupportedEncodingException
(String input, String[] tags, boolean recursive, boolean insideTag).
public static String trimTags(String input, NodeFilter filter) throws ParserException, UnsupportedEncodingException
ParserException
UnsupportedEncodingException
(String input, String[] tags, boolean recursive, boolean insideTag).
public static String trimTags(String input, NodeFilter filter, boolean recursive, boolean insideTag) throws ParserException, UnsupportedEncodingException
ParserException
UnsupportedEncodingException
(String input, String[] tags, boolean recursive, boolean insideTag).
public static Parser createParserParsingAnInputString(String input) throws ParserException, UnsupportedEncodingException
input
- The string in input.
ParserException
UnsupportedEncodingException
|
© 2006 Derrick Oswald Sep 17, 2006
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
HTML Parser is an open source library released under Common Public License. |