com.starteam
Class File.KeywordReader

java.lang.Object
  extended by java.io.Reader
      extended by com.starteam.util.LineProcessor
          extended by com.starteam.File.KeywordReader
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable
Enclosing class:
File

public static final class File.KeywordReader
extends LineProcessor

Extends the java.io.Reader class to expand or unexpand keywords in a file or other data source. It is typically unnecessary for client applications to explicitly (un)expand keywords


Constructor Summary
File.KeywordReader(LineReader source, File.Keyword[] keywords, boolean expand)
          Constructs a KeywordReader than can expand or unexpand the keywords in a file or other data source.
File.KeywordReader(LineReader source, File.Keyword[] keywords, boolean expand, Encoding encoding)
          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.
 java.io.Reader processLine(java.lang.String line, int eol)
          Returns a Reader that processes or translates the provided source line.
 void setAppend(boolean append)
          explicitly determine whether or not to append the keyword text to the stream Set this to true only when content is being uploaded to the server or keywords are being expanded back to disk after an add or checkin
 void setEncoding(Encoding encoding)
          Set the encoding to use when expanding keywords
 
Methods inherited from class com.starteam.util.LineProcessor
close, read
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

File.KeywordReader

public File.KeywordReader(LineReader source,
                          File.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

File.KeywordReader

public File.KeywordReader(LineReader source,
                          File.Keyword[] keywords,
                          boolean expand,
                          Encoding encoding)
                   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.
encoding - the encoding to use during expansion
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:
File.EOLFormat

setEncoding

public void setEncoding(Encoding encoding)
Set the encoding to use when expanding keywords

Parameters:
encoding - the encoding to use

setAppend

public void setAppend(boolean append)
explicitly determine whether or not to append the keyword text to the stream Set this to true only when content is being uploaded to the server or keywords are being expanded back to disk after an add or checkin

Parameters:
append - boolean


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.