Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.javahispano.canyamo.util.html.validator
Class HTMLParser  view HTMLParser download HTMLParser.java

java.lang.Object
  extended byjavax.swing.text.html.HTMLEditorKit.ParserCallback
      extended byorg.javahispano.canyamo.util.html.validator.HTMLParser
Direct Known Subclasses:
HTMLRelaxedParser

class HTMLParser
extends javax.swing.text.html.HTMLEditorKit.ParserCallback

This class is an HTML callback used when parsing HTML code. It has callback methods that are called through the parsing process.

Version:
1.0

Field Summary
private  java.lang.StringBuffer result
          Description of the Field
private  boolean smilies
          Description of the Field
private static java.lang.String[] strSmilies
          Description of the Field
private static java.lang.String[] urlSmilies
          Description of the Field
 
Fields inherited from class javax.swing.text.html.HTMLEditorKit.ParserCallback
IMPLIED
 
Constructor Summary
(package private) HTMLParser()
          Constructor
 
Method Summary
protected  java.lang.String addSmilies(java.lang.String texto)
          Detects if some text have smilies and in that case add the corresponding images
 java.lang.String getAttributes(javax.swing.text.AttributeSet attributes)
          Gets an attributes set string representation
 java.lang.String getResult()
          Gets the HTML code parsed
 void handleEndOfLineString(java.lang.String eol)
          Callback method that is called when an eol tag is found
 void handleEndTag(javax.swing.text.html.HTML.Tag tag, int position)
          Callback method that is called when an end tag is found.
 void handleSimpleTag(javax.swing.text.html.HTML.Tag tag, javax.swing.text.MutableAttributeSet attributes, int position)
          Callback method that is called when a simple HTML tag is found.
 void handleStartTag(javax.swing.text.html.HTML.Tag tag, javax.swing.text.MutableAttributeSet attributes, int position)
          Callback method that is called when a start tag is found.
 void handleText(char[] text, int position)
          Callback method that is called when some text is found
protected  boolean isAllowed(javax.swing.text.html.HTML.Tag tag)
          Tells us if one HTML tag is allowed.
 boolean isSmiliesAllowed()
          ¿Are smilies allowed?
 void setSmiliesAllowed(boolean b)
          Sets if smilies are allowed
 
Methods inherited from class javax.swing.text.html.HTMLEditorKit.ParserCallback
flush, handleComment, handleError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

strSmilies

private static final java.lang.String[] strSmilies
Description of the Field


urlSmilies

private static final java.lang.String[] urlSmilies
Description of the Field


result

private java.lang.StringBuffer result
Description of the Field


smilies

private boolean smilies
Description of the Field

Constructor Detail

HTMLParser

HTMLParser()
Constructor

Method Detail

setSmiliesAllowed

public void setSmiliesAllowed(boolean b)
Sets if smilies are allowed


getResult

public java.lang.String getResult()
Gets the HTML code parsed


getAttributes

public java.lang.String getAttributes(javax.swing.text.AttributeSet attributes)
Gets an attributes set string representation


isSmiliesAllowed

public boolean isSmiliesAllowed()
¿Are smilies allowed?


handleStartTag

public void handleStartTag(javax.swing.text.html.HTML.Tag tag,
                           javax.swing.text.MutableAttributeSet attributes,
                           int position)
Callback method that is called when a start tag is found. Example of start tags are ,,...


handleSimpleTag

public void handleSimpleTag(javax.swing.text.html.HTML.Tag tag,
                            javax.swing.text.MutableAttributeSet attributes,
                            int position)
Callback method that is called when a simple HTML tag is found. Simple HTML tags are those like
,

, , etc.


handleEndTag

public void handleEndTag(javax.swing.text.html.HTML.Tag tag,
                         int position)
Callback method that is called when an end tag is found. Example of end tags are , ,etc.


handleText

public void handleText(char[] text,
                       int position)
Callback method that is called when some text is found


handleEndOfLineString

public void handleEndOfLineString(java.lang.String eol)
Callback method that is called when an eol tag is found


isAllowed

protected boolean isAllowed(javax.swing.text.html.HTML.Tag tag)
Tells us if one HTML tag is allowed. Be careful, only allowed HTML tags will be parsed

Allowed tags:

B, I, U, OL, UL, LI, A, BR


addSmilies

protected java.lang.String addSmilies(java.lang.String texto)
Detects if some text have smilies and in that case add the corresponding images