stevedlawrence commented on a change in pull request #343: WIP: Daf 2302 ext var
URL: https://github.com/apache/incubator-daffodil/pull/343#discussion_r400126311
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/compiler/Compiler.scala
##########
@@ -192,34 +216,63 @@ final class ProcessorFactory(val sset: SchemaSet)
/**
* Both Compiler and ProcessorFactory share this same API call.
*/
-trait HavingRootSpec extends Logging {
- var rootSpec: Option[RootSpec] = None
+trait HavingRootSpec[T] extends Logging {
+ var rootSpec: Option[RootSpec]
+ @deprecated("2020-03-26", "Use withDistinguishedRootNode.")
def setDistinguishedRootNode(name: String, namespace: String): Unit = {
+ rootSpec = getRootSpec(name, namespace)
+ }
+
+ def withDistinguishedRootNode(name: String, namespace: String): T
+
+ protected final def getRootSpec(name: String, namespace: String):
Option[RootSpec] = {
val ns =
if (namespace != null) Some(NS(namespace))
else None
- rootSpec = Some(RootSpec(ns, name))
- // log(Info("%s setDistinguishedRootNode to %s",
Misc.getNameFromClass(this), rootSpec))
- //
- // null means we search for the namespace
- // Must be only one answer.
- //
-
+ Some(RootSpec(ns, name))
}
}
+
class InvalidParserException(msg: String, cause: Throwable = null) extends
Exception(msg, cause)
-class Compiler(var validateDFDLSchemas: Boolean = true)
+class Compiler private (var validateDFDLSchemas: Boolean,
+ var tunables : DaffodilTunables,
+ /*
+ * Supports deprecated feature of establishing external vars on the compiler
object.
+ * These are just saved and passed to the processor factory which
incorporates them into
+ * the variable map of the data processor.
+ *
+ * This argument can be removed once this deprecated feature is removed.
+ */
+ private var externalDFDLVariables: Queue[Binding],
+ private var checkAllTopLevel : Boolean,
+ var rootSpec: Option[RootSpec]) // TODO: rename optRootSpec
Review comment:
Fix todo
----------------------------------------------------------------
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