|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jrdf.graph.AbstractLiteral
A base implementation of an RDF Literal
.
Constructor Summary | |
protected |
AbstractLiteral(String newLexicalForm)
Construct a plain literal. |
protected |
AbstractLiteral(String newLexicalForm,
String newLanguage)
Construct a literal with language. |
protected |
AbstractLiteral(String newLexicalForm,
URI newDatatypeURI)
Construct a datatyped literal. |
Method Summary | |
void |
accept(TypedNodeVisitor visitor)
Accept a call from a TypedNodeVisitor. |
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one. |
URI |
getDatatypeURI()
Returns the URI of the RDF datatype of this resource, or null
for a plain literal. |
String |
getEscapedForm()
Provide a legible representation of a literal, following the N-Triples format defined in §3.2 of the W3C's RDF Test Cases Recommendation. |
String |
getEscapedLexicalForm()
Returns an escaped lexical form where double quotes and backslashes are escaped. |
String |
getLanguage()
Returns the language code of the literal. |
String |
getLexicalForm()
Obtain the text of this literal. |
int |
hashCode()
Returns a hash-code value for this literal. |
boolean |
isWellFormedXML()
Whether the literal is well formed XML. |
String |
toString()
Returns the lexical form. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected AbstractLiteral(String newLexicalForm)
newLexicalForm
- the text part of the literal
IllegalArgumentException
- if newLexicalForm is null
protected AbstractLiteral(String newLexicalForm, String newLanguage)
newLexicalForm
- the text part of the literalnewLanguage
- the language code, possibly the empty string but not
null
IllegalArgumentException
- if lexicalForm or
lang are null
protected AbstractLiteral(String newLexicalForm, URI newDatatypeURI)
newLexicalForm
- the text part of the literalnewDatatypeURI
- the URI for a datatyped literal
IllegalArgumentException
- if lexicalForm or
datatype are null
Method Detail |
public String getLexicalForm()
getLexicalForm
in interface Literal
null
public String getLanguage()
String
. Otherwise, this will be null
.
getLanguage
in interface Literal
null
in the case
of a datatyped literal.public boolean isWellFormedXML()
isWellFormedXML
in interface Literal
public URI getDatatypeURI()
null
for a plain literal.
getDatatypeURI
in interface Literal
null
for a plain literal.public void accept(TypedNodeVisitor visitor)
accept
in interface TypedNodeVisitable
visitor
- the object doing the visiting.public boolean equals(Object obj)
Literal
equals
in interface Literal
public int hashCode()
Literal
hashCode
in interface Literal
public String getEscapedForm()
\U
escape sequence rather than a
pair of 4-digit &x5C;u
sequences representing the surrogates.
getEscapedForm
in interface Literal
public String toString()
toString
in interface Literal
public String getEscapedLexicalForm()
Literal
getEscapedLexicalForm
in interface Literal
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |