au.gov.tas.dpiwe.mr.tool
Class EntitySourceFileRewriter

java.lang.Object
  extended by java.io.Reader
      extended by java.io.BufferedReader
          extended by au.gov.tas.dpiwe.mr.tool.EntitySourceFileScanner
              extended by au.gov.tas.dpiwe.mr.tool.EntitySourceFileRewriter
All Implemented Interfaces:
Closeable, Readable

public class EntitySourceFileRewriter
extends EntitySourceFileScanner

EntitySourceFileRewriter is currently a very primitive Java/Groovy source file rewriter which can be used to comment out import lines of the form:

import <subpackage of business object package> .
 <EJB bean type> as <EJB interface name>;

Since:
Mr Architecture 1.0
Version:
1.0.1.0
Author:
Kade Hansson

Field Summary
 
Fields inherited from class au.gov.tas.dpiwe.mr.tool.EntitySourceFileScanner
messenger
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
EntitySourceFileRewriter(Reader reader)
          Creates a new entity source file rewriter.
EntitySourceFileRewriter(Reader reader, Messenger messenger)
          Creates a new entity source file rewriter with logging enabled.
 
Method Summary
 boolean rewriteEntitySourceFile(PrintWriter copy, String businessPackageBase)
          Copies the file, except for matching import clauses.
 
Methods inherited from class au.gov.tas.dpiwe.mr.tool.EntitySourceFileScanner
scanEntitySourceFile
 
Methods inherited from class java.io.BufferedReader
close, mark, markSupported, read, read, readLine, ready, reset, skip
 
Methods inherited from class java.io.Reader
read, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntitySourceFileRewriter

public EntitySourceFileRewriter(Reader reader)
                         throws IOException
Creates a new entity source file rewriter.

Parameters:
reader - the reader from which the source file is waiting to be read.
Throws:
IOException - if the reader cannot be suitably buffered.

EntitySourceFileRewriter

public EntitySourceFileRewriter(Reader reader,
                                Messenger messenger)
                         throws IOException
Creates a new entity source file rewriter with logging enabled.

Parameters:
reader - the reader from which the source file is waiting to be read.
messenger - the messenger to log to.
Throws:
IOException - if the reader cannot be suitably buffered.
Method Detail

rewriteEntitySourceFile

public boolean rewriteEntitySourceFile(PrintWriter copy,
                                       String businessPackageBase)
                                throws IOException
Copies the file, except for matching import clauses.

Parameters:
copy - the stream to copy the file's actual contents to.
Throws:
IOException - if the input file could not be read.