com.sun.jdo.api.persistence.enhancer
Class OutputStreamWrapper

java.lang.Object
  extended by com.sun.jdo.api.persistence.enhancer.OutputStreamWrapper

public class OutputStreamWrapper
extends 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(OutputStream out)
          Constructs a new object.
 
Method Summary
 String getClassName()
          Gets the classname of the written Java class.
 OutputStream getStream()
          Gets the wrapped output stream.
 void setClassName(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(OutputStream out)
Constructs a new object.

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

getStream

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

Returns:
The wrapped output stream.
See Also:
out

getClassName

public final 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.
See Also:
className

setClassName

public final void setClassName(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.
See Also:
className


Copyright © 2012. All Rights Reserved.