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 classGeneric 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 StringThe xsd namespacestatic final XSDDatatypeDatatype representing xsd:anyURIstatic final XSDDatatypeDatatype representing xsd:base64Binarystatic final XSDDatatypeDatatype representing xsd:booleanstatic final XSDDatatypeDatatype representing xsd:bytestatic final XSDDatatypeDatatype representing xsd:datestatic final XSDDatatypeDatatype representing xsd:dateTimestatic final XSDDatatypeDatatype representing xsd:dateTimeStampstatic final XSDDatatypeDatatype representing xsd:dayTimeDrationstatic final XSDDatatypeDatatype representing xsd:decimalstatic final XSDDatatypeDatatype representing xsd:doublestatic final XSDDatatypeDatatype representing xsd:durationstatic final XSDDatatypeDeprecated, for removal: This API element is subject to removal in a future version.will be removed in Jena 6static final XSDDatatypeDatatype representing xsd:floatstatic final XSDDatatypeDatatype representing xsd:gDaystatic final XSDDatatypeDatatype representing xsd:gMonthstatic final XSDDatatypeDatatype representing xsd:gMonthDaystatic final XSDDatatypeDatatype representing xsd:gYearstatic final XSDDatatypeDatatype representing xsd:gYearMonthstatic final XSDDatatypeDatatype representing xsd:hexBinarystatic final XSDDatatypeDeprecated, for removal: This API element is subject to removal in a future version.will be removed in Jena 6static final XSDDatatypeDeprecated, for removal: This API element is subject to removal in a future version.will be removed in Jena 6static final XSDDatatypeDatatype representing xsd:intstatic final XSDDatatypeDatatype representing xsd:integerstatic final XSDDatatypeDatatype representing xsd:languagestatic final XSDDatatypeDatatype representing xsd:longstatic final XSDDatatypeDatatype representing xsd:Namestatic final XSDDatatypeDatatype representing xsd:NCNamestatic final XSDDatatypeDatatype representing xsd:negativeIntegerstatic final XSDDatatypeDatatype representing xsd:NMTOKENstatic final XSDDatatypeDatatype representing xsd:nonNegativeIntegerstatic final XSDDatatypeDatatype representing xsd:nonPositiveIntegerstatic final XSDDatatypeDatatype representing xsd:normalizedStringstatic final XSDDatatypeDeprecated, for removal: This API element is subject to removal in a future version.will be removed in Jena 6static final XSDDatatypeDatatype representing xsd:positiveIntegerstatic final XSDDatatypeDeprecated, for removal: This API element is subject to removal in a future version.will be removed in Jena 6static final XSDDatatypeDatatype representing xsd:shortstatic final XSDDatatypeDatatype representing xsd:stringstatic final XSDDatatypeDatatype representing xsd:timestatic final XSDDatatypeDatatype representing xsd:tokenstatic final XSDDatatypeDatatype representing xsd:unsignedBytestatic final XSDDatatypeDatatype representing xsd:unsignedIntstatic final XSDDatatypeDatatype representing xsd:unsignedLongstatic final XSDDatatypeDatatype representing xsd:unsignedShortstatic final XSDDatatypeDatatype 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.booleanTest if the given typed value is in the right partition of the XSD type space.booleanisEqual(LiteralLabel value1, LiteralLabel value2) Compares two instances of values of the given datatype.booleanTest whether the given LiteralLabel is a valid instance of this datatype.static voidAdd all of the XSD pre-defined simple types to the given type mapper registry.static voidParse a lexical form of this datatype to a valueparseValidated(String lexical) Parse a validated lexical form.static StringHelper 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:
parsein interfaceRDFDatatype- Overrides:
parsein classBaseDatatype- Throws:
DatatypeFormatException- if the lexical form is not legal
-
unparse
Convert a value of this datatype out to lexical form.- Specified by:
unparsein interfaceRDFDatatype- Overrides:
unparsein classBaseDatatype
-
isEqual
Compares two instances of values of the given datatype.- Specified by:
isEqualin interfaceRDFDatatype- Overrides:
isEqualin 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:
getJavaClassin interfaceRDFDatatype- Overrides:
getJavaClassin classBaseDatatype
-
extendedTypeDefinition
Returns the Xerces datatype representation for this type, this is an XSSimpleType, in fact an XSSimpleTypeDecl.- Specified by:
extendedTypeDefinitionin interfaceRDFDatatype- Overrides:
extendedTypeDefinitionin 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:
isValidLiteralin interfaceRDFDatatype- Overrides:
isValidLiteralin 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
-