Java Doc for XSDDatatype.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » datatypes » xsd » 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.datatypes.xsd 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.hp.hpl.jena.datatypes.BaseDatatype
      com.hp.hpl.jena.datatypes.xsd.XSDDatatype

All known Subclasses:   com.hp.hpl.jena.datatypes.xsd.impl.XSDDouble,  com.hp.hpl.jena.datatypes.xsd.XSDhexBinary,  com.hp.hpl.jena.datatypes.xsd.impl.XSDFloat,  com.hp.hpl.jena.datatypes.xsd.impl.XSDBaseNumericType,  com.hp.hpl.jena.datatypes.xsd.impl.XSDAbstractDateTimeType,  com.hp.hpl.jena.datatypes.xsd.impl.XSDBaseStringType,  com.hp.hpl.jena.datatypes.xsd.XSDbase64Binary,  com.hp.hpl.jena.datatypes.xsd.impl.XSDGenericType,
XSDDatatype
public class XSDDatatype extends BaseDatatype (Code)
Representation of an XSD datatype based on the Xerces-2 XSD implementation.
author:
   Dave Reynolds
version:
   $Revision: 1.15 $ on $Date: 2008/01/02 12:10:49 $


Field Summary
final public static  StringXSD
    
final public static  XSDDatatypeXSDENTITY
    
final public static  XSDDatatypeXSDID
    
final public static  XSDDatatypeXSDIDREF
    
final public static  XSDDatatypeXSDNCName
    
final public static  XSDDatatypeXSDNMTOKEN
    
final public static  XSDDatatypeXSDNOTATION
    
final public static  XSDDatatypeXSDName
    
final public static  XSDDatatypeXSDQName
    
final public static  XSDDatatypeXSDanyURI
    
final public static  XSDDatatypeXSDbase64Binary
    
final public static  XSDDatatypeXSDboolean
    
final public static  XSDDatatypeXSDbyte
    
final public static  XSDDatatypeXSDdate
    
final public static  XSDDatatypeXSDdateTime
    
final public static  XSDDatatypeXSDdecimal
    
final public static  XSDDatatypeXSDdouble
    
final public static  XSDDatatypeXSDduration
    
final public static  XSDDatatypeXSDfloat
    
final public static  XSDDatatypeXSDgDay
    
final public static  XSDDatatypeXSDgMonth
    
final public static  XSDDatatypeXSDgMonthDay
    
final public static  XSDDatatypeXSDgYear
    
final public static  XSDDatatypeXSDgYearMonth
    
final public static  XSDDatatypeXSDhexBinary
    
final public static  XSDDatatypeXSDint
    
final public static  XSDDatatypeXSDinteger
    
final public static  XSDDatatypeXSDlanguage
    
final public static  XSDDatatypeXSDlong
    
final public static  XSDDatatypeXSDnegativeInteger
    
final public static  XSDDatatypeXSDnonNegativeInteger
    
final public static  XSDDatatypeXSDnonPositiveInteger
    
final public static  XSDDatatypeXSDnormalizedString
    
final public static  XSDDatatypeXSDpositiveInteger
    
final public static  XSDDatatypeXSDshort
    
final public static  XSDDatatypeXSDstring
    
final public static  XSDDatatypeXSDtime
    
final public static  XSDDatatypeXSDtoken
    
final public static  XSDDatatypeXSDunsignedByte
    
final public static  XSDDatatypeXSDunsignedInt
    
final public static  XSDDatatypeXSDunsignedLong
    
final public static  XSDDatatypeXSDunsignedShort
    
final static  DecimalDVdecimalDV
    
protected  ClassjavaClass
    
protected  XSSimpleTypetypeDeclaration
    

Constructor Summary
public  XSDDatatype(String typeName)
     Constructor.
public  XSDDatatype(String typeName, Class javaClass)
     Constructor.
public  XSDDatatype(XSSimpleType xstype, String namespace)
     Constructor used when loading in external user defined XSD types - should only be used by the internals but public scope because the internals spread across multiple packages.

Method Summary
public  ObjectconvertValidatedDataValue(ValidatedInfo validatedInfo)
     Convert a validated xerces data value into the corresponding java data value. This function is currently the most blatently xerces-version dependent part of this subsystem.
