efinnegan commented on a change in pull request #70: Adding property
binaryCalendarRep with values "binarySeconds" and "bi…
URL: https://github.com/apache/incubator-daffodil/pull/70#discussion_r189965172
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/grammar/ElementBaseGrammarMixin.scala
##########
@@ -775,6 +782,25 @@ trait ElementBaseGrammarMixin
}
case PrimType.Boolean => { new BinaryBoolean(this) }
+
+ case PrimType.DateTime | PrimType.Date | PrimType.Time => {
+ (primType, binaryCalendarRep) match {
+ case (PrimType.DateTime, BinaryCalendarRep.BinarySeconds) =>
(lengthUnits, binaryNumberKnownLengthInBits) match {
+ case (LengthUnits.Bytes, 32) => new
ConvertBinaryDateTimePrim(this, binaryNumberKnownLengthInBits)
Review comment:
I would think it would be ok but I added this because it's specified in the
spec - "12.3.7.2.5 Length of Base-2 Binary Calendar Elements
Calendars with binary representation and dfdl:binaryCalendarRep
‘binarySeconds’ or ‘binaryMilliseconds’ are represented as a bit string which
contains a base-2 representation.The specified length must be either exactly 4
bytes or exactly 8 bytes respectively.
The dfdl:lengthUnits property must be 'bytes'. It is a schema definition
error otherwise."
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services