java.lang.Object
org.apache.jena.datatypes.BaseDatatype
org.apache.jena.datatypes.xsd.XSDDatatype
- All Implemented Interfaces:
RDFDatatype
- Direct Known Subclasses:
XSDAbstractDateTimeType
,XSDBaseNumericType
,XSDBaseStringType
,XSDbinary
,XSDDatatype.XSDGenericType
,XSDDouble
,XSDFloat
,XSDPlainType
Representation of an XSD datatype based on the Xerces-2
XSD implementation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Generic XML Schema datatype (outside the xsd: namespace)Nested classes/interfaces inherited from class org.apache.jena.datatypes.BaseDatatype
BaseDatatype.TypedValue
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The xsd namespacestatic final XSDDatatype
Datatype representing xsd:anyURIstatic final XSDDatatype
Datatype representing xsd:base64Binarystatic final XSDDatatype
Datatype representing xsd:booleanstatic final XSDDatatype
Datatype representing xsd:bytestatic final XSDDatatype
Datatype representing xsd:datestatic final XSDDatatype
Datatype representing xsd:dateTimestatic final XSDDatatype
Datatype representing xsd:dateTimeStampstatic final XSDDatatype
Datatype representing xsd:dayTimeDrationstatic final XSDDatatype
Datatype representing xsd:decimalstatic final XSDDatatype
Datatype representing xsd:doublestatic final XSDDatatype
Datatype representing xsd:durationstatic final XSDDatatype
Deprecated, for removal: This API element is subject to removal in a future version.will be removed in Jena 6static final XSDDatatype
Datatype representing xsd:floatstatic final XSDDatatype
Datatype representing xsd:gDaystatic final XSDDatatype
Datatype representing xsd:gMonthstatic final XSDDatatype
Datatype representing xsd:gMonthDaystatic final XSDDatatype
Datatype representing xsd:gYearstatic final XSDDatatype
Datatype representing xsd:gYearMonthstatic final XSDDatatype
Datatype representing xsd:hexBinarystatic final XSDDatatype
Deprecated, for removal: This API element is subject to removal in a future version.will be removed in Jena 6static final XSDDatatype
Deprecated, for removal: This API element is subject to removal in a future version.will be removed in Jena 6static final XSDDatatype
Datatype representing xsd:intstatic final XSDDatatype
Datatype representing xsd:integerstatic final XSDDatatype
Datatype representing xsd:languagestatic final XSDDatatype
Datatype representing xsd:longstatic final XSDDatatype
Datatype representing xsd:Namestatic final XSDDatatype
Datatype representing xsd:NCNamestatic final XSDDatatype
Datatype representing xsd:negativeIntegerstatic final XSDDatatype
Datatype representing xsd:NMTOKENstatic final XSDDatatype
Datatype representing xsd:nonNegativeIntegerstatic final XSDDatatype
Datatype representing xsd:nonPositiveIntegerstatic final XSDDatatype
Datatype representing xsd:normalizedStringstatic final XSDDatatype
Deprecated, for removal: This API element is subject to removal in a future version.will be removed in Jena 6static final XSDDatatype
Datatype representing xsd:positiveIntegerstatic final XSDDatatype
Deprecated, for removal: This API element is subject to removal in a future version.will be removed in Jena 6static final XSDDatatype
Datatype representing xsd:shortstatic final XSDDatatype
Datatype representing xsd:stringstatic final XSDDatatype
Datatype representing xsd:timestatic final XSDDatatype
Datatype representing xsd:tokenstatic final XSDDatatype
Datatype representing xsd:unsignedBytestatic final XSDDatatype
Datatype representing xsd:unsignedIntstatic final XSDDatatype
Datatype representing xsd:unsignedLongstatic final XSDDatatype
Datatype representing xsd:unsignedShortstatic final XSDDatatype
Datatype representing xsd:yearMonthDuration -
Constructor Summary
ConstructorsConstructorDescriptionXSDDatatype
(String typeName) Constructor.XSDDatatype
(String typeName, Class<?> javaClass) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the Xerces datatype representation for this type, this is an XSSimpleType, in fact an XSSimpleTypeDecl.Class<?>
If this datatype is used as the cannonical representation for a particular java datatype then return that java type, otherwise returns null.boolean
Test if the given typed value is in the right partition of the XSD type space.boolean
isEqual
(LiteralLabel value1, LiteralLabel value2) Compares two instances of values of the given datatype.boolean
Test whether the given LiteralLabel is a valid instance of this datatype.static void
Add all of the XSD pre-defined simple types to the given type mapper registry.static void
Parse a lexical form of this datatype to a valueparseValidated
(String lexical) Parse a validated lexical form.static String
Helper function to return the substring of a validated number string omitting any leading + sign.Convert a value of this datatype out to lexical form.Methods inherited from class org.apache.jena.datatypes.BaseDatatype
cannonicalise, equals, getHashCode, getURI, hashCode, isValid, isValidValue, langTagCompatible, normalizeSubType, toString
-
Field Details
-
XSD
The xsd namespace- See Also:
-
XSDfloat
Datatype representing xsd:float -
XSDdouble
Datatype representing xsd:double -
XSDint
Datatype representing xsd:int -
XSDlong
Datatype representing xsd:long -
XSDshort
Datatype representing xsd:short -
XSDbyte
Datatype representing xsd:byte -
XSDunsignedByte
Datatype representing xsd:unsignedByte -
XSDunsignedShort
Datatype representing xsd:unsignedShort -
XSDunsignedInt
Datatype representing xsd:unsignedInt -
XSDunsignedLong
Datatype representing xsd:unsignedLong -
XSDdecimal
Datatype representing xsd:decimal -
XSDinteger
Datatype representing xsd:integer -
XSDnonPositiveInteger
Datatype representing xsd:nonPositiveInteger -
XSDnonNegativeInteger
Datatype representing xsd:nonNegativeInteger -
XSDpositiveInteger
Datatype representing xsd:positiveInteger -
XSDnegativeInteger
Datatype representing xsd:negativeInteger -
XSDboolean
Datatype representing xsd:boolean -
XSDstring
Datatype representing xsd:string -
XSDnormalizedString
Datatype representing xsd:normalizedString -
XSDanyURI
Datatype representing xsd:anyURI -
XSDtoken
Datatype representing xsd:token -
XSDName
Datatype representing xsd:Name -
XSDQName
Deprecated, for removal: This API element is subject to removal in a future version.will be removed in Jena 6Datatype representing xsd:QName -
XSDlanguage
Datatype representing xsd:language -
XSDNMTOKEN
Datatype representing xsd:NMTOKEN -
XSDENTITY
Deprecated, for removal: This API element is subject to removal in a future version.will be removed in Jena 6Datatype representing xsd:ENTITY -
XSDID
Deprecated, for removal: This API element is subject to removal in a future version.will be removed in Jena 6Datatype representing xsd:ID -
XSDNCName
Datatype representing xsd:NCName -
XSDIDREF
Deprecated, for removal: This API element is subject to removal in a future version.will be removed in Jena 6Datatype representing xsd:IDREF -
XSDNOTATION
Deprecated, for removal: This API element is subject to removal in a future version.will be removed in Jena 6Datatype representing xsd:NOTATION -
XSDhexBinary
Datatype representing xsd:hexBinary -
XSDbase64Binary
Datatype representing xsd:base64Binary -
XSDdate
Datatype representing xsd:date -
XSDtime
Datatype representing xsd:time -
XSDdateTime
Datatype representing xsd:dateTime -
XSDdateTimeStamp
Datatype representing xsd:dateTimeStamp -
XSDduration
Datatype representing xsd:duration -
XSDdayTimeDuration
Datatype representing xsd:dayTimeDration -
XSDyearMonthDuration
Datatype representing xsd:yearMonthDuration -
XSDgDay
Datatype representing xsd:gDay -
XSDgMonth
Datatype representing xsd:gMonth -
XSDgYear
Datatype representing xsd:gYear -
XSDgYearMonth
Datatype representing xsd:gYearMonth -
XSDgMonthDay
Datatype representing xsd:gMonthDay
-
-
Constructor Details
-
XSDDatatype
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
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.javaClass
- the java class for which this xsd type is to be treated as the canonical representation
-
-
Method Details
-
parse
Parse a lexical form of this datatype to a value- Specified by:
parse
in interfaceRDFDatatype
- Overrides:
parse
in classBaseDatatype
- Throws:
DatatypeFormatException
- if the lexical form is not legal
-
unparse
Convert a value of this datatype out to lexical form.- Specified by:
unparse
in interfaceRDFDatatype
- Overrides:
unparse
in classBaseDatatype
-
isEqual
Compares two instances of values of the given datatype.- Specified by:
isEqual
in interfaceRDFDatatype
- Overrides:
isEqual
in classBaseDatatype
-
getJavaClass
If this datatype is used as the cannonical representation for a particular java datatype then return that java type, otherwise returns null.- Specified by:
getJavaClass
in interfaceRDFDatatype
- Overrides:
getJavaClass
in classBaseDatatype
-
extendedTypeDefinition
Returns the Xerces datatype representation for this type, this is an XSSimpleType, in fact an XSSimpleTypeDecl.- Specified by:
extendedTypeDefinition
in interfaceRDFDatatype
- Overrides:
extendedTypeDefinition
in classBaseDatatype
-
parseValidated
Parse a validated lexical form. Subclasses which use the default parse implementation and are not convered by the explicit convertValidatedData cases should override this. -
isValidLiteral
Test whether the given LiteralLabel is a valid instance of this datatype. This takes into account 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").- Specified by:
isValidLiteral
in interfaceRDFDatatype
- Overrides:
isValidLiteral
in classBaseDatatype
-
isBaseTypeCompatible
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. -
trimPlus
Helper function to return the substring of a validated number string omitting any leading + sign. -
loadXSDSimpleTypes
Add all of the XSD pre-defined simple types to the given type mapper registry. -
main
-