HTMLEditorKit.Parser
is an abstract class
so it can't be instantiated directly.
Its subclass, javax.swing.text.html.parser.ParserDelegator
, is concrete. However before you can use it you have to configure it with a DTD using the static methods setDefaultDTD()
and createDTD()
:
protected static void setDefaultDTD()
protected static DTD createDTD(DTD dtd, String name)
The DTD
class has a protected constructor, and many protected methods subclasses can use to build a DTD from scratch, but this is an API only an SGML expert could be expected to use.
Instead, read the HTML DTD from a text file using the DTDParser
class
But there is no DTDParser
class!