org.apache.jdo.impl.enhancer
Class OutputStreamWrapper

java.lang.Object
  extended by org.apache.jdo.impl.enhancer.OutputStreamWrapper

public class OutputStreamWrapper
extends java.lang.Object

This class serves as a wrapper for an output stream of a class file. The stream is passed as a parameter to the byte code enhancer, that can sets the classname of the written Java class to the wrapper.
This wrapper is necessary to determine the classname outside the enhancer, after the class has been enhanced, since do do not always know the classname of an opened input stream.


Constructor Summary
OutputStreamWrapper(java.io.OutputStream out)
          Constructs a new object.
 
Method Summary
 java.lang.String getClassName()
          Gets the classname of the written Java class.
 java.io.OutputStream getStream()
          Gets the wrapped output stream.
 void setClassName(java.lang.String classname)
          Sets the name of the written Java class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputStreamWrapper

public OutputStreamWrapper(java.io.OutputStream out)
Constructs a new object.

Parameters:
out - The output stream to wrap.
Method Detail

getStream

public final java.io.OutputStream getStream()
Gets the wrapped output stream.

Returns:
The wrapped output stream.

getClassName

public final java.lang.String getClassName()
Gets the classname of the written Java class. This method should be called after the class has been enhanced.

Returns:
The name of the written Java class.

setClassName

public final void setClassName(java.lang.String classname)
Sets the name of the written Java class. This method should be called by the enhancer.

Parameters:
classname - The name of the Java class.


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.