org.w3c.tidy
Class Node

java.lang.Object
  extended by org.w3c.tidy.Node

public class Node
extends java.lang.Object

Node (c) 1998-2000 (W3C) MIT, INRIA, Keio University See Tidy.java for the copyright notice. Derived from HTML Tidy Release 4 Aug 2000

Version:
1.0, 1999/05/22, 1.0.1, 1999/05/29, 1.1, 1999/06/18 Java Bean, 1.2, 1999/07/10 Tidy Release 7 Jul 1999, 1.3, 1999/07/30 Tidy Release 26 Jul 1999, 1.4, 1999/09/04 DOM support, 1.5, 1999/10/23 Tidy Release 27 Sep 1999, 1.6, 1999/11/01 Tidy Release 22 Oct 1999, 1.7, 1999/12/06 Tidy Release 30 Nov 1999, 1.8, 2000/01/22 Tidy Release 13 Jan 2000, 1.9, 2000/06/03 Tidy Release 30 Apr 2000, 1.10, 2000/07/22 Tidy Release 8 Jul 2000, 1.11, 2000/08/16 Tidy Release 4 Aug 2000
Author:
Dave Raggett , Andy Quick (translation to Java)

Field Summary
protected  Node adapter
           
static short AspTag
           
protected  AttVal attributes
           
static short CDATATag
           
protected  boolean closed
           
static short CommentTag
           
protected  Node content
           
static short DocTypeTag
           
protected  java.lang.String element
           
protected  int end
           
static short EndTag
           
protected  boolean implicit
           
static short JsteTag
           
protected  Node last
           
protected  boolean linebreak
           
protected  Node next
           
protected  Node parent
           
static short PhpTag
           
protected  Node prev
           
static short ProcInsTag
           
static short RootNode
           
static short SectionTag
           
protected  int start
           
static short StartEndTag
           
static short StartTag
           
protected  Dict tag
           
protected  byte[] textarray
           
static short TextNode
           
protected  short type
           
protected  Dict was
           
 
Constructor Summary
Node()
           
Node(short type, byte[] textarray, int start, int end)
           
Node(short type, byte[] textarray, int start, int end, java.lang.String element, TagTable tt)
           
 
Method Summary
 void addAttribute(java.lang.String name, java.lang.String value)
           
static void addClass(Node node, java.lang.String classname)
           
 void checkAttributes(Lexer lexer)
           
 boolean checkNodeIntegrity()
           
 void checkUniqueAttributes(Lexer lexer)
           
protected  java.lang.Object clone()
           
protected  Node cloneNode(boolean deep)
           
static void coerceNode(Lexer lexer, Node node, Dict tag)
           
 void discardDocType()
           
static Node discardElement(Node element)
           
 Node findBody(TagTable tt)
           
 Node findDocType()
           
 Node findHEAD(TagTable tt)
           
 Node findHTML(TagTable tt)
           
static void fixEmptyRow(Lexer lexer, Node row)
           
protected  Node getAdapter()
           
 AttVal getAttrByName(java.lang.String name)
           
 boolean hasOneChild()
           
static void insertDocType(Lexer lexer, Node element, Node doctype)
           
static boolean insertMisc(Node element, Node node)
           
static void insertNodeAfterElement(Node element, Node node)
           
static void insertNodeAsParent(Node element, Node node)
           
static void insertNodeAtEnd(Node element, Node node)
           
static void insertNodeAtStart(Node element, Node node)
           
static void insertNodeBeforeElement(Node element, Node node)
           
 boolean isDescendantOf(Dict tag)
           
 boolean isElement()
           
static boolean isNewNode(Node node)
           
static void moveBeforeTable(Node row, Node node, TagTable tt)
           
 void removeAttribute(AttVal attr)
           
static void removeNode(Node node)
           
protected  void setType(short newType)
           
 java.lang.String toString()
           
static void trimEmptyElement(Lexer lexer, Node element)
           
static void trimInitialSpace(Lexer lexer, Node element, Node text)
           
static void trimSpaces(Lexer lexer, Node element)
           
static void trimTrailingSpace(Lexer lexer, Node element, Node last)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RootNode

public static final short RootNode
See Also:
Constant Field Values

