stevedlawrence commented on a change in pull request #83: Adding value of 'bcd' 
to binaryCalendarRep
URL: https://github.com/apache/incubator-daffodil/pull/83#discussion_r203364951
 
 

 ##########
 File path: 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/PrimitivesDateTime1.scala
 ##########
 @@ -82,26 +93,15 @@ abstract class ConvertTextCalendarProcessorBase(
   }
 }
 
-case class ConvertTextCalendarParser(erd: ElementRuntimeData,
-  xsdType: String,
-  prettyType: String,
-  pattern: String,
-  hasTZ: Boolean,
-  localeEv: CalendarLanguageEv,
-  calendarEv: CalendarEv)
-  extends ConvertTextCalendarProcessorBase(erd, pattern)
-  with TextPrimParser {
-
-  override lazy val runtimeDependencies = List(localeEv, calendarEv)
-
-  def parse(start: PState): Unit = {
-    val node = start.simpleElement
-    val str = node.dataValueAsString
-
-    Assert.invariant(str != null)
+trait CalendarParser extends PrimParser with ConvertTextCalendarProcessorBase {
+  def localeEv: CalendarLanguageEv
+  def calendarEv: CalendarEv
+  def xsdType: String
+  def prettyType: String
+  def hasTZ: Boolean
 
+  def writeResult (start: PState, toWrite: String) {
 
 Review comment:
   The name toWrite is a little deceiving. It's not actually written, but it's 
a string that is parsed to a Calendar using a DateFormatter. Maybe rename it to 
something to make it more clear that it is the calendar string and not 
something that will actually be written? Also writeResult is also a little 
confusing. I hear "write" and I think we're actually writing bytes, but this is 
just setting a value in the infoset. I'm not sure of a better name, but you use 
doUnparse for something similar in other changes in the patch, so maybe just 
doParse?

----------------------------------------------------------------
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

Reply via email to