org.apache.droids.parse.html
Class LinkExtractor

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.apache.droids.parse.html.LinkExtractor
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class LinkExtractor
extends org.xml.sax.helpers.DefaultHandler


Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
LinkExtractor(Link base, java.util.Map<java.lang.String,java.lang.String> elements)
           
 
Method Summary
 void addOutlinkURI(java.lang.String value)
          Add the outlink to the links list if the value is a valid URI.
 void endDocument()
           
 java.util.Map<java.lang.String,java.lang.String> getElements()
           
 java.util.Collection<Link> getLinks()
           
 void startDocument()
           
 void startElement(java.lang.String uri, java.lang.String loc, java.lang.String raw, org.xml.sax.Attributes att)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log
Constructor Detail

LinkExtractor

public LinkExtractor(Link base,
                     java.util.Map<java.lang.String,java.lang.String> elements)
Method Detail

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

startElement

public void startElement(java.lang.String uri,
                         java.lang.String loc,
                         java.lang.String raw,
                         org.xml.sax.Attributes att)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

addOutlinkURI

public void addOutlinkURI(java.lang.String value)
Add the outlink to the links list if the value is a valid URI.

Parameters:
value - the outlink.

getLinks

public java.util.Collection<Link> getLinks()

getElements

public java.util.Map<java.lang.String,java.lang.String> getElements()


Copyright © 2007-2009. All Rights Reserved.