alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 *                 Sun Public License Notice
 * 
 * The contents of this file are subject to the Sun Public License
 * Version 1.0 (the "License"). You may not use this file except in
 * compliance with the License. A copy of the License is available at
 * http://www.sun.com/
 * 
 * The Original Code is NetBeans. The Initial Developer of the Original
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
 * Microsystems, Inc. All Rights Reserved.
 */

package org.openide.src;

/** Prints elements in a textual form.
* For example code generators use this.
* 

Contains three kinds of public members: *

    *
  • Constants to indicate events occurring while an element is printed, * e.g. {@link #ELEMENT_BEGIN} and {@link #ELEMENT_END}. *
  • Methods to print: {@link #print} and {@link #println}. *
  • A method for each kind of element, such as methods: {@link #markMethod}, etc. * notify about notable points inside the elements. * For example, if a printer implementation wants to print only * the header for a method, it may implement {@link #markMethod} to throw * {@link ElementPrinterInterruptException} to stop the printing there * when it encounters {@link #HEADER_END}. *
* * @author Petr Hamernik */ public interface ElementPrinter { /** Beginning of whole element. */ public static final int ELEMENT_BEGIN = 0; /** End of whole element. */ public static final int ELEMENT_END = 1; /** Beginning of JavaDoc comment (if any). */ public static final int JAVADOC_BEGIN = 2; /** End of JavaDoc comment (if any). */ public static final int JAVADOC_END = 3; /** Beginning of header. * For methods, constructors, and classes. */ public static final int HEADER_BEGIN = 4; /** End of header. * For methods, constructors, and classes. */ public static final int HEADER_END = 5; /** Beginning of body. * For initializers, methods, constructors, and classes. */ public static final int BODY_BEGIN = 6; /** End of body. * For initializers, methods, constructors, and classes. */ public static final int BODY_END = 7; /** Print some text. * @param text the text * @exception ElementPrinterInterruptException - see class description */ public void print(String text) throws ElementPrinterInterruptException; /** Print a line of text with a newline. * @param text the text * @exception ElementPrinterInterruptException - see class description */ public void println(String text) throws ElementPrinterInterruptException; /** Mark a notable point in a class element. * @param element the element * @param what which point * @exception ElementPrinterInterruptException - see class description */ public void markClass(ClassElement element, int what) throws ElementPrinterInterruptException; /** Mark a notable point in a initializer element. * @param element the element * @param what which point * @exception ElementPrinterInterruptException - see class description */ public void markInitializer(InitializerElement element, int what) throws ElementPrinterInterruptException; /** Mark a notable point in a field element. * @param element the element * @param what which point * @exception ElementPrinterInterruptException - see class description */ public void markField(FieldElement element, int what) throws ElementPrinterInterruptException; /** Mark a notable point in a constructor element. * @param element the element * @param what which point * @exception ElementPrinterInterruptException - see class description */ public void markConstructor(ConstructorElement element, int what) throws ElementPrinterInterruptException; /** Mark a notable point in a method element. * @param element the element * @param what which point * @exception ElementPrinterInterruptException - see class description */ public void markMethod(MethodElement element, int what) throws ElementPrinterInterruptException; }
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.