Package org.htmlparser.beans
Class LinkBean
java.lang.Object
org.htmlparser.beans.LinkBean
- All Implemented Interfaces:
Serializable
Extract links from a URL.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected URL[]The strings extracted from the URL.protected ParserThe parser used to extract strings.protected PropertyChangeSupportBound property support.static final StringProperty name in event where the URL contents changes.static final StringProperty name in event where the URL changes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a PropertyChangeListener to the listener list.protected booleanequivalent(URL[] array1, URL[] array2) Determine if two arrays of URL's are the same.protected URL[]Internal routine to extract all the links from the parser.Getter for property Connection.URL[]getLinks()Getter for property links.getURL()Getter for property URL.static voidUnit test.voidRemove a PropertyChangeListener from the listener list.voidsetConnection(URLConnection connection) Setter for property Connection.voidSetter for property URL.
-
Field Details
-
PROP_LINKS_PROPERTY
Property name in event where the URL contents changes.- See Also:
-
PROP_URL_PROPERTY
Property name in event where the URL changes.- See Also:
-
mPropertySupport
Bound property support. -
mLinks
The strings extracted from the URL. -
mParser
The parser used to extract strings.
-
-
Constructor Details
-
LinkBean
public LinkBean()Creates new LinkBean
-
-
Method Details
-
extractLinks
Internal routine to extract all the links from the parser.- Returns:
- A list of all links on the page as URLs.
- Throws:
ParserException- If the parse fails.
-
equivalent
Determine if two arrays of URL's are the same.- Parameters:
array1- One array of URL'sarray2- Another array of URL's- Returns:
trueif the URL's match in number and value,falseotherwise.
-
addPropertyChangeListener
Add a PropertyChangeListener to the listener list. The listener is registered for all properties.- Parameters:
listener- The PropertyChangeListener to be added.
-
removePropertyChangeListener
Remove a PropertyChangeListener from the listener list. This removes a registered PropertyChangeListener.- Parameters:
listener- The PropertyChangeListener to be removed.
-
getLinks
Getter for property links.- Returns:
- Value of property links.
-
getURL
Getter for property URL.- Returns:
- Value of property URL.
-
setURL
Setter for property URL.- Parameters:
url- New value of property URL.
-
getConnection
Getter for property Connection.- Returns:
- Value of property Connection.
-
setConnection
Setter for property Connection.- Parameters:
connection- New value of property Connection.
-
main
Unit test.- Parameters:
args- Pass arg[0] as the URL to process.
-