stevedlawrence commented on code in PR #1176:
URL: https://github.com/apache/daffodil/pull/1176#discussion_r1512795166
##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/dpath/NodeInfo.scala:
##########
@@ -932,6 +936,33 @@ object NodeInfo extends Enum {
DFDLTimeConversion.fromXMLString(s)
}
}
+
+ def toJavaType(dfdlType: DFDLPrimType): Class[_] = {
+ dfdlType match {
+ case DFDLPrimType.String => classOf[JString]
+ case DFDLPrimType.Int => classOf[JInt]
+ case DFDLPrimType.Byte => classOf[JByte]
+ case DFDLPrimType.Short => classOf[JShort]
+ case DFDLPrimType.Long => classOf[JLong]
+ case DFDLPrimType.Integer => classOf[JBigInt]
+ case DFDLPrimType.Decimal => classOf[JBigDecimal]
+ case DFDLPrimType.UnsignedInt => classOf[JLong]
+ case DFDLPrimType.UnsignedByte => classOf[JShort]
+ case DFDLPrimType.UnsignedShort => classOf[JInt]
+ case DFDLPrimType.UnsignedLong => classOf[JBigInt]
+ case DFDLPrimType.NonNegativeInteger => classOf[JBigInt]
+ case DFDLPrimType.Double => classOf[JDouble]
+ case DFDLPrimType.Float => classOf[JFloat]
+ case DFDLPrimType.HexBinary => classOf[Array[Byte]]
+ case DFDLPrimType.AnyURI => classOf[java.net.URI]
+ case DFDLPrimType.Boolean => classOf[JBoolean]
+ case DFDLPrimType.DateTime => classOf[ICUCalendar]
+ case DFDLPrimType.Date => classOf[ICUCalendar]
+ case DFDLPrimType.Time => classOf[ICUCalendar]
Review Comment:
Maybe we have the same supports as user defined functions? I think that's
basically just all numerics and byte array. So we exclude date/time types and
anyURI. I think there is value in supporting aditional things like
double/float, boolean so I'd prefer not to limit it to just string and int.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]