FileDocCategorySizeDatePackage
ReportAttributes.javaAPI DocExample1545Sat Sep 09 19:55:50 BST 2000None

ReportAttributes

public class ReportAttributes extends HTMLEditorKit$ParserCallback

Fields Summary
Constructors Summary
Methods Summary
public voidhandleSimpleTag(javax.swing.text.html.HTML$Tag tag, javax.swing.text.MutableAttributeSet attributes, int position)

    this.listAttributes(attributes);     
  
public voidhandleStartTag(javax.swing.text.html.HTML$Tag tag, javax.swing.text.MutableAttributeSet attributes, int position)

    this.listAttributes(attributes);
  
private voidlistAttributes(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 voidmain(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); 
    }