com.lightdev.app.trec.client.stub
Class StubWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.BufferedWriter
          extended by com.lightdev.app.trec.client.stub.StubWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable
Direct Known Subclasses:
ClientStubWriter, ServerStubWriter

public abstract class StubWriter
extends BufferedWriter

Abstract base class for classes wishing to generate Java source code for client and server stubs.

Version:
2, 24.01.2006
Author:
Ulrich Hilger, Light Development, http://www.lightdev.com, info@lightdev.com, published under the terms and conditions of the BSD License, for details see file license.txt in the distribution package of this software

Field Summary
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
StubWriter(Writer out)
          create a new instance of a StubWriter object
StubWriter(Writer out, int sz)
          create a new instance of a StubWriter object
 
Method Summary
protected  boolean isXmlRpcType(org.apache.bcel.generic.Type type)
          determine whether or not a given type is an XML-RPC type XML-RPC types are or java.lang.Integer java.lang.Boolean java.lang.String java.lang.Double java.util.Date byte[ ]
protected  String typeToString(org.apache.bcel.generic.Type type)
          convert a type to a string, when the given type is not a valid XML-RPC type the type string byte[] is returned
protected  void writeLine(String line)
          write out a line and terminate with a new line
 
Methods inherited from class java.io.BufferedWriter
close, flush, newLine, write, write, write
 
Methods inherited from class java.io.Writer
append, append, append, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StubWriter

public StubWriter(Writer out)
create a new instance of a StubWriter object

Parameters:
out - the writer to write to

StubWriter

public StubWriter(Writer out,
                  int sz)
create a new instance of a StubWriter object

Parameters:
out - the writer to write to
sz - the buffer size
Method Detail

writeLine

protected void writeLine(String line)
                  throws IOException
write out a line and terminate with a new line

Parameters:
line - the line to write
Throws:
IOException

typeToString

protected String typeToString(org.apache.bcel.generic.Type type)
convert a type to a string, when the given type is not a valid XML-RPC type the type string byte[] is returned

Parameters:
type - the type to convert
Returns:
the type as string or 'byte[]'

isXmlRpcType

protected boolean isXmlRpcType(org.apache.bcel.generic.Type type)
determine whether or not a given type is an XML-RPC type

XML-RPC types are

     or        java.lang.Integer
               java.lang.Boolean
                java.lang.String
                java.lang.Double
      java.util.Date
                byte[ ]

Parameters:
type - the type to check
Returns:
true if the given type is an XML-RPC type, false if not