KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jode > flow > DescriptionBlock


1 /* DescriptionBlock Copyright (C) 1998-2002 Jochen Hoenicke.
2  *
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU Lesser General Public License as published by
5  * the Free Software Foundation; either version 2, or (at your option)
6  * any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program; see the file COPYING.LESSER. If not, write to
15  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
16  *
17  * $Id: DescriptionBlock.java,v 1.3.4.1 2002/05/28 17:34:09 hoenicke Exp $
18  */

19
20 package jode.flow;
21 import jode.decompiler.TabbedPrintWriter;
22
23 /**
24  * This is a block which contains a comment/description of what went
25  * wrong. Use this, if you want to tell the user, that a construct
26  * doesn't have the exspected form.
27  *
28  * @author Jochen Hoenicke
29  */

30 public class DescriptionBlock extends StructuredBlock {
31     String JavaDoc description;
32
33     public DescriptionBlock(String JavaDoc description) {
34         this.description = description;
35     }
36
37     /**
38      * Tells if this block is empty and only changes control flow.
39      */

40     public boolean isEmpty() {
41         return true;
42     }
43
44     public void dumpInstruction(TabbedPrintWriter writer)
45     throws java.io.IOException JavaDoc
46     {
47         writer.println(description);
48     }
49 }
50
Popular Tags