com.ptc.windchill.upgrade.directives
Class WriterDirectiveServicesAdapter

java.lang.Object
  extended byjava.io.Writer
      extended bycom.ptc.windchill.upgrade.directives.WriterDirectiveServicesAdapter

public class WriterDirectiveServicesAdapter
extends Writer

Serves as a writer that can be written to by Java Migrators that will write its messages to the directive services.

Design Note

For lack of a better alternative, as contents are written to this writer, they are buffered. When flush is invoked, the buffered contents will be logged as one entry to the wrappered directive serviecs.


Field Summary
private  StringBuffer buffer_
           
private  DirectiveServices directiveServices_
           
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
WriterDirectiveServicesAdapter(DirectiveServices directive_services)
          Create an instance that will log contents to the specified directive services.
 
Method Summary
private  StringBuffer buffer()
           
 void close()
          The concept of closing is undefined; this method does nothing.
private  DirectiveServices directiveServices()
           
 void flush()
          Logs the accumulated buffer on the directive services object.
private  void resetBuffer()
           
 void write(char[] chars)
          Adds the character array to the buffer.
 void write(char[] chars, int position, int length)
          Adds the subsequence of character array from position to position+length to the buffer.
 void write(int c)
          Adds the character represented by the specifed integer value to the buffer.
 void write(String string)
          Adds the string to the buffer.
 void write(String string, int position, int length)
          Adds the substring from position to position+length to the buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

directiveServices_

private DirectiveServices directiveServices_

buffer_

private StringBuffer buffer_
Constructor Detail

WriterDirectiveServicesAdapter

public WriterDirectiveServicesAdapter(DirectiveServices directive_services)
Create an instance that will log contents to the specified directive services.

Method Detail

close

public void close()
The concept of closing is undefined; this method does nothing.


flush

public void flush()
Logs the accumulated buffer on the directive services object.


write

public void write(char[] chars)
Adds the character array to the buffer.


write

public void write(char[] chars,
                  int position,
                  int length)
Adds the subsequence of character array from position to position+length to the buffer.


write

public void write(int c)
Adds the character represented by the specifed integer value to the buffer.


write

public void write(String string)
Adds the string to the buffer.


write

public void write(String string,
                  int position,
                  int length)
Adds the substring from position to position+length to the buffer.


buffer

private StringBuffer buffer()

resetBuffer

private void resetBuffer()

directiveServices

private DirectiveServices directiveServices()