org.util.html.objects
Class HTMLObject

java.lang.Object
  extended by org.util.html.objects.HTMLObject
All Implemented Interfaces:
ParserPolicy
Direct Known Subclasses:
HTMLImg, HTMLText

public abstract class HTMLObject
extends java.lang.Object
implements ParserPolicy


Field Summary
protected  java.lang.String[] forse_empty_tag_list_
           
 
Constructor Summary
HTMLObject(HTMLDocument root)
           
 
Method Summary
 Element allowElement(Element element)
          called when element is detected.
 boolean checkEndTag()
          if true, check open tag key and close tag key.
 boolean finished()
           
 boolean forceEmptyTag(java.lang.String key)
          Basicly, all the tag must open and close.
 ParserPolicy getInnerPolicy(Element element)
          return handler that handle this element
 int getNextX()
           
 int getNextY()
           
abstract  javax.swing.JComponent getPanel()
           
 HTMLDocument getRoot()
           
 boolean isLayouted()
           
 java.lang.String selectEncoding(java.lang.String last_tag_key)
          if encoding cannot be detected by first line of document, this method will be called.
 void setLayouted(boolean is_layouted)
           
 void setNextXY(int next_x, int next_y)
           
 boolean throwExceptionIfDocumentHasError()
          Throw exception if document has error.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

forse_empty_tag_list_

protected java.lang.String[] forse_empty_tag_list_
Constructor Detail

HTMLObject

public HTMLObject(HTMLDocument root)
Method Detail

getRoot

public HTMLDocument getRoot()

setLayouted

public void setLayouted(boolean is_layouted)

isLayouted

public boolean isLayouted()

getNextX

public int getNextX()

getNextY

public int getNextY()

setNextXY

public void setNextXY(int next_x,
                      int next_y)

getPanel

public abstract javax.swing.JComponent getPanel()

allowElement

public Element allowElement(Element element)
Description copied from interface: ParserPolicy
called when element is detected.

Specified by:
allowElement in interface ParserPolicy

checkEndTag

public boolean checkEndTag()
Description copied from interface: ParserPolicy
if true, check open tag key and close tag key.

Specified by:
checkEndTag in interface ParserPolicy

forceEmptyTag

public boolean forceEmptyTag(java.lang.String key)
Description copied from interface: ParserPolicy
Basicly, all the tag must open and close. But if this method return true, opentag will be considerd to empty tag. So end tag will disregarded.

Specified by:
forceEmptyTag in interface ParserPolicy

getInnerPolicy

public ParserPolicy getInnerPolicy(Element element)
Description copied from interface: ParserPolicy
return handler that handle this element

Specified by:
getInnerPolicy in interface ParserPolicy

selectEncoding

public java.lang.String selectEncoding(java.lang.String last_tag_key)
Description copied from interface: ParserPolicy
if encoding cannot be detected by first line of document, this method will be called. while returned null, this method will be called every time that tag detected.

Specified by:
selectEncoding in interface ParserPolicy

throwExceptionIfDocumentHasError

public boolean throwExceptionIfDocumentHasError()
Description copied from interface: ParserPolicy
Throw exception if document has error. In case this method returns false, if there are errors, skip some texts and continue parsing.

Specified by:
throwExceptionIfDocumentHasError in interface ParserPolicy

finished

public boolean finished()
Specified by:
finished in interface ParserPolicy