org.openide.src
Class DefaultElementPrinter

java.lang.Object
  extended byorg.openide.src.DefaultElementPrinter
All Implemented Interfaces:
ElementPrinter

public class DefaultElementPrinter
extends Object
implements ElementPrinter

A trivial implementation of ElementPrinter. It is backed by the supplied PrintWriter, and by default just prints the text as supplied to that print writer. It does nothing for any of the mark methods, and never throws ElementPrinterInterruptException. Subclasses may use this as an adapter for ElementPrinter, typically providing a nontrivial body for one of the mark methods.


Field Summary
 
Fields inherited from interface org.openide.src.ElementPrinter
BODY_BEGIN, BODY_END, ELEMENT_BEGIN, ELEMENT_END, HEADER_BEGIN, HEADER_END, JAVADOC_BEGIN, JAVADOC_END
 
Constructor Summary
DefaultElementPrinter(PrintWriter writer)
          Create a printer.
 
Method Summary
 void markClass(ClassElement element, int what)
          Mark a notable point in a class element.
 void markConstructor(ConstructorElement element, int what)
          Mark a notable point in a constructor element.
 void markField(FieldElement element, int what)
          Mark a notable point in a field element.
 void markInitializer(InitializerElement element, int what)
          Mark a notable point in a initializer element.
 void markMethod(MethodElement element, int what)
          Mark a notable point in a method element.
 void print(String text)
          Print some text.
 void println(String text)
          Print a line of text with a newline.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultElementPrinter

public DefaultElementPrinter(PrintWriter writer)
Create a printer.

Parameters:
writer - the writer to send printed text to
Method Detail

print

public void print(String text)
Description copied from interface: ElementPrinter
Print some text.

Specified by:
print in interface ElementPrinter
Parameters:
text - the text

println

public void println(String text)
Description copied from interface: ElementPrinter
Print a line of text with a newline.

Specified by:
println in interface ElementPrinter
Parameters:
text - the text

markClass

public void markClass(ClassElement element,
                      int what)
               throws ElementPrinterInterruptException
Description copied from interface: ElementPrinter
Mark a notable point in a class element.

Specified by:
markClass in interface ElementPrinter
Parameters:
element - the element
what - which point
Throws:
ElementPrinterInterruptException - - see class description

markInitializer

public void markInitializer(InitializerElement element,
                            int what)
                     throws ElementPrinterInterruptException
Description copied from interface: ElementPrinter
Mark a notable point in a initializer element.

Specified by:
markInitializer in interface ElementPrinter
Parameters:
element - the element
what - which point
Throws:
ElementPrinterInterruptException - - see class description

markField

public void markField(FieldElement element,
                      int what)
               throws ElementPrinterInterruptException
Description copied from interface: ElementPrinter
Mark a notable point in a field element.

Specified by:
markField in interface ElementPrinter
Parameters:
element - the element
what - which point
Throws:
ElementPrinterInterruptException - - see class description

markConstructor

public void markConstructor(ConstructorElement element,
                            int what)
                     throws ElementPrinterInterruptException
Description copied from interface: ElementPrinter
Mark a notable point in a constructor element.

Specified by:
markConstructor in interface ElementPrinter
Parameters:
element - the element
what - which point
Throws:
ElementPrinterInterruptException - - see class description

markMethod

public void markMethod(MethodElement element,
                       int what)
                throws ElementPrinterInterruptException
Description copied from interface: ElementPrinter
Mark a notable point in a method element.

Specified by:
markMethod in interface ElementPrinter
Parameters:
element - the element
what - which point
Throws:
ElementPrinterInterruptException - - see class description

 

Built on May 3 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.