olabusayoT commented on code in PR #1479:
URL: https://github.com/apache/daffodil/pull/1479#discussion_r2193053662


##########
daffodil-core/src/main/java/org/apache/daffodil/api/DataProcessor.java:
##########
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.daffodil.api;
+
+import org.apache.daffodil.api.debugger.Debugger;
+import org.apache.daffodil.api.debugger.DebuggerRunner;
+import org.apache.daffodil.api.debugger.InteractiveDebuggerRunner;
+import org.apache.daffodil.api.debugger.InteractiveDebuggerRunnerFactory;
+import org.apache.daffodil.runtime1.debugger.InteractiveTraceDebuggerRunner;
+import org.apache.daffodil.api.exceptions.ExternalVariableException;
+import org.apache.daffodil.api.infoset.InfosetInputter;
+import org.apache.daffodil.api.infoset.InfosetOutputter;
+import org.apache.daffodil.api.validation.Validator;
+import org.apache.daffodil.core.dsom.ExpressionCompilers$;
+import org.apache.daffodil.runtime1.debugger.InteractiveDebugger;
+
+
+import java.io.File;
+import java.io.Serializable;
+import java.net.URI;
+import java.nio.channels.WritableByteChannel;
+import java.util.Map;
+
+/**
+ * Compiled version of a DFDL Schema, used to parse data and get the DFDL 
infoset
+ */
+public interface DataProcessor extends WithDiagnostics, Serializable {
+  /**
+   * Obtain a new {@link DataProcessor} instance with debugging enabled or 
disabled.
+   * <p>
+   * Before enabling, {@link DataProcessor#withDebugger} or {@link 
DataProcessor#withDebuggerRunner} must be called to obtain
+   * a {@link DataProcessor} with a non-null debugger.
+   *
+   * @param flag true to enable debugging, false to disabled
+   */
+  DataProcessor withDebugging(boolean flag);
+
+  /**
+   * Obtain a new {@link DataProcessor} with a specified debugger runner.
+   *
+   * @param dr debugger runner
+   */
+  default DataProcessor withDebuggerRunner(DebuggerRunner dr) {
+    Debugger dbg = null;
+    InteractiveDebuggerRunner runner;
+    if (dr instanceof InteractiveTraceDebuggerRunner) {
+      runner = new 
org.apache.daffodil.runtime1.debugger.TraceDebuggerRunner(System.out);
+    } else if (dr != null) {
+      runner = InteractiveDebuggerRunnerFactory.get(dr);
+    } else {
+      runner = null;
+    }
+
+    if (runner != null) {
+      dbg = new InteractiveDebugger(runner, ExpressionCompilers$.MODULE$);
+    }
+    return withDebugger(dbg);
+  }
+
+  /**
+   * Obtain a new {@link DataProcessor} with a specified debugger.
+   *
+   * @param dbg debugger
+   */
+  DataProcessor withDebugger(Debugger dbg);
+
+  DataProcessor withValidator(Validator validator);

Review Comment:
   No, it doesn't support null. They need to create a NoValidator using 
Validators.getInstance.get("off").make()



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

To unsubscribe, e-mail: commits-unsubscr...@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to