org.apache.lenya.lucene.parser
Class SwingHTMLHandler

java.lang.Object
  extended by javax.swing.text.html.HTMLEditorKit.ParserCallback
      extended by org.apache.lenya.lucene.parser.SwingHTMLHandler

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


Nested Class Summary
static class SwingHTMLHandler.TagStack
          DOCUMENT ME!
 
Field Summary
static java.lang.String LUCENE_CLASS_VALUE
           
static java.lang.String LUCENE_TAG_NAME
           
 
Fields inherited from class javax.swing.text.html.HTMLEditorKit.ParserCallback
IMPLIED
 
Constructor Summary
SwingHTMLHandler()
          Creates a new instance of SwingHTMLHandler
 
Method Summary
protected  void appendToContents(char[] data)
           
protected  void appendToTitle(char[] data)
           
protected  void debug(java.lang.String message)
          Logs a message.
 java.lang.String getKeywords()
          Get keywords
protected  java.lang.String getLuceneClassValue()
          Returns the value for the class attribute used to avoid indexing.
protected  SwingHTMLHandler.TagStack getLuceneStack()
           
protected  javax.swing.text.html.HTML.Tag getLuceneTag()
          Returns the tag name used to avoid indexing.
 java.io.Reader getReader()
          DOCUMENT ME!
protected  SwingHTMLHandler.TagStack getStack()
           
 java.lang.String getTitle()
          Get title
 void handleEndTag(javax.swing.text.html.HTML.Tag tag, int pos)
          Handles an end tag.
protected  void handleLuceneEndTag()
          Handles a Lucene index control end tag.
protected  void handleLuceneStartTag(javax.swing.text.html.HTML.Tag tag, javax.swing.text.MutableAttributeSet attributes)
          Handles a Lucene index control start tag.
protected  void handleMetaTag(javax.swing.text.MutableAttributeSet attributes)
          Handles a META tag.
 void handleSimpleTag(javax.swing.text.html.HTML.Tag tag, javax.swing.text.MutableAttributeSet attributes, int pos)
          Handles an end tag.
 void handleStartTag(javax.swing.text.html.HTML.Tag tag, javax.swing.text.MutableAttributeSet attributes, int pos)
          Handles a start tag.
 void handleText(char[] data, int pos)
           
protected  void handleTitleEndTag()
           
protected  void handleTitleStartTag()
           
protected  boolean isIndexing()
           
protected  boolean isTagInitialized()
          Returns if the Lucene META tags are provided.
protected  boolean isTitleParsing()
           
protected  void log(java.lang.Exception e)
          Logs an exception.
protected  void log(java.lang.String message, java.lang.Exception e)
          Logs an exception with a message.
protected  void setLuceneClassValue(java.lang.String value)
          Sets the value for the class attribute used to avoid indexing.
protected  void setLuceneTag(javax.swing.text.html.HTML.Tag tag)
          Sets the tag name used to avoid indexing.
protected  void startIndexing()
           
protected  void startTitleParsing()
           
protected  void stopIndexing()
           
protected  void stopTitleParsing()
           
 
Methods inherited from class javax.swing.text.html.HTMLEditorKit.ParserCallback
flush, handleComment, handleEndOfLineString, handleError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LUCENE_TAG_NAME

public static final java.lang.String LUCENE_TAG_NAME
See Also:
Constant Field Values

LUCENE_CLASS_VALUE

public static final java.lang.String LUCENE_CLASS_VALUE
See Also:
Constant Field Values
Constructor Detail

SwingHTMLHandler

public SwingHTMLHandler()
Creates a new instance of SwingHTMLHandler

Method Detail

getStack

protected SwingHTMLHandler.TagStack getStack()

appendToTitle

protected void appendToTitle(char[] data)

getTitle

public java.lang.String getTitle()
Get title

Returns:
DOCUMENT ME!

getKeywords

public java.lang.String getKeywords()
Get keywords

Returns:
DOCUMENT ME!

appendToContents

protected void appendToContents(char[] data)

getReader

public java.io.Reader getReader()
DOCUMENT ME!

Returns:
DOCUMENT ME!

isIndexing

protected boolean isIndexing()

startIndexing

protected void startIndexing()

stopIndexing

protected void stopIndexing()

handleStartTag

public void handleStartTag(javax.swing.text.html.HTML.Tag tag,
                           javax.swing.text.MutableAttributeSet attributes,
                           int pos)
Handles a start tag.

Overrides:
handleStartTag in class javax.swing.text.html.HTMLEditorKit.ParserCallback

handleEndTag

public void handleEndTag(javax.swing.text.html.HTML.Tag tag,
                         int pos)
Handles an end tag.

Overrides:
handleEndTag in class javax.swing.text.html.HTMLEditorKit.ParserCallback

isTitleParsing

protected boolean isTitleParsing()

startTitleParsing

protected void startTitleParsing()

stopTitleParsing

protected void stopTitleParsing()

handleTitleStartTag

protected void handleTitleStartTag()

handleTitleEndTag

protected void handleTitleEndTag()

setLuceneTag

protected void setLuceneTag(javax.swing.text.html.HTML.Tag tag)
Sets the tag name used to avoid indexing.


getLuceneTag

protected javax.swing.text.html.HTML.Tag getLuceneTag()
Returns the tag name used to avoid indexing.


setLuceneClassValue

protected void setLuceneClassValue(java.lang.String value)
Sets the value for the class attribute used to avoid indexing.


getLuceneClassValue

protected java.lang.String getLuceneClassValue()
Returns the value for the class attribute used to avoid indexing.


isTagInitialized

protected boolean isTagInitialized()
Returns if the Lucene META tags are provided.


handleMetaTag

protected void handleMetaTag(javax.swing.text.MutableAttributeSet attributes)
Handles a META tag. This method checks for the Lucene configuration tags.


getLuceneStack

protected SwingHTMLHandler.TagStack getLuceneStack()

handleLuceneStartTag

protected void handleLuceneStartTag(javax.swing.text.html.HTML.Tag tag,
                                    javax.swing.text.MutableAttributeSet attributes)
Handles a Lucene index control start tag.


handleLuceneEndTag

protected void handleLuceneEndTag()
Handles a Lucene index control end tag.


handleSimpleTag

public void handleSimpleTag(javax.swing.text.html.HTML.Tag tag,
                            javax.swing.text.MutableAttributeSet attributes,
                            int pos)
Handles an end tag.

Overrides:
handleSimpleTag in class javax.swing.text.html.HTMLEditorKit.ParserCallback

handleText

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

debug

protected void debug(java.lang.String message)
Logs a message.


log

protected void log(java.lang.Exception e)
Logs an exception.


log

protected void log(java.lang.String message,
                   java.lang.Exception e)
Logs an exception with a message.



Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.