Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[higgins-dev] Java classes for attribute values.

Thinking how to best represent a property's value as a Java class, I started working on the table below.  Initially, my idea was that each literal type would map either directly to a core Java class, or in cases where an appropriate class didn't exist, would map to something we create (i.e. for xsd:decimal, we create a Decimal class which is basically a String restricted to the range of xsd:decimal.
 
I'm wondering though, if we maybe want to define a super-class or interface which has methods like
String getLexical(); // returns a lexical string representation of the value
getCanonical(); // returns the canonical string representation of the value
getValue(); // returns the underlying object holding the value (i.e. an Integer for xsd:int)
 
I'm still thinking about compound attributes. I assume all we need is a single interface which allows one to iterate over the sub-properties of the compound value, where each sub-property is either a literal or compound itself.
 
Any concerns/comments so far?
 
xsd:string String
xsd:normalizedString String
xsd:boolean Boolean
xsd:decimal TODO: need class
xsd:float Float
xsd:double Double
xsd:integer TODO: need class
xsd:nonNegativeInteger TODO: need class
xsd:positiveInteger TODO: need class
xsd:nonPositiveInteger TODO: need class
xsd:negativeInteger TODO: need class
xsd:long Long
xsd:int Integer
xsd:short Short
xsd:byte Byte
xsd:unsignedLong
xsd:unsignedInt
xsd:unsignedShort
xsd:unsignedByte
xsd:hexBinary TODO: need class
xsd:base64Binary TODO: need class
xsd:dateTime
xsd:time
xsd:date
xsd:gYearMonth
xsd:gYear
xsd:gMonthDay
xsd:gDay
xsd:gMonth
xsd:anyURI
xsd:token
xsd:language
xsd:NMTOKEN
xsd:Name
xsd:NCName

Back to the top