Java Doc for Literal.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » rdf » model » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » RSS RDF » Jena 2.5.5 » com.hp.hpl.jena.rdf.model 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.hp.hpl.jena.rdf.model.Literal

All known Subclasses:   com.hp.hpl.jena.rdf.model.impl.LiteralImpl,
Literal
public interface Literal extends RDFNode(Code)
An RDF Literal.

In RDF2003 literals can be typed. If typed then the literal comprises a datatype, a lexical form and a value (together with an optional xml:lang string). Old style literals have no type and are termed "plain" literals.

Implementations of this interface should be able to support both plain and typed literals. In the case of typed literals the primitive accessor methods such as getInt() determine if the literal value can be coerced to an appropriate java wrapper class. If so then the class is unwrapped to extract the primitive value returned. If the coercion fails then a runtime DatatypeFormatException is thrown.

In the case of plain literals then the primitve accessor methods duplicate the behvaiour of jena1. The literal is internally stored in lexical form but the accessor methods such as getInt will attempt to parse the lexical form and if successful will return the primitive value.

Object (i.e. non-primitive) values are supported. In the case of typed literals then a global TypeMapper registry determines what datatype representation to use for a given Object type. In the case of plain literals then the object will be stored in the lexical form given by its toString method. Factory objects, provided by the application, are needed in that case to covert the lexical form back into the appropriate object type.


author:
   bwm and der
version:
   $Name: $ $Revision: 1.16 $ $Date: 2008/01/02 12:05:46 $




Method Summary
public  booleanequals(Object o)
     Test whether another object is equal to this object.

A plain Literal is equal to another object only if the object is also a plain Literal and the string value and language of both literals are equal.

public  booleangetBoolean()
     If the literal is interpretable as a Boolean return its value as a boolean.
public  bytegetByte()
     If the literal is interpretable as a Byte return its value.
public  chargetChar()
     If the literal is interpretable as a Char return its value.
public  RDFDatatypegetDatatype()
     Return the datatype of the literal.
public  StringgetDatatypeURI()
     Return the uri of the datatype of the literal.
public  doublegetDouble()
     If the literal is interpretable as a Double return its value.
public  floatgetFloat()
     If the literal is interpretable as a Float return its value.
public  intgetInt()
     If the literal is interpretable as a Integer return its value.
public  StringgetLanguage()
    
public  StringgetLexicalForm()
     Return the lexical form of the literal.
public  longgetLong()
     If the literal is interpretable as a Long return its value.
public  ObjectgetObject(ObjectF f)
     In the case of plain literals this recreates an object from its lexical form using the given factory.
public  shortgetShort()
     If the literal is interpretable as a Short return its value.
public  StringgetString()
     If the literal is interpretable as a string return its value.
public  ObjectgetValue()
     Return the value of the literal.
public  booleangetWellFormed()
     Return whether Literal is well formed XML true if the literal is well formed XML, e.g.
public  booleanisWellFormedXML()
     Answer true iff this literal is (or claims to be) well-formed XML.
public  booleansameValueAs(Literal other)
     Test that two literals are semantically equivalent. In some cases this may be the sames as equals, in others equals is stricter.



Method Detail
equals
public boolean equals(Object o)(Code)
Test whether another object is equal to this object.

A plain Literal is equal to another object only if the object is also a plain Literal and the string value and language of both literals are equal. In the case of a typed literal equality is defined by the datatype equality function on the value spaces and may or may not include comparison of the lang strings.


Parameters:
  o - The object to test against true if the the objects are equal, false otherwise



getBoolean
public boolean getBoolean()(Code)
If the literal is interpretable as a Boolean return its value as a boolean. Plain literals are interpreted by parsing their lexical representation, typed literals are interpreted by coercion of the java object representing their value. the literal interpeted as a boolean



getByte
public byte getByte()(Code)
If the literal is interpretable as a Byte return its value. Plain literals are interpreted by parsing their lexical representation, typed literals are interpreted by coercion of the java object representing their value. the literal interpeted as a byte



getChar
public char getChar()(Code)
If the literal is interpretable as a Char return its value. Plain literals are interpreted by parsing their lexical representation, typed literals are interpreted by coercion of the java object representing their value. the literal interpeted as a char



getDatatype
public RDFDatatype getDatatype()(Code)
Return the datatype of the literal. This will be null in the case of plain literals.



getDatatypeURI
public String getDatatypeURI()(Code)
Return the uri of the datatype of the literal. This will be null in the case of plain literals.



getDouble
public double getDouble()(Code)
If the literal is interpretable as a Double return its value. Plain literals are interpreted by parsing their lexical representation, typed literals are interpreted by coercion of the java object representing their value. the literal interpeted as a double



getFloat
public float getFloat()(Code)
If the literal is interpretable as a Float return its value. Plain literals are interpreted by parsing their lexical representation, typed literals are interpreted by coercion of the java object representing their value. the literal interpeted as a float



getInt
public int getInt()(Code)
If the literal is interpretable as a Integer return its value. Plain literals are interpreted by parsing their lexical representation, typed literals are interpreted by coercion of the java object representing their value. the literal interpeted as an int



getLanguage
public String getLanguage()(Code)
If a language is defined for this literal return it the language for this literal if it exists, or empty string if none



getLexicalForm
public String getLexicalForm()(Code)
Return the lexical form of the literal.



getLong
public long getLong()(Code)
If the literal is interpretable as a Long return its value. Plain literals are interpreted by parsing their lexical representation, typed literals are interpreted by coercion of the java object representing their value. the literal interpeted as a long



getObject
public Object getObject(ObjectF f)(Code)
In the case of plain literals this recreates an object from its lexical form using the given factory. In the case of typed literals the factory is ignored and the value is returned instead. the object created from the literal string
Parameters:
  f - A factory object for creating the returned object.



getShort
public short getShort()(Code)
If the literal is interpretable as a Short return its value. Plain literals are interpreted by parsing their lexical representation, typed literals are interpreted by coercion of the java object representing their value. the literal interpeted as a short



getString
public String getString()(Code)
If the literal is interpretable as a string return its value. For typed literals this will throw an error for non string literals and one needs to use getLexicalForm to return the string form of other datatypes. the literal string



getValue
public Object getValue()(Code)
Return the value of the literal. In the case of plain literals this will return the literal string. In the case of typed literals it will return a java object representing the value. In the case of typed literals representing a java primitive then the appropriate java wrapper class (Integer etc) will be returned.



getWellFormed
public boolean getWellFormed()(Code)
Return whether Literal is well formed XML true if the literal is well formed XML, e.g. aswould be produced from a parseType="Literal"element.



isWellFormedXML
public boolean isWellFormedXML()(Code)
Answer true iff this literal is (or claims to be) well-formed XML.



sameValueAs
public boolean sameValueAs(Literal other)(Code)
Test that two literals are semantically equivalent. In some cases this may be the sames as equals, in others equals is stricter. For example, two xsd:int literals with the same value but different language tag are semantically equivalent but distinguished by the java equality function in order to support round tripping.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.