public class RdfNTriplesReader extends RdfReader
Modifier and Type | Field and Description |
---|---|
int |
EOF
End of reading buffer marker.
|
Constructor and Description |
---|
RdfNTriplesReader(Representation rdfRepresentation,
GraphHandler graphHandler)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
consumeStatement()
Discard all read characters until the end of the statement is reached
(marked by a '.').
|
protected void |
consumeWhiteSpaces()
Discard all read characters.
|
protected void |
discard()
Discard all read characters.
|
protected char |
getChar()
Returns the current parsed character.
|
protected String |
getCurrentToken()
Returns the current token.
|
String |
getParsingMessage()
Returns a message describing the current state of the parsing process.
|
protected String |
getParsingMessage(char[] buffer,
int startTokenIndex,
int scoutIndex)
Returns a message describing the current state of the parsing process.
|
protected boolean |
isAlphaNum(int c)
Returns true if the given character is alphanumeric.
|
protected boolean |
isDelimiter(int c)
Returns true if the given character is a delimiter.
|
protected boolean |
isEndOfFile(int c) |
protected boolean |
isWhiteSpace(int c)
Returns true if the given character is a whitespace.
|
void |
parse()
Parses the current representation.
|
protected void |
parseComment()
Parses a comment.
|
protected void |
parseStatement()
Reads the current statement until its end, and parses it.
|
protected String |
parseToken()
Returns the value of the current token.
|
protected String |
parseUri()
Returns the value of the current URI.
|
protected int |
step()
Read a new character.
|
protected void |
step(int n)
Steps forward.
|
protected void |
stepBack()
Steps back of one step.
|
protected void |
stepBack(int n)
Steps back.
|
getGraphHandler, getRdfRepresentation
public final int EOF
public RdfNTriplesReader(Representation rdfRepresentation, GraphHandler graphHandler) throws IOException
rdfRepresentation
- The representation to read.graphHandler
- The graph handler invoked during the parsing.IOException
protected void consumeStatement() throws IOException
IOException
protected void consumeWhiteSpaces() throws IOException
getCurrentToken
will
return a single character.IOException
protected void discard()
getCurrentToken
will
return a single character.protected char getChar()
protected String getCurrentToken()
public String getParsingMessage()
protected String getParsingMessage(char[] buffer, int startTokenIndex, int scoutIndex)
buffer
- The current buffer.startTokenIndex
- The start index of parsing.scoutIndex
- The index of the probable future token.protected boolean isAlphaNum(int c)
c
- The given character to check.protected boolean isDelimiter(int c)
c
- The given character to check.protected boolean isEndOfFile(int c)
protected boolean isWhiteSpace(int c)
c
- The given character to check.public void parse() throws IOException
parse
in class RdfReader
IOException
protected void parseComment() throws IOException
IOException
protected void parseStatement() throws IOException
context
- The current context.IOException
protected String parseToken() throws IOException
IOException
protected String parseUri() throws IOException
IOException
protected int step() throws IOException
IOException
protected void step(int n) throws IOException
n
- The number of steps to go forward.IOException
protected void stepBack()
protected void stepBack(int n)
n
- The number of steps to go back.Copyright © 2005–2014. All rights reserved.