Class LexicalUnit
- java.lang.Object
-
- org.restlet.ext.rdf.internal.turtle.LexicalUnit
-
- Direct Known Subclasses:
BlankNodeToken,FormulaToken,ListToken,StringToken,Token,UriToken
public abstract class LexicalUnit extends java.lang.ObjectRepresents a lexical unit inside a Turtle document.
-
-
Field Summary
Fields Modifier and Type Field Description private RdfTurtleReadercontentReaderThe content handler of the current Turtle document.private ContextcontextThe context maintained during the parsing.private java.lang.StringvalueThe parsed value as a simple string of characters.
-
Constructor Summary
Constructors Constructor Description LexicalUnit(java.lang.String value)Constructor with value.LexicalUnit(RdfTurtleReader contentReader, Context context)Constructor with arguments.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description RdfTurtleReadergetContentReader()Returns the document's reader.ContextgetContext()Returns the parsing context.java.lang.StringgetValue()Returns the current value.abstract voidparse()Contains the parsing logic of this lexical unit.abstract java.lang.Objectresolve()Resolves the current value as a reference or a literal or a graph of links according to the current context.voidsetContext(Context context)Sets the parsing context.voidsetValue(java.lang.String value)Sets the value.
-
-
-
Field Detail
-
contentReader
private RdfTurtleReader contentReader
The content handler of the current Turtle document.
-
context
private Context context
The context maintained during the parsing.
-
value
private java.lang.String value
The parsed value as a simple string of characters.
-
-
Constructor Detail
-
LexicalUnit
public LexicalUnit(RdfTurtleReader contentReader, Context context)
Constructor with arguments.- Parameters:
contentHandler- The document's parent handler.context- The parsing context.
-
LexicalUnit
public LexicalUnit(java.lang.String value)
Constructor with value.- Parameters:
value- The value of the current lexical unit.
-
-
Method Detail
-
getContentReader
public RdfTurtleReader getContentReader()
Returns the document's reader.- Returns:
- The document's reader.
-
getContext
public Context getContext()
Returns the parsing context.- Returns:
- The parsing context.
-
getValue
public java.lang.String getValue()
Returns the current value.- Returns:
- The current value.
-
parse
public abstract void parse() throws java.io.IOExceptionContains the parsing logic of this lexical unit.- Throws:
java.io.IOException
-
resolve
public abstract java.lang.Object resolve()
Resolves the current value as a reference or a literal or a graph of links according to the current context.- Returns:
- The current value as a reference or a literal or a graph of links according to the current context.
-
setContext
public void setContext(Context context)
Sets the parsing context.- Parameters:
context- The parsing context.
-
setValue
public void setValue(java.lang.String value)
Sets the value.- Parameters:
value- The current value.
-
-