org.apache.tools.ant.util
Class LineTokenizer

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.util.LineTokenizer
All Implemented Interfaces:
Tokenizer

public class LineTokenizer
extends ProjectComponent
implements Tokenizer

class to tokenize the input as lines seperated by \r (mac style), \r\n (dos/windows style) or \n (unix style)

Since:
Ant 1.6

Field Summary
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
LineTokenizer()
           
 
Method Summary
 java.lang.String getPostToken()
          return the string between tokens, after the previous token.
 java.lang.String getToken(java.io.Reader in)
          get the next line from the input
 void setIncludeDelims(boolean includeDelims)
          attribute includedelims - whether to include the line ending with the line, or to return it in the posttoken default false
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, log, log, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineTokenizer

public LineTokenizer()
Method Detail

setIncludeDelims

public void setIncludeDelims(boolean includeDelims)
attribute includedelims - whether to include the line ending with the line, or to return it in the posttoken default false

Parameters:
includeDelims - if true include /r and /n in the line

getToken

public java.lang.String getToken(java.io.Reader in)
                          throws java.io.IOException
get the next line from the input

Specified by:
getToken in interface Tokenizer
Parameters:
in - the input reader
Returns:
the line excluding /r or /n, unless includedelims is set
Throws:
java.io.IOException - if an error occurs reading

getPostToken

public java.lang.String getPostToken()
Description copied from interface: Tokenizer
return the string between tokens, after the previous token.

Specified by:
getPostToken in interface Tokenizer
Returns:
the line ending character(s) for the current line


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.