mbeckerle commented on a change in pull request #343: Daffodil 2302 fixes
external variables API difficulties
URL: https://github.com/apache/incubator-daffodil/pull/343#discussion_r401649821
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/compiler/Compiler.scala
##########
@@ -73,190 +73,169 @@ object ForParser extends ParserOrUnparser
object ForUnparser extends ParserOrUnparser
object BothParserAndUnparser extends ParserOrUnparser
-final class ProcessorFactory(val sset: SchemaSet)
- extends SchemaComponentImpl(<pf/>, sset)
- with DFDL.ProcessorFactory
- with HavingRootSpec {
-
- lazy val (generateParser, generateUnparser) = {
- val (context, policy) = tunable.parseUnparsePolicy match {
- case ParseUnparsePolicyTunable.FromRoot => (Some(rootElem),
rootElem.rootParseUnparsePolicy)
- case ParseUnparsePolicyTunable.ParseOnly => (None,
ParseUnparsePolicy.ParseOnly)
- case ParseUnparsePolicyTunable.UnparseOnly => (None,
ParseUnparsePolicy.UnparseOnly)
- case ParseUnparsePolicyTunable.Both => (None, ParseUnparsePolicy.Both)
- }
- rootElem.checkParseUnparsePolicyCompatibility(context, policy)
- policy match {
- case ParseUnparsePolicy.Both => (true, true)
- case ParseUnparsePolicy.ParseOnly => (true, false)
- case ParseUnparsePolicy.UnparseOnly => (false, true)
- }
+final class ProcessorFactory private(
+ private var optRootSpec: Option[RootSpec],
+ /*
+ * compilerExternalVarSettings supports the deprecated API
+ * where external variable settings can be supplied to the compiler
+ * instance.
+ *
+ * The non-deprecated API is to deal with external variable settings
+ * on the data processor instance. This is passed here so that
+ * the PF can propagate it to the DP.
+ */
+ var compilerExternalVarSettings: Queue[Binding],
Review comment:
Decided to leave this a queue. It's possible that bindings are ordered.
Rather apply them in order than worry about de-duplicating them.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services