public  ObjectextendedTypeDefinition()
     Returns the Xerces datatype representation for this type, this is an XSSimpleType, in fact an XSSimpleTypeDecl.
public  intgetHashCode(byte[] bytes)
    
public  ClassgetJavaClass()
     If this datatype is used as the cannonical representation for a particular java datatype then return that java type, otherwise returns null.
public  booleanisBaseTypeCompatible(LiteralLabel lit)
     Test if the given typed value is in the right partition of the XSD type space.
public  booleanisEqual(LiteralLabel value1, LiteralLabel value2)
     Compares two instances of values of the given datatype.
public  booleanisValidLiteral(LiteralLabel lit)
     Test whether the given LiteralLabel is a valid instance of this datatype.
public static  ListloadUserDefined(String uri, Reader reader, String encoding, TypeMapper tm)
     Create and register a set of types specified in a user schema file.
public static  ListloadUserDefined(String uri, String encoding, TypeMapper tm)
     Create and register a set of types specified in a user schema file.
public static  voidloadXSDSimpleTypes(TypeMapper tm)
     Add all of the XSD pre-defined simple types to the given type mapper registry.
public static  voidmain(String[] args)
    
public  Objectparse(String lexicalForm)
    
public  ObjectparseValidated(String lexical)
     Parse a validated lexical form.
protected  NumbersuitableInteger(String lexical)
    
protected  NumbersuitableInteger(long number)
    
public static  StringtrimPlus(String str)
     Helper function to return the substring of a validated number string omitting any leading + sign.
public  Stringunparse(Object value)
     Convert a value of this datatype out to lexical form.

Field Detail
XSD
final public static String XSD(Code)
The xsd namespace



XSDENTITY
final public static XSDDatatype XSDENTITY(Code)
Datatype representing xsd:ENTITY



XSDID
final public static XSDDatatype XSDID(Code)
Datatype representing xsd:ID



XSDIDREF
final public static XSDDatatype XSDIDREF(Code)
Datatype representing xsd:IDREF



XSDNCName
final public static XSDDatatype XSDNCName(Code)
Datatype representing xsd:NCName



XSDNMTOKEN
final public static XSDDatatype XSDNMTOKEN(Code)
Datatype representing xsd:NMTOKEN



XSDNOTATION
final public static XSDDatatype XSDNOTATION(Code)
Datatype representing xsd:NOTATION



XSDName
final public static XSDDatatype XSDName(Code)
Datatype representing xsd:Name



XSDQName
final public static XSDDatatype XSDQName(Code)
Datatype representing xsd:QName



XSDanyURI
final public static XSDDatatype XSDanyURI(Code)
Datatype representing xsd:anyURI



XSDbase64Binary
final public static XSDDatatype XSDbase64Binary(Code)
Datatype representing xsd:base64Binary



XSDboolean
final public static XSDDatatype XSDboolean(Code)
Datatype representing xsd:boolean



XSDbyte
final public static XSDDatatype XSDbyte(Code)
Datatype representing xsd:byte



XSDdate
final public static XSDDatatype XSDdate(Code)
Datatype representing xsd:date



XSDdateTime
final public static XSDDatatype XSDdateTime(Code)
Datatype representing xsd:dateTime



XSDdecimal
final public static XSDDatatype XSDdecimal(Code)
Datatype representing xsd:decimal



XSDdouble
final public static XSDDatatype XSDdouble(Code)
Datatype representing xsd:double



XSDduration
final public static XSDDatatype XSDduration(Code)
Datatype representing xsd:duration



XSDfloat
final public static XSDDatatype XSDfloat(Code)
Datatype representing xsd:float



XSDgDay
final public static XSDDatatype XSDgDay(Code)
Datatype representing xsd:gDay



XSDgMonth
final public static XSDDatatype XSDgMonth(Code)
Datatype representing xsd:gMonth



XSDgMonthDay
final public static XSDDatatype XSDgMonthDay(Code)
Datatype representing xsd:gMonthDay



XSDgYear
final public static XSDDatatype XSDgYear(Code)
Datatype representing xsd:gYear



XSDgYearMonth
final public static XSDDatatype XSDgYearMonth(Code)
Datatype representing xsd:gYearMonth



XSDhexBinary
final public static XSDDatatype XSDhexBinary(Code)
Datatype representing xsd:hexBinary



