|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
com.martiansoftware.snip.util.MacroInputStream
TODO: write docs.
Field Summary | |
static java.lang.String |
DEFAULT_MACROEND
The default indicator of the end of a macro. |
static java.lang.String |
DEFAULT_MACROSTART
The default indicator of the beginning of a macro. |
static int |
DEFAULT_MAXMACROLENGTH
The default maximum lookahead when reading macros. |
Fields inherited from class java.io.FilterInputStream |
in |
Constructor Summary | |
MacroInputStream(java.io.InputStream in,
MacroProcessor processor)
Creates a new MacroInputStream wrapping the specified InputStream and using the specified MacroProcessor. |
|
MacroInputStream(java.io.InputStream in,
MacroProcessor processor,
int maxMacroLength)
Creates a new MacroInputStream wrapping the specified InputStream and using the specified MacroProcessor and maximum macro lookahead. |
Method Summary | |
java.lang.String |
getMacroEnd()
Returns the macro end delimiter. |
java.lang.String |
getMacroStart()
Returns the macro start delimiter. |
int |
getMaxBufSize()
Returns the maxBufSize. |
int |
getMaxLeftRecursionDepth()
Returns the maxLeftRecursionDepth. |
int |
getMaxMacroLength()
Returns the max macro lookahead. |
int |
read()
Returns the next character from the underlying InputStream, performing macro evaluations along the way. |
int |
read(byte[] b)
Reads into the specified byte array, filling it if possible. |
int |
read(byte[] b,
int offset,
int length)
Attempts to read length bytes into the specified byte array,
beginning at index offset . |
void |
setMacroDelimiters(java.lang.String macroStart,
java.lang.String macroEnd)
Sets the macro start and end delimiters. |
void |
setMacroEnd(java.lang.String macroEnd)
Sets the macro end indicator. |
void |
setMacroStart(java.lang.String macroStart)
Sets the macro start indicator. |
void |
setMaxBufSize(int maxBufSize)
Sets the maxBufSize. |
void |
setMaxLeftRecursionDepth(int maxLeftRecursionDepth)
Sets the maxLeftRecursionDepth. |
void |
setMaxMacroLength(int maxMacroLength)
Sets the max macro lookahead to use. |
Methods inherited from class java.io.FilterInputStream |
available, close, mark, markSupported, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_MAXMACROLENGTH
public static final java.lang.String DEFAULT_MACROSTART
public static final java.lang.String DEFAULT_MACROEND
Constructor Detail |
public MacroInputStream(java.io.InputStream in, MacroProcessor processor)
in
- the InputStream to wrap.processor
- the MacroProcessor to use.public MacroInputStream(java.io.InputStream in, MacroProcessor processor, int maxMacroLength)
in
- the InputStream to wrap.processor
- the MacroProcessor to use.maxMacroLength
- the maximum macro lookahead to use.Method Detail |
public void setMaxMacroLength(int maxMacroLength)
maxMacroLength
- the max macro lookahead to use.public int getMaxMacroLength()
public void setMacroStart(java.lang.String macroStart)
macroStart
- the macro start indicator.public void setMacroEnd(java.lang.String macroEnd)
macroEnd
- the macro end indicator.public java.lang.String getMacroStart()
public java.lang.String getMacroEnd()
public void setMacroDelimiters(java.lang.String macroStart, java.lang.String macroEnd)
macroStart
- the macro start delimiter.macroEnd
- the macro end delimiter.public int read() throws java.io.IOException
java.io.IOException
- if an IO error occurs.public int read(byte[] b) throws java.io.IOException
b
- the array into which to read
java.io.IOException
- if an I/O error occurspublic int read(byte[] b, int offset, int length) throws java.io.IOException
length
bytes into the specified byte array,
beginning at index offset
.
b
- the array into which to readoffset
- the beginning index at which the array should be filledlength
- the maximum number of bytes to read
java.io.IOException
- if an I/O error occurspublic int getMaxBufSize()
public int getMaxLeftRecursionDepth()
public void setMaxBufSize(int maxBufSize)
maxBufSize
- The maxBufSize to setpublic void setMaxLeftRecursionDepth(int maxLeftRecursionDepth)
maxLeftRecursionDepth
- The maxLeftRecursionDepth to set
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |