public class XSDDatatype extends BaseDatatype
Modifier and Type | Class and Description |
---|---|
static class |
XSDDatatype.XSDGenericType
Generic XML Schema datatype (outside the xsd: namespace)
|
BaseDatatype.TypedValue
Modifier and Type | Field and Description |
---|---|
static String |
XSD
The xsd namespace
|
static XSDDatatype |
XSDanyURI
Datatype representing xsd:anyURI
|
static XSDDatatype |
XSDbase64Binary
Datatype representing xsd:base64Binary
|
static XSDDatatype |
XSDboolean
Datatype representing xsd:boolean
|
static XSDDatatype |
XSDbyte
Datatype representing xsd:byte
|
static XSDDatatype |
XSDdate
Datatype representing xsd:date
|
static XSDDatatype |
XSDdateTime
Datatype representing xsd:dateTime
|
static XSDDatatype |
XSDdateTimeStamp
Datatype representing xsd:dateTimeStamp
|
static XSDDatatype |
XSDdayTimeDuration
Datatype representing xsd:dayTimeDration
|
static XSDDatatype |
XSDdecimal
Datatype representing xsd:decimal
|
static XSDDatatype |
XSDdouble
Datatype representing xsd:double
|
static XSDDatatype |
XSDduration
Datatype representing xsd:duration
|
static XSDDatatype |
XSDENTITY
Datatype representing xsd:ENTITY
|
static XSDDatatype |
XSDfloat
Datatype representing xsd:float
|
static XSDDatatype |
XSDgDay
Datatype representing xsd:gDay
|
static XSDDatatype |
XSDgMonth
Datatype representing xsd:gMonth
|
static XSDDatatype |
XSDgMonthDay
Datatype representing xsd:gMonthDay
|
static XSDDatatype |
XSDgYear
Datatype representing xsd:gYear
|
static XSDDatatype |
XSDgYearMonth
Datatype representing xsd:gYearMonth
|
static XSDDatatype |
XSDhexBinary
Datatype representing xsd:hexBinary
|
static XSDDatatype |
XSDID
Datatype representing xsd:ID
|
static XSDDatatype |
XSDIDREF
Datatype representing xsd:IDREF
|
static XSDDatatype |
XSDint
Datatype representing xsd:int
|
static XSDDatatype |
XSDinteger
Datatype representing xsd:integer
|
static XSDDatatype |
XSDlanguage
Datatype representing xsd:language
|
static XSDDatatype |
XSDlong
Datatype representing xsd:long
|
static XSDDatatype |
XSDName
Datatype representing xsd:Name
|
static XSDDatatype |
XSDNCName
Datatype representing xsd:NCName
|
static XSDDatatype |
XSDnegativeInteger
Datatype representing xsd:negativeInteger
|
static XSDDatatype |
XSDNMTOKEN
Datatype representing xsd:NMTOKEN
|
static XSDDatatype |
XSDnonNegativeInteger
Datatype representing xsd:nonNegativeInteger
|
static XSDDatatype |
XSDnonPositiveInteger
Datatype representing xsd:nonPositiveInteger
|
static XSDDatatype |
XSDnormalizedString
Datatype representing xsd:normalizedString
|
static XSDDatatype |
XSDNOTATION
Datatype representing xsd:NOTATION
|
static XSDDatatype |
XSDpositiveInteger
Datatype representing xsd:positiveInteger
|
static XSDDatatype |
XSDQName
Datatype representing xsd:QName
|
static XSDDatatype |
XSDshort
Datatype representing xsd:short
|
static XSDDatatype |
XSDstring
Datatype representing xsd:string
|
static XSDDatatype |
XSDtime
Datatype representing xsd:time
|
static XSDDatatype |
XSDtoken
Datatype representing xsd:token
|
static XSDDatatype |
XSDunsignedByte
Datatype representing xsd:unsignedByte
|
static XSDDatatype |
XSDunsignedInt
Datatype representing xsd:unsignedInt
|
static XSDDatatype |
XSDunsignedLong
Datatype representing xsd:unsignedLong
|
static XSDDatatype |
XSDunsignedShort
Datatype representing xsd:unsignedShort
|
static XSDDatatype |
XSDyearMonthDuration
Datatype representing xsd:yearMonthDuration
|
Constructor and Description |
---|
XSDDatatype(String typeName)
Constructor.
|
XSDDatatype(String typeName,
Class<?> javaClass)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
extendedTypeDefinition()
Returns the Xerces datatype representation for this type, this
is an XSSimpleType, in fact an XSSimpleTypeDecl.
|
Class<?> |
getJavaClass()
If this datatype is used as the cannonical representation
for a particular java datatype then return that java type,
otherwise returns null.
|
boolean |
isBaseTypeCompatible(LiteralLabel lit)
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 |
isValidLiteral(LiteralLabel lit)
Test whether the given LiteralLabel is a valid instance
of this datatype.
|
static void |
loadXSDSimpleTypes(TypeMapper tm)
Add all of the XSD pre-defined simple types to the given
type mapper registry.
|
static void |
main(String[] args) |
Object |
parse(String lexicalForm)
Parse a lexical form of this datatype to a value
|
Object |
parseValidated(String lexical)
Parse a validated lexical form.
|
static String |
trimPlus(String str)
Helper function to return the substring of a validated number string
omitting any leading + sign.
|
String |
unparse(Object value)
Convert a value of this datatype out
to lexical form.
|
cannonicalise, getHashCode, getURI, isValid, isValidValue, langTagCompatible, normalizeSubType, toString
public static final String XSD
public static final XSDDatatype XSDfloat
public static final XSDDatatype XSDdouble
public static final XSDDatatype XSDint
public static final XSDDatatype XSDlong
public static final XSDDatatype XSDshort
public static final XSDDatatype XSDbyte
public static final XSDDatatype XSDunsignedByte
public static final XSDDatatype XSDunsignedShort
public static final XSDDatatype XSDunsignedInt
public static final XSDDatatype XSDunsignedLong
public static final XSDDatatype XSDdecimal
public static final XSDDatatype XSDinteger
public static final XSDDatatype XSDnonPositiveInteger
public static final XSDDatatype XSDnonNegativeInteger
public static final XSDDatatype XSDpositiveInteger
public static final XSDDatatype XSDnegativeInteger
public static final XSDDatatype XSDboolean
public static final XSDDatatype XSDstring
public static final XSDDatatype XSDnormalizedString
public static final XSDDatatype XSDanyURI
public static final XSDDatatype XSDtoken
public static final XSDDatatype XSDName
public static final XSDDatatype XSDQName
public static final XSDDatatype XSDlanguage
public static final XSDDatatype XSDNMTOKEN
public static final XSDDatatype XSDENTITY
public static final XSDDatatype XSDID
public static final XSDDatatype XSDNCName
public static final XSDDatatype XSDIDREF
public static final XSDDatatype XSDNOTATION
public static final XSDDatatype XSDhexBinary
public static final XSDDatatype XSDbase64Binary
public static final XSDDatatype XSDdate
public static final XSDDatatype XSDtime
public static final XSDDatatype XSDdateTime
public static final XSDDatatype XSDdateTimeStamp
public static final XSDDatatype XSDduration
public static final XSDDatatype XSDdayTimeDuration
public static final XSDDatatype XSDyearMonthDuration
public static final XSDDatatype XSDgDay
public static final XSDDatatype XSDgMonth
public static final XSDDatatype XSDgYear
public static final XSDDatatype XSDgYearMonth
public static final XSDDatatype XSDgMonthDay
public XSDDatatype(String typeName)
typeName
- the name of the XSD type to be instantiated, this is
used to lookup a type definition from the Xerces schema factory.public XSDDatatype(String typeName, Class<?> javaClass)
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 representationpublic Object parse(String lexicalForm) throws DatatypeFormatException
parse
in interface RDFDatatype
parse
in class BaseDatatype
DatatypeFormatException
- if the lexical form is not legalpublic String unparse(Object value)
unparse
in interface RDFDatatype
unparse
in class BaseDatatype
public boolean isEqual(LiteralLabel value1, LiteralLabel value2)
isEqual
in interface RDFDatatype
isEqual
in class BaseDatatype
public Class<?> getJavaClass()
getJavaClass
in interface RDFDatatype
getJavaClass
in class BaseDatatype
public Object extendedTypeDefinition()
extendedTypeDefinition
in interface RDFDatatype
extendedTypeDefinition
in class BaseDatatype
public Object parseValidated(String lexical)
public boolean isValidLiteral(LiteralLabel lit)
isValidLiteral
in interface RDFDatatype
isValidLiteral
in class BaseDatatype
public boolean isBaseTypeCompatible(LiteralLabel lit)
public static String trimPlus(String str)
public static void loadXSDSimpleTypes(TypeMapper tm)
public static void main(String[] args)
Licenced under the Apache License, Version 2.0