FileDocCategorySizeDatePackage
TagStripper.javaAPI DocExample1838Sat Sep 09 21:30:52 BST 2000None

TagStripper

public class TagStripper extends HTMLEditorKit$ParserCallback

Fields Summary
private Writer
out
Constructors Summary
public TagStripper(Writer out)

    this.out = out; 
  
Methods Summary
public voidhandleEndTag(javax.swing.text.html.HTML$Tag tag, int position)

    try {
      out.write(' ");
  //    out.flush(); 
    }
    catch (IOException e) {
      System.err.println(e); 
    }
    
  
public voidhandleSimpleTag(javax.swing.text.html.HTML$Tag tag, javax.swing.text.MutableAttributeSet attributes, int position)

    
    try {
      out.write(' ");
  //    out.flush(); 
    }
    catch (IOException e) {
      System.err.println(e); 
    }
 
  
public voidhandleStartTag(javax.swing.text.html.HTML$Tag tag, javax.swing.text.MutableAttributeSet attributes, int position)

    try {
      out.write(' ");
  //    out.flush(); 
    }
    catch (IOException e) {
      System.err.println(e); 
    }
     
  
public voidhandleText(char[] text, int position)

    try {
      for (int i =0; i < text.length; i++) {
        if (text[i] == '\r" || text [i] == '\n") {
          System.out.println("**********************");
        }
      }
      out.write(text);
  //    out.flush(); 
    }
    catch (IOException e) {
      System.err.println(e); 
    }
  
public static voidmain(java.lang.String[] args)

    
    ParserGetter kit = new ParserGetter();
    HTMLEditorKit.Parser parser = new ParserDelegator(); //kit.getParser();
    HTMLEditorKit.ParserCallback callback 
     = new TagStripper(new OutputStreamWriter(System.out));
    
    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); 
    }