|
|||||||||
| Home >> All >> com >> hp >> hpl >> jena >> datatypes >> [ xsd overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.hp.hpl.jena.datatypes.xsd
Class XSDDatatype

java.lang.Objectcom.hp.hpl.jena.datatypes.BaseDatatype
com.hp.hpl.jena.datatypes.xsd.XSDDatatype
- All Implemented Interfaces:
- com.hp.hpl.jena.datatypes.RDFDatatype
- Direct Known Subclasses:
- XSDbase64Binary, XSDhexBinary
- public class XSDDatatype
- extends com.hp.hpl.jena.datatypes.BaseDatatype
Representation of an XSD datatype based on the Xerces-2 XSD implementation.
- Version:
- $Revision: 1.9 $ on $Date: 2005/02/21 12:02:15 $
| Field Summary | |
(package private) static org.apache.xerces.impl.dv.xs.DecimalDV |
decimalDV
Used to access the values and facets of any of the decimal numeric types |
protected java.lang.Class |
javaClass
the corresponding java primitive class, if any |
protected org.apache.xerces.impl.dv.XSSimpleType |
typeDeclaration
the Xerces internal type declaration |
static java.lang.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 |
| Fields inherited from class com.hp.hpl.jena.datatypes.BaseDatatype |
uri |
| Constructor Summary | |
XSDDatatype(java.lang.String typeName)
Constructor. |
|
XSDDatatype(java.lang.String typeName,
java.lang.Class javaClass)
Constructor. |
|
XSDDatatype(org.apache.xerces.impl.dv.XSSimpleType xstype,
java.lang.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 | |
java.lang.Object |
convertValidatedDataValue(org.apache.xerces.impl.dv.ValidatedInfo validatedInfo)
Convert a validated xerces data value into the corresponding java data value. |
java.lang.Object |
extendedTypeDefinition()
Returns the Xerces datatype representation for this type, this is an XSSimpleType, in fact an XSSimpleTypeDecl. |
private org.apache.xerces.xs.XSTypeDefinition |
getFoundingType()
Return the most specific type below xsd:anySimpleType that this type is derived from. |
java.lang.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 java.util.List |
loadUserDefined(java.lang.String uri,
java.io.Reader reader,
java.lang.String encoding,
com.hp.hpl.jena.datatypes.TypeMapper tm)
Create and register a set of types specified in a user schema file. |
static java.util.List |
loadUserDefined(java.lang.String uri,
java.lang.String encoding,
com.hp.hpl.jena.datatypes.TypeMapper tm)
Create and register a set of types specified in a user schema file. |
private static java.util.List |
loadUserDefined(org.apache.xerces.xni.parser.XMLInputSource source,
com.hp.hpl.jena.datatypes.TypeMapper tm)
Internal implementation of loadUserDefined |
static void |
loadXSDSimpleTypes(com.hp.hpl.jena.datatypes.TypeMapper tm)
Add all of the XSD pre-defined simple types to the given type mapper registry. |
static void |
main(java.lang.String[] args)
|
java.lang.Object |
parse(java.lang.String lexicalForm)
Parse a lexical form of this datatype to a value |
java.lang.Object |
parseValidated(java.lang.String lexical)
Parse a validated lexical form. |
static java.lang.String |
trimPlus(java.lang.String str)
Helper function to return the substring of a validated number string omitting any leading + sign. |
java.lang.String |
unparse(java.lang.Object value)
Convert a value of this datatype out to lexical form. |
| Methods inherited from class com.hp.hpl.jena.datatypes.BaseDatatype |
getURI, isValid, isValidValue, langTagCompatible, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
XSD
public static final java.lang.String XSD
- The xsd namespace
- See Also:
- Constant Field Values
XSDfloat
public static final XSDDatatype XSDfloat
- Datatype representing xsd:float
XSDdouble
public static final XSDDatatype XSDdouble
- Datatype representing xsd:double
XSDint
public static final XSDDatatype XSDint
- Datatype representing xsd:int
XSDlong
public static final XSDDatatype XSDlong
- Datatype representing xsd:long
XSDshort
public static final XSDDatatype XSDshort
- Datatype representing xsd:short
XSDbyte
public static final XSDDatatype XSDbyte
- Datatype representing xsd:byte
XSDunsignedByte
public static final XSDDatatype XSDunsignedByte
- Datatype representing xsd:unsignedByte
XSDunsignedShort
public static final XSDDatatype XSDunsignedShort
- Datatype representing xsd:unsignedShort
XSDunsignedInt
public static final XSDDatatype XSDunsignedInt
- Datatype representing xsd:unsignedInt
XSDunsignedLong
public static final XSDDatatype XSDunsignedLong
- Datatype representing xsd:unsignedLong
XSDdecimal
public static final XSDDatatype XSDdecimal
- Datatype representing xsd:decimal
XSDinteger
public static final XSDDatatype XSDinteger
- Datatype representing xsd:integer
XSDnonPositiveInteger
public static final XSDDatatype XSDnonPositiveInteger
- Datatype representing xsd:nonPositiveInteger
XSDnonNegativeInteger
public static final XSDDatatype XSDnonNegativeInteger
- Datatype representing xsd:nonNegativeInteger
XSDpositiveInteger
public static final XSDDatatype XSDpositiveInteger
- Datatype representing xsd:positiveInteger
XSDnegativeInteger
public static final XSDDatatype XSDnegativeInteger
- Datatype representing xsd:negativeInteger
XSDboolean
public static final XSDDatatype XSDboolean
- Datatype representing xsd:boolean
XSDstring
public static final XSDDatatype XSDstring
- Datatype representing xsd:string
XSDnormalizedString
public static final XSDDatatype XSDnormalizedString
- Datatype representing xsd:normalizedString
XSDanyURI
public static final XSDDatatype XSDanyURI
- Datatype representing xsd:anyURI
XSDtoken
public static final XSDDatatype XSDtoken
- Datatype representing xsd:token
XSDName
public static final XSDDatatype XSDName
- Datatype representing xsd:Name
XSDQName
public static final XSDDatatype XSDQName
- Datatype representing xsd:QName
XSDlanguage
public static final XSDDatatype XSDlanguage
- Datatype representing xsd:language
XSDNMTOKEN
public static final XSDDatatype XSDNMTOKEN
- Datatype representing xsd:NMTOKEN
XSDENTITY
public static final XSDDatatype XSDENTITY
- Datatype representing xsd:ENTITY
XSDID
public static final XSDDatatype XSDID
- Datatype representing xsd:ID
XSDNCName
public static final XSDDatatype XSDNCName
- Datatype representing xsd:NCName
XSDIDREF
public static final XSDDatatype XSDIDREF
- Datatype representing xsd:IDREF
XSDNOTATION
public static final XSDDatatype XSDNOTATION
- Datatype representing xsd:NOTATION
XSDhexBinary
public static final XSDDatatype XSDhexBinary
- Datatype representing xsd:hexBinary
XSDbase64Binary
public static final XSDDatatype XSDbase64Binary
- Datatype representing xsd:base64Binary
XSDdate
public static final XSDDatatype XSDdate
- Datatype representing xsd:date
XSDtime
public static final XSDDatatype XSDtime
- Datatype representing xsd:time
XSDdateTime
public static final XSDDatatype XSDdateTime
- Datatype representing xsd:dateTime
XSDduration
public static final XSDDatatype XSDduration
- Datatype representing xsd:duration
XSDgDay
public static final XSDDatatype XSDgDay
- Datatype representing xsd:gDay
XSDgMonth
public static final XSDDatatype XSDgMonth
- Datatype representing xsd:gMonth
XSDgYear
public static final XSDDatatype XSDgYear
- Datatype representing xsd:gYear
XSDgYearMonth
public static final XSDDatatype XSDgYearMonth
- Datatype representing xsd:gYearMonth
XSDgMonthDay
public static final XSDDatatype XSDgMonthDay
- Datatype representing xsd:gMonthDay
typeDeclaration
protected org.apache.xerces.impl.dv.XSSimpleType typeDeclaration
- the Xerces internal type declaration
javaClass
protected java.lang.Class javaClass
- the corresponding java primitive class, if any
decimalDV
static final org.apache.xerces.impl.dv.xs.DecimalDV decimalDV
- Used to access the values and facets of any of the decimal numeric types
| Constructor Detail |
XSDDatatype
public XSDDatatype(java.lang.String typeName)
- Constructor.
XSDDatatype
public XSDDatatype(java.lang.String typeName, java.lang.Class javaClass)
- Constructor.
XSDDatatype
public XSDDatatype(org.apache.xerces.impl.dv.XSSimpleType xstype, java.lang.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 Detail |
parse
public java.lang.Object parse(java.lang.String lexicalForm) throws com.hp.hpl.jena.datatypes.DatatypeFormatException
- Parse a lexical form of this datatype to a value
unparse
public java.lang.String unparse(java.lang.Object value)
- Convert a value of this datatype out
to lexical form.
isEqual
public 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.
This ignores lang tags and defers to the equality function
defined by the Xerces package - to be checked.
getJavaClass
public java.lang.Class getJavaClass()
- If this datatype is used as the cannonical representation
for a particular java datatype then return that java type,
otherwise returns null.
extendedTypeDefinition
public java.lang.Object extendedTypeDefinition()
- Returns the Xerces datatype representation for this type, this
is an XSSimpleType, in fact an XSSimpleTypeDecl.
loadUserDefined
public static java.util.List loadUserDefined(java.lang.String uri, java.io.Reader reader, java.lang.String encoding, com.hp.hpl.jena.datatypes.TypeMapper tm) throws com.hp.hpl.jena.datatypes.DatatypeFormatException
- Create and register a set of types specified in a user schema file.
We use the (illegal) DAML+OIL approach that the uriref of the type
is the url of the schema file with fragment ID corresponding the
the name of the type.
loadUserDefined
public static java.util.List loadUserDefined(java.lang.String uri, java.lang.String encoding, com.hp.hpl.jena.datatypes.TypeMapper tm) throws com.hp.hpl.jena.datatypes.DatatypeFormatException
- Create and register a set of types specified in a user schema file.
We use the (illegal) DAML+OIL approach that the uriref of the type
is the url of the schema file with fragment ID corresponding the
the name of the type.
loadUserDefined
private static java.util.List loadUserDefined(org.apache.xerces.xni.parser.XMLInputSource source, com.hp.hpl.jena.datatypes.TypeMapper tm) throws com.hp.hpl.jena.datatypes.DatatypeFormatException
- Internal implementation of loadUserDefined
convertValidatedDataValue
public java.lang.Object convertValidatedDataValue(org.apache.xerces.impl.dv.ValidatedInfo validatedInfo) throws com.hp.hpl.jena.datatypes.DatatypeFormatException
- Convert a validated xerces data value into the corresponding java data value.
This function is currently the most blatently xerces-version dependent part
of this subsystem. In many cases it also involves reparsing data which has
already been parsed as part of the validation.
parseValidated
public java.lang.Object parseValidated(java.lang.String lexical)
- 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
public boolean isValidLiteral(com.hp.hpl.jena.graph.impl.LiteralLabel lit)
- Test whether the given LiteralLabel is a valid instance
of this datatype. This takes into accound 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").
isBaseTypeCompatible
public 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.
If this test passes then if the typed value has a legal lexical form for
this type then it is a legal instance.
getFoundingType
private org.apache.xerces.xs.XSTypeDefinition getFoundingType()
- Return the most specific type below xsd:anySimpleType that this type is derived from.
trimPlus
public static java.lang.String trimPlus(java.lang.String str)
- Helper function to return the substring of a validated number string
omitting any leading + sign.
loadXSDSimpleTypes
public static void loadXSDSimpleTypes(com.hp.hpl.jena.datatypes.TypeMapper tm)
- Add all of the XSD pre-defined simple types to the given
type mapper registry.
main
public static void main(java.lang.String[] args)
|
|||||||||
| Home >> All >> com >> hp >> hpl >> jena >> datatypes >> [ xsd overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC