git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] mbeckerle commented on a change in pull request #61: Base64, gzip, and line-folding layering


mbeckerle commented on a change in pull request #61: Base64, gzip, and line-folding layering
URL: https://github.com/apache/incubator-daffodil/pull/61#discussion_r185887087
 
 

 ##########
 File path: daffodil-core/src/main/scala/org/apache/daffodil/dsom/SequenceGroup.scala
 ##########
 @@ -245,6 +248,31 @@ abstract class SequenceTermBase(
       maybeCheckBitOrderAndCharset)
   }
 
+  private val layeredSequenceAllowedProps = Set("ref", "layerTransform", "layerEncoding", "layerLengthKind", "layerLength", "layerLengthUnits", "layerBoundaryMark")
+
+  final lazy val maybeLayerTransformerEv: Maybe[LayerTransformerEv] = {
+    if (maybeLayerTransformEv.isEmpty) Maybe.Nope
+    else { // need to check that only layering properties are specified
+      val localProps = this.formatAnnotation.justThisOneProperties
+      val localKeys = localProps.keySet
+      val disallowedKeys = localKeys.filterNot(k => layeredSequenceAllowedProps.contains(k))
+      if (disallowedKeys.size > 0)
+        SDE("Sequence has dfdl:layerTransform specified, so cannot have non-layering properties: %s", disallowedKeys)
 
 Review comment:
   Fixed, and test_layersErr1 added.

----------------------------------------------------------------
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:
users@xxxxxxxxxxxxxxxx


With regards,
Apache Git Services