|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hp.hpl.jena.datatypes.BaseDatatype com.hp.hpl.jena.datatypes.xsd.XSDDatatype
public class XSDDatatype
Representation of an XSD datatype based on the Xerces-2 XSD implementation.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.hp.hpl.jena.datatypes.BaseDatatype |
---|
BaseDatatype.TypedValue |
Field Summary | |
---|---|
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 |
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 |
Constructor Summary | |
---|---|
XSDDatatype(String typeName)
Constructor. |
|
XSDDatatype(String typeName,
Class<?> javaClass)
Constructor. |
|
XSDDatatype(org.apache.xerces.impl.dv.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 | |
---|---|
Object |
convertValidatedDataValue(org.apache.xerces.impl.dv.ValidatedInfo validatedInfo)
Convert a validated xerces data value into the corresponding java data value. |
Object |
extendedTypeDefinition()
Returns the Xerces datatype representation for this type, this is an XSSimpleType, in fact an XSSimpleTypeDecl. |
int |
getHashCode(byte[] bytes)
|
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(com.hp.hpl.jena.graph.impl.LiteralLabel lit)
Test if the given typed value is in the right partition of the XSD type space. |
boolean |
isEqual(com.hp.hpl.jena.graph.impl.LiteralLabel value1,
com.hp.hpl.jena.graph.impl.LiteralLabel value2)
Compares two instances of values of the given datatype. |
boolean |
isValidLiteral(com.hp.hpl.jena.graph.impl.LiteralLabel lit)
Test whether the given LiteralLabel is a valid instance of this datatype. |
static List<String> |
loadUserDefined(String uri,
Reader reader,
String encoding,
TypeMapper tm)
Create and register a set of types specified in a user schema file. |
static List<String> |
loadUserDefined(String uri,
String encoding,
TypeMapper tm)
Create and register a set of types specified in a user schema file. |
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. |
Methods inherited from class com.hp.hpl.jena.datatypes.BaseDatatype |
---|
cannonicalise, getHashCode, getURI, isValid, isValidValue, langTagCompatible, normalizeSubType, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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 XSDduration
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
Constructor Detail |
---|
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 cannonical representationpublic XSDDatatype(org.apache.xerces.impl.dv.XSSimpleType xstype, String namespace)
xstype
- the XSSimpleType definition to be wrappednamespace
- the namespace for the type (used because the grammar loading doesn't seem to keep that)Method Detail |
---|
public 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(com.hp.hpl.jena.graph.impl.LiteralLabel value1, com.hp.hpl.jena.graph.impl.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 static List<String> loadUserDefined(String uri, Reader reader, String encoding, TypeMapper tm) throws DatatypeFormatException
uri
- the absolute uri of the schema file to be loadedreader
- the Reader stream onto the file (useful if you wish to load a cached copy of the schema file)encoding
- the encoding of the source file (can be null)tm
- the type mapper into which to load the definitions
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)public static List<String> loadUserDefined(String uri, String encoding, TypeMapper tm) throws DatatypeFormatException
uri
- the absolute uri of the schema file to be loaded, this should be a resolvable URLencoding
- the encoding of the source file (can be null)tm
- the type mapper into which to load the definitions
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)public Object convertValidatedDataValue(org.apache.xerces.impl.dv.ValidatedInfo validatedInfo) throws DatatypeFormatException
validatedInfo
- a fully populated Xerces data validation context
DatatypeFormatException
public Object parseValidated(String lexical)
public boolean isValidLiteral(com.hp.hpl.jena.graph.impl.LiteralLabel lit)
isValidLiteral
in interface RDFDatatype
isValidLiteral
in class BaseDatatype
public boolean isBaseTypeCompatible(com.hp.hpl.jena.graph.impl.LiteralLabel lit)
public static String trimPlus(String str)
public static void loadXSDSimpleTypes(TypeMapper tm)
public static void main(String[] args)
public int getHashCode(byte[] bytes)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |