finance.edgar
Class LinkParser

java.lang.Object
  extended by javax.swing.text.html.HTMLEditorKit.ParserCallback
      extended by finance.edgar.LinkParser

public class LinkParser
extends javax.swing.text.html.HTMLEditorKit.ParserCallback


Field Summary
 
Fields inherited from class javax.swing.text.html.HTMLEditorKit.ParserCallback
IMPLIED
 
Constructor Summary
LinkParser(java.net.URL url)
           
 
Method Summary
 java.net.URL getBase()
           
 java.net.URL[] getURLs()
          sorts the links and removes the duplicates.
 void handleEndTag(javax.swing.text.html.HTML.Tag endTag, int pos)
           
 void handleStartTag(javax.swing.text.html.HTML.Tag startTag, javax.swing.text.MutableAttributeSet a, int pos)
           
 void handleText(char[] text, int position)
           
 
Methods inherited from class javax.swing.text.html.HTMLEditorKit.ParserCallback
flush, handleComment, handleEndOfLineString, handleError, handleSimpleTag
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkParser

public LinkParser(java.net.URL url)
           throws java.io.IOException,
                  javax.swing.text.BadLocationException
Throws:
java.io.IOException
javax.swing.text.BadLocationException
Method Detail

getURLs

public java.net.URL[] getURLs()
sorts the links and removes the duplicates.

Returns:
properly formatted absolute urls, no e-mails, no javascript.

handleStartTag

public void handleStartTag(javax.swing.text.html.HTML.Tag startTag,
                           javax.swing.text.MutableAttributeSet a,
                           int pos)
Overrides:
handleStartTag in class javax.swing.text.html.HTMLEditorKit.ParserCallback

handleText

public void handleText(char[] text,
                       int position)
Overrides:
handleText in class javax.swing.text.html.HTMLEditorKit.ParserCallback

handleEndTag

public void handleEndTag(javax.swing.text.html.HTML.Tag endTag,
                         int pos)
Overrides:
handleEndTag in class javax.swing.text.html.HTMLEditorKit.ParserCallback

getBase

public java.net.URL getBase()