XSDint
final public static XSDDatatype XSDint(Code)
Datatype representing xsd:int



XSDinteger
final public static XSDDatatype XSDinteger(Code)
Datatype representing xsd:integer



XSDlanguage
final public static XSDDatatype XSDlanguage(Code)
Datatype representing xsd:language



XSDlong
final public static XSDDatatype XSDlong(Code)
Datatype representing xsd:long



XSDnegativeInteger
final public static XSDDatatype XSDnegativeInteger(Code)
Datatype representing xsd:negativeInteger



XSDnonNegativeInteger
final public static XSDDatatype XSDnonNegativeInteger(Code)
Datatype representing xsd:nonNegativeInteger



XSDnonPositiveInteger
final public static XSDDatatype XSDnonPositiveInteger(Code)
Datatype representing xsd:nonPositiveInteger



XSDnormalizedString
final public static XSDDatatype XSDnormalizedString(Code)
Datatype representing xsd:normalizedString



XSDpositiveInteger
final public static XSDDatatype XSDpositiveInteger(Code)
Datatype representing xsd:positiveInteger



XSDshort
final public static XSDDatatype XSDshort(Code)
Datatype representing xsd:short



XSDstring
final public static XSDDatatype XSDstring(Code)
Datatype representing xsd:string



XSDtime
final public static XSDDatatype XSDtime(Code)
Datatype representing xsd:time



XSDtoken
final public static XSDDatatype XSDtoken(Code)
Datatype representing xsd:token



XSDunsignedByte
final public static XSDDatatype XSDunsignedByte(Code)
Datatype representing xsd:unsignedByte



XSDunsignedInt
final public static XSDDatatype XSDunsignedInt(Code)
Datatype representing xsd:unsignedInt



XSDunsignedLong
final public static XSDDatatype XSDunsignedLong(Code)
Datatype representing xsd:unsignedLong



XSDunsignedShort
final public static XSDDatatype XSDunsignedShort(Code)
Datatype representing xsd:unsignedShort



decimalDV
final static DecimalDV decimalDV(Code)
Used to access the values and facets of any of the decimal numeric types



javaClass
protected Class javaClass(Code)
the corresponding java primitive class, if any



typeDeclaration
protected XSSimpleType typeDeclaration(Code)
the Xerces internal type declaration




Constructor Detail
XSDDatatype
public XSDDatatype(String typeName)(Code)
Constructor.
Parameters:
  typeName - the name of the XSD type to be instantiated, this is used to lookup a type definition from the Xerces schema factory.



XSDDatatype
public XSDDatatype(String typeName, Class javaClass)(Code)
Constructor.
Parameters:
  typeName - the name of the XSD type to be instantiated, this is used to lookup a type definition from the Xerces schema factory.
Parameters:
  javaClass - the java class for which this xsd type is to betreated as the cannonical representation



XSDDatatype
public XSDDatatype(XSSimpleType xstype, String namespace)(Code)
Constructor used when loading in external user defined XSD types - should only be used by the internals but public scope because the internals spread across multiple packages.
Parameters:
  xstype - the XSSimpleType definition to be wrapped
