com.starbase.starteam
Class KeywordReader

java.lang.Object
  |
  +--java.io.Reader
        |
        +--com.starbase.util.LineProcessor
              |
              +--com.starbase.starteam.KeywordReader

public class KeywordReader
extends LineProcessor

A class that extends the java.io.Reader class that can expand or unexpand keywords in a file or other data source.


Constructor Summary
KeywordReader(LineReader source, Keyword[] keywords, boolean expand)
          Constructs a KeywordReader than can expand or unexpand the keywords in a file or other data source.
KeywordReader(LineReader source, Keyword[] keywords, boolean expand, java.lang.String sEncoding)
          Constructs a KeywordReader than can expand or unexpand the keywords in a file or other data source.
 
Method Summary
 java.io.Reader endofInput()
          This is called when the end of the source input has been reached.
 boolean equals(java.lang.Object source)
          returns true if this object instance is equal to the source
 int hashCode()
          returns a unique hash for all instances of this type
 java.io.Reader processLine(java.lang.String line, int eol)
          Returns a Reader that processes or translates the provided source line.
 void setEncoding(java.lang.String sEncoding)
           
 
Methods inherited from class com.starbase.util.LineProcessor
close, read
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeywordReader

public KeywordReader(LineReader source,
                     Keyword[] keywords,
                     boolean expand)
              throws java.io.IOException
Constructs a KeywordReader than can expand or unexpand the keywords in a file or other data source.

Parameters:
source - the source contents to be expanded or unexpanded. This is typically a file.
keywords - the keyword objects to use for expansion/unexpansion.
expand - if true will expand, if false, unexpand.
Throws:
java.io.IOException - if any error occur accessing the source

KeywordReader

public KeywordReader(LineReader source,
                     Keyword[] keywords,
                     boolean expand,
                     java.lang.String sEncoding)
              throws java.io.IOException
Constructs a KeywordReader than can expand or unexpand the keywords in a file or other data source.

Parameters:
source - the source contents to be expanded or unexpanded. This is typically a file.
keywords - the keyword objects to use for expansion/unexpansion.
expand - if true will expand, if false, unexpand.
Throws:
java.io.IOException - if any error occur accessing the source
Method Detail

endofInput

public java.io.Reader endofInput()
                          throws java.io.IOException
This is called when the end of the source input has been reached. It returns a Reader in case more input is provided by this Reader than is available in the source.

Specified by:
endofInput in class LineProcessor
Returns:
a Reader that may provide more input than was available in the source input.
Throws:
java.io.IOException - if there were any errors accessing the source reader.

processLine

public java.io.Reader processLine(java.lang.String line,
                                  int eol)
                           throws java.io.IOException
Returns a Reader that processes or translates the provided source line.

Specified by:
processLine in class LineProcessor
Parameters:
line - the source line to be processes
eol - the end-of-line type
Returns:
a Reader for the provided source line.
Throws:
java.io.IOException - if anny error occur accessing the source LineReader
See Also:
LineReader.EOL_UNKNOWN, LineReader.EOL_CR, LineReader.EOL_LF, LineReader.EOL_CRLF, LineReader.EOL_EOF

setEncoding

public void setEncoding(java.lang.String sEncoding)

equals

public boolean equals(java.lang.Object source)
returns true if this object instance is equal to the source

Overrides:
equals in class LineProcessor
Parameters:
source - Object the source to comapre with
Returns:
boolean true if this object is equal to the source

hashCode

public int hashCode()
returns a unique hash for all instances of this type

Overrides:
hashCode in class LineProcessor
Returns:
int a unique hash for all instances of this type


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.