java.lang.Object
javax.swing.text.html.HTMLEditorKit.Parser
javax.swing.text.html.parser.ParserDelegator
- All Implemented Interfaces:
- Serializable
- See Also:
- Top Examples, Source Code
protected static DTD createDTD(DTD dtd,
String name)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void parse(Reader r,
HTMLEditorKit.ParserCallback cb,
boolean ignoreCharSet)
throws IOException
- See Also:
- HTMLEditorKit.Parser
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[786]Html ParserDelegator example
By Anonymous on 2004/05/18 12:06:46 Rate
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.HTMLEditorKit.ParserCallback;
import javax.swing.text.html.parser.ParserDelegator;
import java.io.Reader;
import java.io.FileReader;
public class HTMLParser extends Object
{
public static void main ( String args [ ] )
{
if ( args.length != 1 )
{
System.err.println ( "usage: java HTMLParser < file > " ) ;
System.exit ( -1 ) ;
}
try
{
HTMLEditorKit.ParserCallback callback =
new HTMLEditorKit.ParserCallback ( )
{
public void handleText ( char [ ] data, int pos )
{
System.out.println ( data ) ;
}
} ;
Reader reader = new FileReader ( args [ 0 ] ) ;
new ParserDelegator ( ) .parse ( reader, callback, false ) ;
}
catch ( Exception e )
{
e.printStackTrace ( ) ;
}
}
}
public ParserDelegator()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected static void setDefaultDTD()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples