Interface InfosetSimpleElement
- All Superinterfaces:
InfosetElement
,InfosetItem
-
Method Summary
Modifier and TypeMethodDescriptiongetByte()
Used to access simple element values of all integer types representable by an 8-bit signed java.lang.Byte.com.ibm.icu.util.Calendar
getDate()
com.ibm.icu.util.Calendar
getFloat()
byte[]
getInt()
Used to access simple element values of all integer types representable by a 32 bit signed java.lang.Integer.Used to get the value of DFDL `integer` type, which is an unbounded-magnitude integer.getLong()
Used to access simple element values of all integer types representable by a 64 bit signed java.lang.Long.getShort()
Used to access simple element values of all integer types representable by a 16 bit signed java.lang.Short.getText()
Obtains the value, then converts it to a string.com.ibm.icu.util.Calendar
getTime()
Used to access simple element values of all non-negative integer types representable by an 8-bit unsigned integer.Used to access simple element values of all non-negative integer types representable by a 32-bit unsigned integer.Used to access simple element values of all non-negative integer types representable by a 64-bit unsigned integer.Used to access simple element values of all non-negative integer types representable by a 16-bit unsigned integer.getURI()
metadata()
Access to the metadata information about this element.Methods inherited from interface org.apache.daffodil.api.infoset.InfosetElement
isNilled
-
Method Details
-
metadata
SimpleElementMetadata metadata()Description copied from interface:InfosetElement
Access to the metadata information about this element. SeeElementMetadata
- Specified by:
metadata
in interfaceInfosetElement
- Specified by:
metadata
in interfaceInfosetItem
- Returns:
- metadata of the item
-
getText
String getText()Obtains the value, then converts it to a string. Caches the string so we're not allocating strings repeatedly- Returns:
- value of the simple element
-
getObject
Object getObject()- Returns:
- the value of this simple element as an Object (java.lang.Object),
-
getDecimal
BigDecimal getDecimal()- Returns:
- Casts the value of this simple element as a java.math.BigDecimal or @throws InfosetTypeException if the element is not of type decimal.
-
getDate
com.ibm.icu.util.Calendar getDate()- Returns:
- the value of this simple element cast as a `com.ibm.icu.util.Calendar`. or @throws InfosetTypeException if the element is not of type date.
-
getTime
com.ibm.icu.util.Calendar getTime()- Returns:
- the value of this simple element as a `com.ibm.icu.util.Calendar`. or @throws InfosetTypeException if the element is not of type time.
-
getDateTime
com.ibm.icu.util.Calendar getDateTime()- Returns:
- the value of this simple element cast to `com.ibm.icu.util.Calendar`. or @throws InfosetTypeException if the element is not of type dateTime.
-
getHexBinary
byte[] getHexBinary()- Returns:
- the value of this simple element of HexBinary type cast to `Array[Byte]`. or @throws InfosetTypeException if the element is not of type hexBinary.
-
getBoolean
Boolean getBoolean()- Returns:
- the value of this simple element of Boolean type cast to java.lang.Boolean. or @throws InfosetTypeException if the element is not of type boolean.
-
getLong
Long getLong()Used to access simple element values of all integer types representable by a 64 bit signed java.lang.Long.The separate
getUnsignedLong
must be used for the DFDL unsignedLong type.- Returns:
- the value of this simple element converted to java.lang.Long. or @throws InfosetTypeException if the element value is not convertible to the result type.
-
getInt
Integer getInt()Used to access simple element values of all integer types representable by a 32 bit signed java.lang.Integer.The separate
getUnsignedInt
must be used for the DFDL unsignedInt type.Do not confuse DFDL integer type with java.lang.Integer, which is the object version of a java.lang.int, which is limited to only signed 32-bits of magnitude. The DFDL integer type is an unbounded magnitude integer (aka BigInteger).
- Returns:
- the value of this simple element converted to java.lang.Integer. or @throws InfosetTypeException if the element value is not convertible to the result type.
-
getShort
Short getShort()Used to access simple element values of all integer types representable by a 16 bit signed java.lang.Short.The separate
getUnsignedShort
must be used for the DFDL unsignedShorttype.- Returns:
- the value of this simple element converted to java.lang.Short. or @throws InfosetTypeException if the element value is not convertible to the result type.
-
getByte
Byte getByte()Used to access simple element values of all integer types representable by an 8-bit signed java.lang.Byte.The separate
getUnsignedByte
must be used for the DFDL unsignedBytetype.- Returns:
- the value of this simple element converted to java.lang.Short. or @throws InfosetTypeException if the element value is not convertible to the result type.
-
getUnsignedInt
Long getUnsignedInt()Used to access simple element values of all non-negative integer types representable by a 32-bit unsigned integer.Note that the returned value is the larger signed type, java.lang.Long which is capable of representing unsigned integer values greater than java.lang.Integer.MAX_VALUE.
- Returns:
- the value of this simple element converted to java.lang.Long. or @throws InfosetTypeException if the element value is not convertible to the result type.
-
getUnsignedShort
Integer getUnsignedShort()Used to access simple element values of all non-negative integer types representable by a 16-bit unsigned integer.Note that the returned value is the larger signed type, java.lang.Int which is capable of representing unsigned integer values greater than java.lang.Short.MAX_VALUE.
- Returns:
- the value of this simple element converted to java.lang.Int. or @throws InfosetTypeException if the element value is not convertible to the result type.
-
getUnsignedByte
Short getUnsignedByte()Used to access simple element values of all non-negative integer types representable by an 8-bit unsigned integer.Note that the returned value is the larger signed type, java.lang.Short which is capable of representing unsigned integer values greater than java.lang.Byte.MAX_VALUE.
- Returns:
- the value of this simple element converted to java.lang.Int. or @throws InfosetTypeException if the element value is not convertible to the result type.
-
getUnsignedLong
BigInteger getUnsignedLong()Used to access simple element values of all non-negative integer types representable by a 64-bit unsigned integer.Note that the returned value is the larger signed type, java.math.BigInteger which is capable of representing unsigned integer values greater than java.lang.Long.MAX_VALUE.
- Returns:
- the value of this simple element converted to java.lang.BigInteger. or @throws InfosetTypeException if the element value is not convertible to the result type.
-
getDouble
Double getDouble()- Returns:
- the value of this simple element of Double type cast to java.lang.Double. or @throws InfosetTypeException if the element in not of type double.
-
getFloat
Float getFloat()- Returns:
- the value of this simple element of Float type cast to java.lang.Float. or @throws InfosetTypeException if the element is not of type float.
-
getInteger
BigInteger getInteger()Used to get the value of DFDL `integer` type, which is an unbounded-magnitude integer.Do not confuse DFDL integer type with java.lang.Integer, which is the object version of a java.lang.int, which is limited to only signed 32-bits of magnitude.
- Returns:
- the value of this simple element of Integer type cast to java.math.BigInteger. or @throws InfosetTypeException if the element is not of type integer.
-
getNonNegativeInteger
BigInteger getNonNegativeInteger()- Returns:
- the value of this simple element of NonNegativeInteger type cast to java.math.BigInteger. or @throws InfosetTypeException if the element value is not convertible to the result type.
-
getString
String getString()- Returns:
- the value of this simple element of String type cast to java.lang.String. or @throws InfosetTypeException if the element value is not of String type.
-
getURI
URI getURI()- Returns:
- the value of this simple element of URI type cast to java.net.URI. or @throws InfosetTypeException if the element value is not of URI type.
-