Class DoctypeToken
java.lang.Object
org.htmlcleaner.BaseTokenImpl
org.htmlcleaner.BaseHtmlNode
org.htmlcleaner.DoctypeToken
HTML doctype token.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intprivate Stringprivate Stringprivate Stringprivate Stringprivate IntegerThe identified DocType, if anystatic final intprivate Booleanstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class BaseHtmlNode
parent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate StringgetName()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.intgetType()This will retrieve an integer representing the identified DocTypebooleanisValid()voidserialize(Serializer serializer, Writer writer) toString()private voidvalidate()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 BaseHtmlNode
getParent, getSiblings, setParentMethods inherited from class BaseTokenImpl
getCol, getRow, setCol, setRowMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface 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:
toStringin classBaseTokenImpl
-
getType
public int getType()This will retrieve an integer representing the identified DocType -
getName
-
serialize
- Specified by:
serializein interfaceBaseToken- Overrides:
serializein 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
-