Apache CXF API

org.apache.cxf.tools.corba.idlpreprocessor
Class IdlPreprocessorReader

java.lang.Object
  extended by java.io.Reader
      extended by org.apache.cxf.tools.corba.idlpreprocessor.IdlPreprocessorReader
All Implemented Interfaces:
Closeable, Readable

public final class IdlPreprocessorReader
extends Reader

A Reader that implements the #include functionality of the preprocessor. Starting from one URL, it generates one stream of characters by tracking #defines, #ifdefs, etc. and following #includes accordingly.

This reader augments the stream with location information when the source URL is switched. This improves error reporting (with correct file and linenumber information) in the subsequent compilation steps like IDL parsing and also allows the implentation of code generation options like the -emitAll flag available in the JDK idlj tool.


Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
IdlPreprocessorReader(URL startURL, String startLocation, IncludeResolver resolver, DefineState state)
          Creates a new IncludeReader.
 
Method Summary
 void close()
           
 String getPragmaPrefix()
           
 int read()
           
 int read(char[] cbuf, int off, int len)
           
 void setPragmaPrefix(String pragmaPrefix)
           
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdlPreprocessorReader

public IdlPreprocessorReader(URL startURL,
                             String startLocation,
                             IncludeResolver resolver,
                             DefineState state)
                      throws IOException
Creates a new IncludeReader.

Parameters:
startURL -
startLocation -
includeResolver -
defineState -
Throws:
IOException
Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class Reader
Throws:
IOException
See Also:
Reader.close()

read

public int read(char[] cbuf,
                int off,
                int len)
         throws IOException
Specified by:
read in class Reader
Throws:
IOException
See Also:
Reader.read(char[], int, int)

read

public int read()
         throws IOException
Overrides:
read in class Reader
Throws:
IOException
See Also:
Reader.read()

setPragmaPrefix

public void setPragmaPrefix(String pragmaPrefix)

getPragmaPrefix

public String getPragmaPrefix()

Apache CXF API

Apache CXF