Class LinkBean

java.lang.Object
org.htmlparser.beans.LinkBean
All Implemented Interfaces:
Serializable

public class LinkBean extends Object implements Serializable
Extract links from a URL.
See Also:
  • Field Details

    • PROP_URL_PROPERTY

      public static final String PROP_URL_PROPERTY
      Property name in event where the URL changes.
      See Also:
    • mPropertySupport

      protected PropertyChangeSupport mPropertySupport
      Bound property support.
    • mParser

      protected Parser mParser
      The parser used to extract strings.
  • Constructor Details

    • LinkBean

      public LinkBean()
      Creates new LinkBean
  • Method Details

    • extractLinks

      protected URL[] extractLinks() throws ParserException
      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

      protected boolean equivalent(URL[] array1, URL[] array2)
      Determine if two arrays of URL's are the same.
      Parameters:
      array1 - One array of URL's
      array2 - Another array of URL's
      Returns:
      true if the URL's match in number and value, false otherwise.
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener listener)
      Add a PropertyChangeListener to the listener list. The listener is registered for all properties.
      Parameters:
      listener - The PropertyChangeListener to be added.
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener listener)
      Remove a PropertyChangeListener from the listener list. This removes a registered PropertyChangeListener.
      Parameters:
      listener - The PropertyChangeListener to be removed.
    • getLinks

      public URL[] getLinks()
      Getter for property links.
      Returns:
      Value of property links.
    • getURL

      public String getURL()
      Getter for property URL.
      Returns:
      Value of property URL.
    • setURL

      public void setURL(String url)
      Setter for property URL.
      Parameters:
      url - New value of property URL.
    • getConnection

      public URLConnection getConnection()
      Getter for property Connection.
      Returns:
      Value of property Connection.
    • setConnection

      public void setConnection(URLConnection connection)
      Setter for property Connection.
      Parameters:
      connection - New value of property Connection.
    • main

      public static void main(String[] args)
      Unit test.
      Parameters:
      args - Pass arg[0] as the URL to process.