Parameters:
  namespace - the namespace for the type (used because the grammar loading doesn't seem to keep that)




Method Detail
convertValidatedDataValue
public Object convertValidatedDataValue(ValidatedInfo validatedInfo) throws DatatypeFormatException(Code)
Convert a validated xerces data value into the corresponding java data value. This function is currently the most blatently xerces-version dependent part of this subsystem. In many cases it also involves reparsing data which has already been parsed as part of the validation.
Parameters:
  validatedInfo - a fully populated Xerces data validation context the appropriate java wrapper type



extendedTypeDefinition
public Object extendedTypeDefinition()(Code)
Returns the Xerces datatype representation for this type, this is an XSSimpleType, in fact an XSSimpleTypeDecl.



getHashCode
public int getHashCode(byte[] bytes)(Code)



getJavaClass
public Class getJavaClass()(Code)
If this datatype is used as the cannonical representation for a particular java datatype then return that java type, otherwise returns null.



isBaseTypeCompatible
public boolean isBaseTypeCompatible(LiteralLabel lit)(Code)
Test if the given typed value is in the right partition of the XSD type space. If this test passes then if the typed value has a legal lexical form for this type then it is a legal instance.



isEqual
public boolean isEqual(LiteralLabel value1, LiteralLabel value2)(Code)
Compares two instances of values of the given datatype. This ignores lang tags and defers to the equality function defined by the Xerces package - to be checked.



isValidLiteral
public boolean isValidLiteral(LiteralLabel lit)(Code)
Test whether the given LiteralLabel is a valid instance of this datatype. This takes into accound typing information as well as lexical form - for example an xsd:string is never considered valid as an xsd:integer (even if it is lexically legal like "1").



loadUserDefined
public static List loadUserDefined(String uri, Reader reader, String encoding, TypeMapper tm) throws DatatypeFormatException(Code)
Create and register a set of types specified in a user schema file. We use the (illegal) DAML+OIL approach that the uriref of the type is the url of the schema file with fragment ID corresponding the the name of the type.
Parameters:
  uri - the absolute uri of the schema file to be loaded
Parameters:
  reader - the Reader stream onto the file (useful if you wish to load a cached copy of the schema file)
Parameters:
  encoding - the encoding of the source file (can be null)
Parameters:
  tm - the type mapper into which to load the definitions a List of strings giving the uri's of the newly defined datatypes
throws:
  DatatypeFormatException - if there is a problem during load (not that we use Xerces in default mode for load which may provide diagnostic output direct to stderr)



loadUserDefined
public static List loadUserDefined(String uri, String encoding, TypeMapper tm) throws DatatypeFormatException(Code)
Create and register a set of types specified in a user schema file. We use the (illegal) DAML+OIL approach that the uriref of the type is the url of the schema file with fragment ID corresponding the the name of the type.
Parameters:
  uri - the absolute uri of the schema file to be loaded, this should be a resolvable URL
Parameters:
  encoding - the encoding of the source file (can be null)
Parameters:
  tm - the type mapper into which to load the definitions a List of strings giving the uri's of the newly defined datatypes
throws:
  DatatypeFormatException - if there is a problem during load (not that we use Xerces in default mode for load which may provide diagnostic output direct to stderr)



loadXSDSimpleTypes
public static void loadXSDSimpleTypes(TypeMapper tm)(Code)
Add all of the XSD pre-defined simple types to the given type mapper registry.



main
public static void main(String[] args)(Code)



parse
public Object parse(String lexicalForm) throws DatatypeFormatException(Code)
Parse a lexical form of this datatype to a value
throws:
  DatatypeFormatException - if the lexical form is not legal



parseValidated
public Object parseValidated(String lexical)(Code)
Parse a validated lexical form. Subclasses which use the default parse implementation and are not convered by the explicit convertValidatedData cases should override this.



suitableInteger
protected Number suitableInteger(String lexical)(Code)

Parameters:
  lexical -



suitableInteger
protected Number suitableInteger(long number)(Code)

Parameters:
  number -



trimPlus
public static String trimPlus(String str)(Code)
Helper function to return the substring of a validated number string omitting any leading + sign.



unparse
public String unparse(Object value)(Code)
Convert a value of this datatype out to lexical form.



Fields inherited from com.hp.hpl.jena.datatypes.BaseDatatype
protected String uri(Code)(Java Doc)

Methods inherited from com.hp.hpl.jena.datatypes.BaseDatatype
public Object cannonicalise(Object value)(Code)(Java Doc)
public Object extendedTypeDefinition()(Code)(Java Doc)
public int getHashCode(LiteralLabel lit)(Code)(Java Doc)
public Class getJavaClass()(Code)(Java Doc)
public String getURI()(Code)(Java Doc)
public boolean isEqual(LiteralLabel value1, LiteralLabel value2)(Code)(Java Doc)
public boolean isValid(String lexicalForm)(Code)(Java Doc)
public boolean isValidLiteral(LiteralLabel lit)(Code)(Java Doc)
public boolean isValidValue(Object valueForm)(Code)(Java Doc)
public boolean langTagCompatible(LiteralLabel value1, LiteralLabel value2)(Code)(Java Doc)
public RDFDatatype normalizeSubType(Object value, RDFDatatype dt)(Code)(Java Doc)
public Object parse(String lexicalForm) throws DatatypeFormatException(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public String unparse(Object value)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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