1 | // |
2 | // (c) Copyright, Moebius Solutions, 2002 |
3 | // |
4 | // All Rights Reserved |
5 | // |
6 | // This material may be reproduced by or for the U. S. Government |
7 | // pursuant to the copyright license under the clause at |
8 | // DFARS 252.227-7013 (OCT 1988). |
9 | // |
10 | /* |
11 | * $Id: TypePrinter.java,v 1.1.1.5 2004/05/25 20:23:30 hastings Exp $ |
12 | */ |
13 | package com.moesol.generator.printer; |
14 | |
15 | import java.io.*; |
16 | |
17 | public abstract class TypePrinter { |
18 | public abstract void print(Class type, Writer out) throws IOException; |
19 | public String toString(Class type) { |
20 | try { |
21 | StringWriter sw = new StringWriter(); |
22 | print(type, sw); |
23 | return sw.toString(); |
24 | } catch (IOException e) { |
25 | throw new RuntimeException(e); |
26 | } |
27 | } |
28 | } |