Package org.htmlcleaner
Class DoctypeToken
java.lang.Object
org.htmlcleaner.BaseTokenImpl
org.htmlcleaner.BaseHtmlNode
org.htmlcleaner.DoctypeToken
HTML doctype token.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
private String
private String
private String
private String
private Integer
The identified DocType, if anystatic final int
private Boolean
static final int
static final int
static final int
static final int
static final int
Fields inherited from class org.htmlcleaner.BaseHtmlNode
parent
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
getName()
getPart1()
getPart2()
getPart3()
Deprecated.getPart4()
Deprecated.This will retrieve the public ID of an externally referenced DTD, or an empty String if none is referenced.This will retrieve the system ID of an externally referenced DTD, or an empty String if none is referenced.int
getType()
This will retrieve an integer representing the identified DocTypeboolean
isValid()
void
serialize
(Serializer serializer, Writer writer) toString()
private void
validate()
Checks the doctype according to W3C parsing rules and tries to identify the type and validity See: http://www.w3.org/TR/html-markup/syntax.html#doctype-syntax http://dev.w3.org/html5/html-author/#doctype-declarationMethods inherited from class org.htmlcleaner.BaseHtmlNode
getParent, getSiblings, setParent
Methods inherited from class org.htmlcleaner.BaseTokenImpl
getCol, getRow, setCol, setRow
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.htmlcleaner.HtmlNode
getParent, getSiblings, setParent
-
Field Details
-
part1
-
part2
-
part3
-
part4
-
type
The identified DocType, if any -
UNKNOWN
public static final int UNKNOWN- See Also:
-
HTML4_0
public static final int HTML4_0- See Also:
-
HTML4_01
public static final int HTML4_01- See Also:
-
HTML4_01_STRICT
public static final int HTML4_01_STRICT- See Also:
-
HTML4_01_TRANSITIONAL
public static final int HTML4_01_TRANSITIONAL- See Also:
-
HTML4_01_FRAMESET
public static final int HTML4_01_FRAMESET- See Also:
-
XHTML1_0_STRICT
public static final int XHTML1_0_STRICT- See Also:
-
XHTML1_0_TRANSITIONAL
public static final int XHTML1_0_TRANSITIONAL- See Also:
-
XHTML1_0_FRAMESET
public static final int XHTML1_0_FRAMESET- See Also:
-
XHTML1_1
public static final int XHTML1_1- See Also:
-
XHTML1_1_BASIC
public static final int XHTML1_1_BASIC- See Also:
-
HTML5
public static final int HTML5- See Also:
-
HTML5_LEGACY_TOOL_COMPATIBLE
public static final int HTML5_LEGACY_TOOL_COMPATIBLE- See Also:
-
valid
-
-
Constructor Details
-
DoctypeToken
-
DoctypeToken
-
-
Method Details
-
clean
-
isValid
public boolean isValid() -
validate
private void validate()Checks the doctype according to W3C parsing rules and tries to identify the type and validity See:- http://www.w3.org/TR/html-markup/syntax.html#doctype-syntax
- http://dev.w3.org/html5/html-author/#doctype-declaration
-
getContent
-
toString
- Overrides:
toString
in classBaseTokenImpl
-
getType
public int getType()This will retrieve an integer representing the identified DocType -
getName
-
serialize
- Specified by:
serialize
in interfaceBaseToken
- Overrides:
serialize
in classBaseHtmlNode
- Throws:
IOException
-
getPublicId
This will retrieve the public ID of an externally referenced DTD, or an empty String if none is referenced. -
getSystemId
This will retrieve the system ID of an externally referenced DTD, or an empty String if none is referenced. -
getPart1
-
getPart2
-
getPart3
Deprecated.Deprecated - use getPublicId() instead- Returns:
- the third part of the DOCSTRING
-
getPart4
Deprecated.Deprecated - use getSystemId() instead- Returns:
- the fourth part of the DOCSTRING
-