- All Known Implementing Classes:
PhaseOneSource,PhaseTwoSource,ReaderSource,ReparseSource
public interface Source
Provides the stream of the source file.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getChar()Returns a newSourceCharobject at the current location of this source or EOF.Returns the filename.Returns the current location of this source.voidPushes back the specifiedSourceCharobject.
-
Method Details
-
close
- Throws:
IOException- If an I/O error occurs.
-
getFilename
String getFilename()Returns the filename.- Returns:
- The filename. Or
nullif no filename is specified.
-
getLocation
SourceLocation getLocation()Returns the current location of this source.- Returns:
- The current location.
-
getChar
Returns a newSourceCharobject at the current location of this source or EOF.This method does not change the current location either if the return value represents EOF or is the object that has been pushed back. Otherwise, the current location proceeds the next one.
This method may read two or more characters from the upstream
SourceorReader. It may also replace one or moreSourceCharobjects with anotherSourceCharobject and return it.- Returns:
- The new
SourceCharobject. - Throws:
IOException- If an I/O error occurs.- See Also:
-
ungetChar
Pushes back the specifiedSourceCharobject.The
SourceCharobject to push back must not represent EOF.This method does not change the current location.
- Parameters:
c- TheSourceCharobject to push back.- Throws:
IllegalArgumentException- If the object represents EOF.
-