DocTypeTag

public static final short DocTypeTag
See Also:
Constant Field Values

CommentTag

public static final short CommentTag
See Also:
Constant Field Values

ProcInsTag

public static final short ProcInsTag
See Also:
Constant Field Values

TextNode

public static final short TextNode
See Also:
Constant Field Values

StartTag

public static final short StartTag
See Also:
Constant Field Values

EndTag

public static final short EndTag
See Also:
Constant Field Values

StartEndTag

public static final short StartEndTag
See Also:
Constant Field Values

CDATATag

public static final short CDATATag
See Also:
Constant Field Values

SectionTag

public static final short SectionTag
See Also:
Constant Field Values

AspTag

public static final short AspTag
See Also:
Constant Field Values

JsteTag

public static final short JsteTag
See Also:
Constant Field Values

PhpTag

public static final short PhpTag
See Also:
Constant Field Values

parent

protected Node parent

prev

protected Node prev

next

protected Node next

last

protected Node last

start

protected int start

end

protected int end

textarray

protected byte[] textarray

type

protected short type

closed

protected boolean closed

implicit

protected boolean implicit

linebreak

protected boolean linebreak

was

protected Dict was

tag

protected Dict tag

element

protected java.lang.String element

attributes

protected AttVal attributes

content

protected Node content

adapter

protected Node adapter
Constructor Detail

Node

public Node()

Node

public Node(short type,
            byte[] textarray,
            int start,
            int end)

Node

public Node(short type,
            byte[] textarray,
            int start,
            int end,
            java.lang.String element,
            TagTable tt)
Method Detail

clone

protected java.lang.Object clone()
Overrides:
clone in class java.lang.Object

getAttrByName

public AttVal getAttrByName(java.lang.String name)

checkAttributes

public void checkAttributes(Lexer lexer)

checkUniqueAttributes

public void checkUniqueAttributes(Lexer lexer)

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.String value)

removeAttribute

public void removeAttribute(AttVal attr)

findDocType

public Node findDocType()

discardDocType

public void discardDocType()

discardElement

public static Node discardElement(Node element)

insertNodeAtStart

public static void insertNodeAtStart(Node element,
                                     Node node)

insertNodeAtEnd

public static void insertNodeAtEnd(Node element,
                                   Node node)

insertNodeAsParent

public static void insertNodeAsParent(Node element,
                                      Node node)

insertNodeBeforeElement

public static void insertNodeBeforeElement(Node element,
                                           Node node)

insertNodeAfterElement

public static void insertNodeAfterElement(Node element,
                                          Node node)

trimEmptyElement

public static void trimEmptyElement(Lexer lexer,
                                    Node element)

trimTrailingSpace

public static void trimTrailingSpace(Lexer lexer,
                                     Node element,
                                     Node last)

trimInitialSpace

public static void trimInitialSpace(Lexer lexer,
                                    Node element,
                                    Node text)

trimSpaces

public static void trimSpaces(Lexer lexer,
                              Node element)

isDescendantOf

public boolean isDescendantOf(Dict tag)

insertDocType

public static void insertDocType(Lexer lexer,
                                 Node element,
                                 Node doctype)

findBody

public Node findBody(TagTable tt)

isElement

public boolean isElement()

moveBeforeTable

public static void moveBeforeTable(Node row,
                                   Node node,
                                   TagTable tt)

fixEmptyRow

public static void fixEmptyRow(Lexer lexer,
                               Node row)

coerceNode

public static void coerceNode(Lexer lexer,
                              Node node,
                              Dict tag)

removeNode

public static void removeNode(Node node)

insertMisc

public static boolean insertMisc(Node element,
                                 Node node)

isNewNode

public static boolean isNewNode(Node node)

hasOneChild

public boolean hasOneChild()

findHTML

public Node findHTML(TagTable tt)

findHEAD

public Node findHEAD(TagTable tt)

checkNodeIntegrity

public boolean checkNodeIntegrity()

addClass

public static void addClass(Node node,
                            java.lang.String classname)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getAdapter

protected Node getAdapter()

cloneNode

protected Node cloneNode(boolean deep)

setType

protected void setType(short newType)