java.lang.Object
org.apache.jena.datatypes.BaseDatatype
org.apache.jena.datatypes.xsd.XSDDatatype
org.apache.jena.datatypes.xsd.impl.XSDBaseNumericType
- All Implemented Interfaces:
RDFDatatype
- Direct Known Subclasses:
XSDByteType
Base implementation for all numeric datatypes derived from
xsd:decimal. The only purpose of this place holder is
to support the isValidLiteral tests across numeric types.
*
Note that float and double are not included in this set.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.jena.datatypes.xsd.XSDDatatype
XSDDatatype.XSDGenericTypeNested classes/interfaces inherited from class org.apache.jena.datatypes.BaseDatatype
BaseDatatype.TypedValue -
Field Summary
Fields inherited from class org.apache.jena.datatypes.xsd.XSDDatatype
XSD, XSDanyURI, XSDbase64Binary, XSDboolean, XSDbyte, XSDdate, XSDdateTime, XSDdateTimeStamp, XSDdayTimeDuration, XSDdecimal, XSDdouble, XSDduration, XSDENTITY, XSDfloat, XSDgDay, XSDgMonth, XSDgMonthDay, XSDgYear, XSDgYearMonth, XSDhexBinary, XSDID, XSDIDREF, XSDint, XSDinteger, XSDlanguage, XSDlong, XSDName, XSDNCName, XSDnegativeInteger, XSDNMTOKEN, XSDnonNegativeInteger, XSDnonPositiveInteger, XSDnormalizedString, XSDNOTATION, XSDpositiveInteger, XSDQName, XSDshort, XSDstring, XSDtime, XSDtoken, XSDunsignedByte, XSDunsignedInt, XSDunsignedLong, XSDunsignedShort, XSDyearMonthDuration -
Constructor Summary
ConstructorsConstructorDescriptionXSDBaseNumericType(String typeName) Constructor.XSDBaseNumericType(String typeName, Class<?> javaClass) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncannonicalise(Object value) Cannonicalise a java Object value to a normal form.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.booleanisValidValue(Object valueForm) Test whether the given object is a legal value form of this datatype.Parse a lexical form of this datatype to a valueConvert a value of this datatype to lexical form.Methods inherited from class org.apache.jena.datatypes.xsd.XSDDatatype
extendedTypeDefinition, getJavaClass, isBaseTypeCompatible, loadXSDSimpleTypes, main, parseValidated, trimPlusMethods inherited from class org.apache.jena.datatypes.BaseDatatype
equals, getHashCode, getURI, hashCode, isValid, langTagCompatible, normalizeSubType, toString
-
Constructor Details
-
XSDBaseNumericType
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.
-
XSDBaseNumericType
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 cannonical representation
-
-
Method Details
-
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 classXSDDatatype
-
isValidValue
Test whether the given object is a legal value form of this datatype. Brute force implementation.- Specified by:
isValidValuein interfaceRDFDatatype- Overrides:
isValidValuein classBaseDatatype
-
cannonicalise
Cannonicalise a java Object value to a normal form. Primarily used in cases such as xsd:integer to reduce the Java object representation to the narrowest of the Number subclasses to ensure that indexing of typed literals works.- Specified by:
cannonicalisein interfaceRDFDatatype- Overrides:
cannonicalisein classBaseDatatype
-
parse
Parse a lexical form of this datatype to a value- Specified by:
parsein interfaceRDFDatatype- Overrides:
parsein classXSDDatatype- Throws:
DatatypeFormatException- if the lexical form is not legal
-
unparse
Convert a value of this datatype to lexical form. Certain forms are not a simple matter of java's toString on the Number object.- Specified by:
unparsein interfaceRDFDatatype- Overrides:
unparsein classXSDDatatype
-
isEqual
Compares two instances of values of the given datatype.- Specified by:
isEqualin interfaceRDFDatatype- Overrides:
isEqualin classXSDDatatype
-