mbeckerle commented on code in PR #1158:
URL: https://github.com/apache/daffodil/pull/1158#discussion_r1488172546
##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/api/Metadata.scala:
##########
@@ -155,58 +151,11 @@ trait ComplexElementMetadata extends ElementMetadata {
*/
trait SimpleElementMetadata extends ElementMetadata {
- def primitiveType: PrimitiveType
-}
-
-/**
- * Instances are static objects that represent the DFDL primitive types.
- */
-trait PrimitiveType {
- def name: String
-}
-
-/**
- * Static methods related to PrimitiveType objects
- */
-object PrimitiveType {
-
- private lazy val _list: java.util.List[PrimitiveType] =
- NodeInfo.allDFDLTypes.asInstanceOf[Seq[PrimitiveType]].asJava
-
- /**
- * Get a primitive type given a name string.
- *
- * @param name lookup key. Case insensitive.
- * @return the PrimitiveType with that name, or null if there is no such
primitive type.
- */
- def fromName(name: String): PrimitiveType =
- NodeInfo.primitiveTypeFromName(name)
-
/**
- * A list of all the primitive type objects.
+ * Primitive Type enum usable from Java
+ * @return
*/
- def list: java.util.List[PrimitiveType] = _list
-
- val String: PrimitiveType = PrimType.String
- val Int: PrimitiveType = PrimType.Int
- val Byte: PrimitiveType = PrimType.Byte
- val Short: PrimitiveType = PrimType.Short
- val Long: PrimitiveType = PrimType.Long
- val Integer: PrimitiveType = PrimType.Integer
- val Decimal: PrimitiveType = PrimType.Decimal
- val UnsignedInt: PrimitiveType = PrimType.UnsignedInt
- val UnsignedByte: PrimitiveType = PrimType.UnsignedByte
- val UnsignedShort: PrimitiveType = PrimType.UnsignedShort
- val UnsignedLong: PrimitiveType = PrimType.UnsignedLong
- val NonNegativeInteger: PrimitiveType = PrimType.NonNegativeInteger
- val Double: PrimitiveType = PrimType.Double
- val Float: PrimitiveType = PrimType.Float
- val HexBinary: PrimitiveType = PrimType.HexBinary
- val AnyURI: PrimitiveType = PrimType.AnyURI
- val Boolean: PrimitiveType = PrimType.Boolean
- val DateTime: PrimitiveType = PrimType.DateTime
- val Date: PrimitiveType = PrimType.Date
- val Time: PrimitiveType = PrimType.Time
+ def jPrimType: JPrimType
Review Comment:
I'd prefer not to rename Daffodil's NodeInfo.PrimType object and trait/type,
as it is referenced all over the code base, as are methods like optPrimType and
primType.
So we need to distinguish this enum from that.
Idea: rename JPrimType to PrimTypeEnum or EPrimType, and the methods
correspondingly.
--
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]