Methods Summary |
---|
public void | handleSimpleTag(javax.swing.text.html.HTML$Tag tag, javax.swing.text.MutableAttributeSet attributes, int position)
this.listAttributes(attributes);
|
public void | handleStartTag(javax.swing.text.html.HTML$Tag tag, javax.swing.text.MutableAttributeSet attributes, int position)
this.listAttributes(attributes);
|
private void | listAttributes(javax.swing.text.AttributeSet attributes)
System.out.println();
Enumeration e = attributes.getAttributeNames();
while (e.hasMoreElements()) {
Object name = e.nextElement();
Object value = attributes.getAttribute(name);
if (!attributes.containsAttribute(name.toString(), value)) {
System.out.println("containsAttribute() fails");
}
if (!attributes.isDefined(name.toString())) {
System.out.println("isDefined() fails");
}
System.out.println(name + "=" + value);
}
|
public static void | main(java.lang.String[] args)
ParserGetter kit = new ParserGetter();
HTMLEditorKit.Parser parser = kit.getParser();
HTMLEditorKit.ParserCallback callback
= new ReportAttributes();
try {
URL u = new URL(args[0]);
InputStream in = u.openStream();
InputStreamReader r = new InputStreamReader(in);
parser.parse(r, callback, false);
}
catch (IOException e) {
System.err.println(e);
}
|