This is an automated email from the ASF dual-hosted git repository.
shanedell pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil.git
The following commit(s) were added to refs/heads/main by this push:
new 11a11afc3 Remove all API deprecated methods/classes/objects
11a11afc3 is described below
commit 11a11afc3f99fca8446cc5206f74446d6e825a33
Author: Shane Dell <[email protected]>
AuthorDate: Mon Nov 14 10:09:54 2022 -0500
Remove all API deprecated methods/classes/objects
- daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala: Use
withDebugger and withDebugging instead of setDebugger and setDebugging. Rename
function setupDebugOrTrace to withDebugOrTrace, also update it to return the
processor to be used.
- daffodil-core/src/main/scala/org/apache/daffodil/compiler/Compiler.scala:
Remove deprecated functions.
- daffodil-core/src/test/scala/org/apache/daffodil/util/TestUtils.scala:
Remove deprecated functions. Also add withDebugger and withDebugging functions.
-
daffodil-io/src/main/scala/org/apache/daffodil/io/InputSourceDataInputStream.scala:
Remove isAtEnd function.
-
daffodil-io/src/test/scala/org/apache/daffodil/io/TestInputSourceDataInputStream8.scala:
Remove deprecated functions.
-
daffodil-japi/src/main/java/org/apache/daffodil/japi/logger/LogLevel.java:
Delete file as nothing in it is used.
- daffodil-japi/src/main/scala/org/apache/daffodil/japi/Daffodil.scala:
Remove deprecated functions and unused imports.
-
daffodil-japi/src/main/scala/org/apache/daffodil/japi/infoset/Infoset.scala:
Remove deprecated functions.
-
daffodil-japi/src/main/scala/org/apache/daffodil/japi/logger/Logger.scala:
Delete file as nothing in it is used.
- daffodil-japi/src/test/java/org/apache/daffodil/example/TestJavaAPI.java:
Rename test to be with instead of set.
- daffodil-lib/src/main/scala/org/apache/daffodil/api/Diagnostic.scala:
Remove deprecated function isAtEnd.
-
daffodil-propgen/src/main/scala/org/apache/daffodil/propGen/TunableGenerator.scala:
Rename setTunable and setTunables to be withTunable and withTunables.
-
daffodil-runtime1/src/main/scala/org/apache/daffodil/api/DFDLParserUnparser.scala:
Remove deprecated functions. Also add withDebugger and withDebugging functions.
-
daffodil-runtime1/src/main/scala/org/apache/daffodil/dsom/CompiledExpression1.scala:
Remove deprecated constant.
-
daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/JsonInfosetInputter.scala:
Remove deprecated this constructor. Also remove Either from default
constructor as only InputStream used, remove private so default constructor is
callable.
-
daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/JsonInfosetOutputter.scala:
Remove dummy value and deprecated this constructor.
-
daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/XMLTextInfosetInputter.scala:
Remove deprecated this constructor. Also remove Either from default
constructor as only InputStream used, remove private so default constructor is
callable..
-
daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/XMLTextInfosetOutputter.scala:
Remove dummy value and deprecated this constructor.
-
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataLoc.scala:
Remove deprecated isAtEnd function.
-
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataProcessor.scala:
Remove deprecated functions and update var to val for some variables.
-
daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/Runtime2DataProcessor.scala:
Remove deprecated functions, coverage on and off comments. Also add
withDebugger and withDebugging functions.
- daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/Daffodil.scala:
Remove deprecated functions.
-
daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/infoset/Infoset.scala:
Remove deprecated functions.
-
daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/logger/Logger.scala:
Delete file as nothing in it is used.
-
daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/processor/TDMLDFDLProcessor.scala:
Remove deprecated functions.
-
daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/processor/DaffodilTDMLDFDLProcessor.scala:
Remove deprecated functions.
-
daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/processor/Runtime2TDMLDFDLProcessor.scala:
Remove deprecated functions.
- daffodil-lib/src/main/scala/org/apache/daffodil/processors/Runtime.scala:
Delete file as HasSetDebugger no longer used.
-
daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala:
Remove references to HasSetDebugger as it was removed.
[DAFFODIL-2743](https://issues.apache.org/jira/projects/DAFFODIL/issues/DAFFODIL-2743?filter=allissues)
---
.../src/main/scala/org/apache/daffodil/Main.scala | 52 ++--
.../org/apache/daffodil/compiler/Compiler.scala | 52 +---
.../scala/org/apache/daffodil/util/TestUtils.scala | 16 +-
.../daffodil/io/InputSourceDataInputStream.scala | 21 --
.../io/TestInputSourceDataInputStream8.scala | 78 -----
.../org/apache/daffodil/japi/logger/LogLevel.java | 51 ---
.../scala/org/apache/daffodil/japi/Daffodil.scala | 346 +--------------------
.../org/apache/daffodil/japi/infoset/Infoset.scala | 54 ----
.../org/apache/daffodil/japi/logger/Logger.scala | 132 --------
.../org/apache/daffodil/example/TestJavaAPI.java | 2 +-
.../scala/org/apache/daffodil/api/Diagnostic.scala | 4 -
.../org/apache/daffodil/processors/Runtime.scala | 38 ---
.../apache/daffodil/propGen/TunableGenerator.scala | 12 +-
.../apache/daffodil/api/DFDLParserUnparser.scala | 24 +-
.../apache/daffodil/dsom/CompiledExpression1.scala | 3 -
.../daffodil/infoset/JsonInfosetInputter.scala | 12 +-
.../daffodil/infoset/JsonInfosetOutputter.scala | 9 +-
.../daffodil/infoset/XMLTextInfosetInputter.scala | 12 +-
.../daffodil/infoset/XMLTextInfosetOutputter.scala | 9 +-
.../org/apache/daffodil/processors/DataLoc.scala | 12 -
.../apache/daffodil/processors/DataProcessor.scala | 85 +----
.../daffodil/runtime2/Runtime2DataProcessor.scala | 24 +-
.../scala/org/apache/daffodil/sapi/Daffodil.scala | 315 +------------------
.../org/apache/daffodil/sapi/infoset/Infoset.scala | 54 ----
.../org/apache/daffodil/sapi/logger/Logger.scala | 150 ---------
.../org/apache/daffodil/tdml/TDMLRunner.scala | 8 +-
.../tdml/processor/TDMLDFDLProcessor.scala | 33 --
.../tdml/processor/DaffodilTDMLDFDLProcessor.scala | 46 ---
.../tdml/processor/Runtime2TDMLDFDLProcessor.scala | 35 ---
29 files changed, 75 insertions(+), 1614 deletions(-)
diff --git a/daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
b/daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
index cba3bc2b7..124bb8dd3 100644
--- a/daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
+++ b/daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
@@ -100,9 +100,7 @@ import org.apache.daffodil.io.FormatInfo
import org.apache.daffodil.io.InputSourceDataInputStream
import org.apache.daffodil.processors.DaffodilParseOutputStreamContentHandler
import org.apache.daffodil.processors.DataLoc
-import org.apache.daffodil.processors.DataProcessor
import org.apache.daffodil.processors.ExternalVariableException
-import org.apache.daffodil.processors.HasSetDebugger
import org.apache.daffodil.schema.annotation.props.gen.BitOrder
import org.apache.daffodil.tdml.Runner
import org.apache.daffodil.tdml.TDMLException
@@ -630,23 +628,25 @@ object Main {
}
}
- def setupDebugOrTrace(proc: HasSetDebugger, conf: CLIConf) = {
- if (conf.trace() || conf.debug.isDefined) {
- val runner =
- if (conf.trace()) {
- new TraceDebuggerRunner(STDOUT)
- } else {
- if (System.console == null) {
- Logger.log.warn(s"Using --debug on a non-interactive console may
result in display issues")
- }
- conf.debug() match {
- case Some(f) => new CLIDebuggerRunner(new File(f), STDIN, STDOUT)
- case None => new CLIDebuggerRunner(STDIN, STDOUT)
+ def withDebugOrTrace(proc: DFDL.DataProcessor, conf: CLIConf):
DFDL.DataProcessor = {
+ (conf.trace() || conf.debug.isDefined) match {
+ case true => {
+ val runner =
+ if (conf.trace()) {
+ new TraceDebuggerRunner(STDOUT)
+ } else {
+ if (System.console == null) {
+ Logger.log.warn(s"Using --debug on a non-interactive console may
result in display issues")
+ }
+ conf.debug() match {
+ case Some(f) => new CLIDebuggerRunner(new File(f), STDIN, STDOUT)
+ case None => new CLIDebuggerRunner(STDIN, STDOUT)
+ }
}
- }
- val id = new InteractiveDebugger(runner, ExpressionCompilers)
- proc.setDebugging(true)
- proc.setDebugger(id)
+ val id = new InteractiveDebugger(runner, ExpressionCompilers)
+ proc.withDebugger(id).withDebugging(true)
+ }
+ case false => proc
}
}
@@ -911,13 +911,14 @@ object Main {
val tunables =
DaffodilTunables.configPlusMoreTunablesMap(parseOpts.tunables, optDafConfig)
createProcessorFromSchema(parseOpts.schema(),
parseOpts.rootNS.toOption, parseOpts.path.toOption, tunables, validate)
}
- }.map{
_.withExternalVariables(combineExternalVariables(parseOpts.vars, optDafConfig))}
+ }.map{
_.withExternalVariables(combineExternalVariables(parseOpts.vars, optDafConfig))
}
+ .map{ _.withValidationMode(validate) }
+ .map{ withDebugOrTrace(_, conf) }
val rc = processor match {
case None => ExitCode.UnableToCreateProcessor
- case Some(proc) => {
- Assert.invariant(!proc.isError)
- var processor = proc
+ case Some(processor) => {
+ Assert.invariant(!processor.isError)
val input = parseOpts.infile.toOption match {
case Some("-") | None => STDIN
case Some(file) => {
@@ -927,10 +928,6 @@ object Main {
}
val inStream = InputSourceDataInputStream(input)
- processor = processor.withValidationMode(validate)
-
- setupDebugOrTrace(processor.asInstanceOf[DataProcessor], conf)
-
val output = parseOpts.output.toOption match {
case Some("-") | None => STDOUT
case Some(file) => new FileOutputStream(file)
@@ -1218,6 +1215,8 @@ object Main {
createProcessorFromSchema(unparseOpts.schema(),
unparseOpts.rootNS.toOption, unparseOpts.path.toOption, tunables, validate)
}
}.map{
_.withExternalVariables(combineExternalVariables(unparseOpts.vars,
optDafConfig)) }
+ .map{ _.withValidationMode(validate) }
+ .map{ withDebugOrTrace(_, conf) }
val output = unparseOpts.output.toOption match {
case Some("-") | None => STDOUT
@@ -1237,7 +1236,6 @@ object Main {
case None => ExitCode.UnableToCreateProcessor
case Some(processor) => {
Assert.invariant(processor.isError == false)
- setupDebugOrTrace(processor.asInstanceOf[DataProcessor], conf)
val maybeScanner =
if (unparseOpts.stream.toOption.get) {
diff --git
a/daffodil-core/src/main/scala/org/apache/daffodil/compiler/Compiler.scala
b/daffodil-core/src/main/scala/org/apache/daffodil/compiler/Compiler.scala
index 4afc5cbf5..08647c776 100644
--- a/daffodil-core/src/main/scala/org/apache/daffodil/compiler/Compiler.scala
+++ b/daffodil-core/src/main/scala/org/apache/daffodil/compiler/Compiler.scala
@@ -40,7 +40,6 @@ import org.apache.daffodil.dsom.SchemaSet
import org.apache.daffodil.dsom.walker.RootView
import org.apache.daffodil.exceptions.Assert
import org.apache.daffodil.externalvars.Binding
-import org.apache.daffodil.externalvars.ExternalVariablesLoader
import org.apache.daffodil.processors.DataProcessor
import org.apache.daffodil.util.Logger
import org.apache.daffodil.util.Misc
@@ -135,12 +134,6 @@ final class ProcessorFactory private(
override def isError = sset.isError
- @deprecated("Use arguments to Compiler.compileSource or compileFile.",
"2.6.0")
- override def setDistinguishedRootNode(name: String, namespace: String): Unit
= {
- Assert.usage(name ne null)
- optRootSpec = RootSpec.makeRootSpec(Option(name), Option(namespace))
- }
-
def withDistinguishedRootNode(name: String, namespace: String) :
ProcessorFactory = {
Assert.usage(name ne null)
copy(optRootSpec = RootSpec.makeRootSpec(Option(name), Option(namespace)))
@@ -193,28 +186,13 @@ class Compiler private (var validateDFDLSchemas: Boolean,
optRootNamespace: Option[String] = optRootNamespace) =
new Compiler(validateDFDLSchemas, tunables, externalDFDLVariables,
checkAllTopLevel, optRootName, optRootNamespace)
- @deprecated("Pass arguments to compileSource, or compileFile.", "2.6.0")
- override def setDistinguishedRootNode(name: String, namespace: String): Unit
= {
- Assert.usage(name ne null)
- optRootName = Option(name)
- optRootNamespace = Option(namespace)
- }
-
def withDistinguishedRootNode(name: String, namespace: String) : Compiler = {
Assert.usage(name ne null)
copy(optRootName = Option(name), optRootNamespace = Option(namespace))
}
- @deprecated("Use constructor argument.", "2.6.0")
- def setValidateDFDLSchemas(value: Boolean): Unit = validateDFDLSchemas =
value
-
def withValidateDFDLSchemas(value: Boolean) = copy(validateDFDLSchemas =
value)
- @deprecated("Use DataProcessor.withExternalVariables.", "2.6.0")
- override def setExternalDFDLVariable(name: String, namespace: String, value:
String): Unit = {
- externalDFDLVariables = externalDFDLVariables.enqueue(getBinding(name,
namespace, value))
- }
-
/**
* Supports binding external variables programatically from the API.
*/
@@ -228,14 +206,6 @@ class Compiler private (var validateDFDLSchemas: Boolean,
b
}
- @deprecated("Use DataProcessor.withExternalVariables.", "2.6.0")
- def setExternalDFDLVariable(variable: Binding): Unit =
- externalDFDLVariables = externalDFDLVariables.enqueue(variable)
-
- @deprecated("Use DataProcessor.withExternalVariables.", "2.6.0")
- def setExternalDFDLVariables(variables: Seq[Binding]): Unit =
- variables.foreach(b => externalDFDLVariables =
externalDFDLVariables.enqueue(b))
-
//
// Not deprecated so that we can implement the deprecated things
// and reuse code.
@@ -247,25 +217,11 @@ class Compiler private (var validateDFDLSchemas: Boolean,
copy(externalDFDLVariables = extVars)
}
- @deprecated("Use DataProcessor.withExternalVariables.", "2.6.0")
- def setExternalDFDLVariables(extVarsFile: File): Unit = {
- val extVars: Seq[Binding] =
ExternalVariablesLoader.fileToBindings(extVarsFile)
- extVars.foreach(b => externalDFDLVariables =
externalDFDLVariables.enqueue(b))
- }
-
- @deprecated("Use withTunable.", "2.6.0")
- def setTunable(tunable: String, value: String): Unit =
- tunables = tunables.setTunable(tunable, value)
-
def withTunable(tunable: String, value: String): Compiler =
- copy(tunables = tunables.setTunable(tunable, value))
-
- @deprecated("Use withTunables.", "2.6.0")
- def setTunables(tunablesArg: Map[String, String]): Unit =
- tunables = tunables.setTunables(tunablesArg)
+ copy(tunables = tunables.withTunable(tunable, value))
def withTunables(tunablesArg: Map[String, String]): Compiler =
- copy(tunables = tunables.setTunables(tunablesArg))
+ copy(tunables = tunables.withTunables(tunablesArg))
/**
* Controls whether we check everything in the schema, or just the element
@@ -275,10 +231,6 @@ class Compiler private (var validateDFDLSchemas: Boolean,
* in them, some of which use unimplemented features. Each time we run
exactly one
* test from the set, we want to ignore errors in compilation of the others.
*/
- @deprecated("Use withCheckAllTopLevel.", "2.6.0")
- def setCheckAllTopLevel(flag: Boolean): Unit =
- checkAllTopLevel = flag
-
def withCheckAllTopLevel(flag: Boolean): Compiler =
copy(checkAllTopLevel = flag)
diff --git
a/daffodil-core/src/test/scala/org/apache/daffodil/util/TestUtils.scala
b/daffodil-core/src/test/scala/org/apache/daffodil/util/TestUtils.scala
index ad485177d..aff60d3e1 100644
--- a/daffodil-core/src/test/scala/org/apache/daffodil/util/TestUtils.scala
+++ b/daffodil-core/src/test/scala/org/apache/daffodil/util/TestUtils.scala
@@ -338,27 +338,13 @@ class Fakes private () {
lazy val fakeGroupRefFactory = GroupRefFactory(fs1.xml, fs1, 1, false)
class FakeDataProcessor extends DFDL.DataProcessor {
- @deprecated("Use withValidationMode.", "2.6.0")
- override def setValidationMode(mode: ValidationMode.Type): Unit = {}
def getValidationMode(): ValidationMode.Type = { ValidationMode.Full }
override def save(output: DFDL.Output): Unit = {}
- @deprecated("Use withExternalVariables.", "2.6.0")
- override def setExternalVariables(extVars: Map[String, String]): Unit = {}
- @deprecated("Use withExternalVariables.", "2.6.0")
- override def setExternalVariables(extVars: Seq[Binding]): Unit = {}
- @deprecated("Use withExternalVariables.", "2.6.0")
- override def setExternalVariables(extVars: File): Unit = {}
- @deprecated("Use withExternalVariables.", "2.6.0")
- override def setExternalVariables(extVars: File, tunable:
DaffodilTunables): Unit = {}
def getVariables(): VariableMap = VariableMapFactory.create(Nil)
override def parse(input: InputSourceDataInputStream, output:
InfosetOutputter): DFDL.ParseResult = null
override def unparse(inputter: InfosetInputter, output: DFDL.Output):
DFDL.UnparseResult = null
override def getDiagnostics: Seq[Diagnostic] = Seq.empty
override def isError: Boolean = false
- @deprecated("Use withTunables.", "2.6.0")
- override def setTunable(tunable: String, value: String): Unit = {}
- @deprecated("Use withTunables.", "2.6.0")
- override def setTunables(tunables: Map[String, String]): Unit = {}
override def getTunables(): DaffodilTunables = { tunables }
override def validationMode: ValidationMode.Type = ValidationMode.Full
@@ -369,6 +355,8 @@ class Fakes private () {
override def withTunable(tunable: String, value: String):
DFDL.DataProcessor = this
override def withTunables(tunables: Map[String,String]):
DFDL.DataProcessor = this
override def withValidationMode(mode: ValidationMode.Type):
DFDL.DataProcessor = this
+ override def withDebugger(dbg:AnyRef): DFDL.DataProcessor = this
+ override def withDebugging(flag: Boolean): DFDL.DataProcessor = this
override def newXMLReaderInstance: DFDL.DaffodilParseXMLReader = null
override def newContentHandlerInstance(output: DFDL.Output):
DFDL.DaffodilUnparseContentHandler = null
diff --git
a/daffodil-io/src/main/scala/org/apache/daffodil/io/InputSourceDataInputStream.scala
b/daffodil-io/src/main/scala/org/apache/daffodil/io/InputSourceDataInputStream.scala
index 7b4572951..78ea72665 100644
---
a/daffodil-io/src/main/scala/org/apache/daffodil/io/InputSourceDataInputStream.scala
+++
b/daffodil-io/src/main/scala/org/apache/daffodil/io/InputSourceDataInputStream.scala
@@ -129,27 +129,6 @@ final class InputSourceDataInputStream private(val
inputSource: InputSource)
*/
def hasReachedEndOfData: Boolean = inputSource.hasReachedEndOfData
- /**
- * Determine if we're positioned at the end of data.
- *
- * Blocks until either one byte of data can be read, or end-of-data
- * is encountered.
- *
- * It is generally not advised to use this on network TCP data streams
- * as it will block waiting for the sender of data to provide more data
- * or close the stream.
- *
- * @return boolean indicating whether we are known to be positioned at
- * the end of data.
- */
- @deprecated(
- "Use bitPos0b or bitPos1b to compare with expected position (possibly
bitLimit0b).",
- "3.1.0")
- final def isAtEnd(): Boolean = {
- !hasData() && hasReachedEndOfData
- }
-
-
def setBitPos0b(newBitPos0b: Long): Unit = {
// threadCheck()
Assert.invariant(newBitPos0b >= 0)
diff --git
a/daffodil-io/src/test/scala/org/apache/daffodil/io/TestInputSourceDataInputStream8.scala
b/daffodil-io/src/test/scala/org/apache/daffodil/io/TestInputSourceDataInputStream8.scala
index 020a12e79..ef795f939 100644
---
a/daffodil-io/src/test/scala/org/apache/daffodil/io/TestInputSourceDataInputStream8.scala
+++
b/daffodil-io/src/test/scala/org/apache/daffodil/io/TestInputSourceDataInputStream8.scala
@@ -19,12 +19,9 @@ package org.apache.daffodil.io
import org.apache.daffodil.Implicits.intercept
-import org.apache.daffodil.util.MaybeULong
-import org.apache.daffodil.util.Misc
import org.junit.Assert._
import org.junit.Test
-import java.io.ByteArrayInputStream
import java.io.InputStream
import java.io.OutputStream
@@ -63,81 +60,6 @@ class TestInputSourceDataInputStream8 {
assertTrue(e.getMessage().toLowerCase.contains("illegal"))
}
- @deprecated("Tests isAtEnd", "3.1.0")
- @Test def testIsAtEndEmpty1(): Unit = {
- val emptyIS = new InputStream {
- override def read() = ???
- override def read(buf: Array[Byte], off: Int, len: Int): Int = {
- assertTrue(len > 0)
- -1 // nothing here
- }
- }
- val isdis = InputSourceDataInputStream(emptyIS)
- //
- // before we attempt to read anything, we're not at end.
- assertFalse(isdis.hasReachedEndOfData)
- // this must attempt to read, and will get end-of-data
- assertTrue(isdis.isAtEnd())
- // so now we know we're at the end-of-data
- assertTrue(isdis.hasReachedEndOfData)
- }
-
- @deprecated("Tests isAtEnd", "3.1.0")
- @Test def testIsAtEndWholeByte1(): Unit = {
- val oneByteIS = new ByteArrayInputStream("A".getBytes)
- val isdis = InputSourceDataInputStream(oneByteIS)
- //
- // before we attempt to read anything, we're not at end.
- assertFalse(isdis.hasReachedEndOfData)
- // this must attempt to read, and will get end-of-data
- assertTrue(isdis.hasData())
- assertEquals(0, isdis.bitPos0b)
- assertEquals(0,isdis.getUnsignedLong(1,FakeFormatInfo_MSBF_BE).toLong)
- // we've only consumed 1 bit meaning
- // we should have only fetched 1 byte and this will NOT encounter end of
data yet.
- assertFalse(isdis.hasReachedEndOfData)
- // now retrieve next 7 bits. We still won't be at end of data
- assertEquals('A',isdis.getUnsignedLong(7,FakeFormatInfo_MSBF_BE).toChar)
- assertFalse(isdis.hasReachedEndOfData)
- // try to read one more bit. That will not succeed, but now we'll be at
end.
- assertTrue(isdis.isAtEnd())
- assertFalse(isdis.hasData())
- assertTrue(isdis.hasReachedEndOfData)
- }
-
- @Test def testIsAtEndPartialByte1(): Unit = {
- val oneByteIS = new ByteArrayInputStream(Misc.hex2Bytes("FF"))
- val isdis = InputSourceDataInputStream(oneByteIS)
- isdis.setBitLimit0b(MaybeULong(1))
- //
- // before we attempt to read anything, we're not at end.
- assertFalse(isdis.hasReachedEndOfData)
- assertTrue(isdis.isDefinedForLength(1)) // matches the bit limit set above
- assertEquals(0, isdis.bitPos0b)
- assertEquals(1,isdis.getUnsignedLong(1,FakeFormatInfo_MSBF_BE).toLong)
- // we've only consumed 1 bit meaning
- // we should have only fetched 1 byte and this will NOT encounter end of
data yet.
- assertFalse(isdis.hasReachedEndOfData)
- assertEquals(1, isdis.bitPos0b)
- // try to read 7 more bits.
- // it will not succeed due to the bit limit, but
- // it is still not enough for us to have hit end of data
- assertFalse(isdis.isDefinedForLength(7))
- assertFalse(isdis.hasReachedEndOfData)
- // but, if we try to read 8 more bits, that puts us past the end of data
- // except, since there's a bit limit, we'll never touch the underlying
- // input source, so we still won't have gotten an end-of-data
- assertFalse(isdis.isDefinedForLength(8))
- assertFalse(isdis.hasReachedEndOfData)
- // if we remove the bit limit however, ...
- isdis.setBitLimit0b(MaybeULong.Nope)
- // 7 more bits of the first byte are available
- assertTrue(isdis.isDefinedForLength(7))
- // but if we even test for bits beyond that, we'll encounter the
end-of-data
- assertFalse(isdis.isDefinedForLength(8))
- assertTrue(isdis.hasReachedEndOfData)
- }
-
/**
* This test shows that for a TCP stream, if 1 byte is sent,
* then if you attempt to read more than that many bytes, it will
diff --git
a/daffodil-japi/src/main/java/org/apache/daffodil/japi/logger/LogLevel.java
b/daffodil-japi/src/main/java/org/apache/daffodil/japi/logger/LogLevel.java
deleted file mode 100644
index 46969c222..000000000
--- a/daffodil-japi/src/main/java/org/apache/daffodil/japi/logger/LogLevel.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.japi.logger;
-
-/**
- * Logging levels.
- * <p>
- * Error, Warning, and Info are intended for general use. The default is Info.
- * <p>
- * Levels Resolver Compile, Debug, and OOLAGDebug are intended for Daffodil
developer
- * use.
- * @deprecated Use Log4j for logging. Since 3.2.0.
- */
-@Deprecated
-public enum LogLevel {
- Error(10),
- Warning(20),
- Info(30),
- Resolver(35), // For messages about resolving schema locations from
namespaces or other.
- Compile(40),
- Debug(50),
- OOLAGDebug(60),
- DelimDebug(70);
-
- /**
- * Numeric ID of the log level
- */
- public final int id;
-
- /**
- * Create a LogLevel with a specified id
- */
- private LogLevel(int id) {
- this.id = id;
- }
-}
diff --git
a/daffodil-japi/src/main/scala/org/apache/daffodil/japi/Daffodil.scala
b/daffodil-japi/src/main/scala/org/apache/daffodil/japi/Daffodil.scala
index a287ec375..b139fa8e3 100644
--- a/daffodil-japi/src/main/scala/org/apache/daffodil/japi/Daffodil.scala
+++ b/daffodil-japi/src/main/scala/org/apache/daffodil/japi/Daffodil.scala
@@ -20,7 +20,6 @@ package org.apache.daffodil.japi
import java.io.File
import java.net.URI
-import java.nio.channels.Channels
import java.nio.channels.ReadableByteChannel
import java.nio.channels.WritableByteChannel
@@ -42,12 +41,9 @@ import org.apache.daffodil.debugger.{ InteractiveDebugger =>
SInteractiveDebugge
import org.apache.daffodil.debugger.{ TraceDebuggerRunner =>
STraceDebuggerRunner }
import org.apache.daffodil.dsom.ExpressionCompilers
import org.apache.daffodil.dsom.walker.RootView
-import org.apache.daffodil.externalvars.Binding
-import org.apache.daffodil.externalvars.ExternalVariablesLoader
import org.apache.daffodil.japi.debugger._
import org.apache.daffodil.japi.infoset._
import org.apache.daffodil.japi.io.InputSourceDataInputStream
-import org.apache.daffodil.japi.logger._
import org.apache.daffodil.japi.packageprivate._
import org.apache.daffodil.processors.{ DaffodilParseXMLReader =>
SDaffodilParseXMLReader }
import org.apache.daffodil.processors.{ DaffodilUnparseContentHandler =>
SDaffodilUnparseContentHandler }
@@ -56,10 +52,6 @@ import org.apache.daffodil.processors.{
ExternalVariableException => SExternalVa
import org.apache.daffodil.processors.{ InvalidUsageException =>
SInvalidUsageException }
import org.apache.daffodil.processors.{ ParseResult => SParseResult }
import org.apache.daffodil.processors.{ UnparseResult => SUnparseResult }
-import org.apache.daffodil.util.Maybe
-import org.apache.daffodil.util.Maybe._
-import org.apache.daffodil.util.MaybeULong
-import org.apache.daffodil.xml.NS
import org.apache.daffodil.xml.XMLUtils
import org.apache.daffodil.xml.DFDLCatalogResolver
@@ -84,24 +76,6 @@ object Daffodil {
new Compiler(SCompiler())
}
- /**
- * Set the LogWriter to use to capture logging messages from Daffodil
- *
- * @param lw log writer to capture logging messages
- */
- @deprecated("Use Log4j for logging", "3.2.0")
- def setLogWriter(lw: LogWriter): Unit = {
- }
-
- /**
- * Set the maximum logging level
- *
- * @param lvl log level
- */
- @deprecated("Use Log4j for logging", "3.2.0")
- def setLoggingLevel(lvl: LogLevel): Unit = {
- }
-
}
/**
@@ -216,83 +190,6 @@ class Compiler private[japi] (private var sCompiler:
SCompiler) {
}
}
- /**
- * Specify a global element to be the root of DFDL Schema to start parsing
- *
- * @param name name of the root node
- * @param namespace namespace of the root node. Set to empty string to
specify
- * no namespace. Set to to NULL to figure out the namespace.
- */
- @deprecated("Pass arguments to compileSource, or compileFile.", "2.6.0")
- def setDistinguishedRootNode(name: String, namespace: String): Unit =
- sCompiler = sCompiler.withDistinguishedRootNode(name, namespace)
-
- /**
- * Set the value of a DFDL variable
- *
- * @param name name of the variable
- * @param namespace namespace of the variable. Set to empty string to specify
- * no namespace. Set to to NULL to figure out the namespace.
- * @param value value to so the variable to
- */
- @deprecated("Use DataProcessor.withExternalVariable.", "2.6.0")
- def setExternalDFDLVariable(name: String, namespace: String, value: String):
Unit = {
- val bindings = Seq(Binding(name, Some(NS(namespace)), value))
- sCompiler = sCompiler.withExternalDFDLVariablesImpl(bindings)
- }
-
- /**
- * Set the value of multiple DFDL variables
- *
- * @param extVarsMap a may of key/value pairs, where the key is the variable
- * name, and the value is the value of the variable. The
key
- * may be preceded by a string of the form "{namespace}" to
- * define a namespace for the variable. If preceded with
"{}",
- * then no namespace is used. With not preceded by
"{namespace}",
- * then Daffodil will figure out the namespace.
- */
- @deprecated("Use DataProcessor.withExternalVariables.", "2.6.0")
- def setExternalDFDLVariables(extVarsMap: java.util.AbstractMap[String,
String]): Unit = {
- val extVars =
ExternalVariablesLoader.mapToBindings(extVarsMap.asScala.toMap)
- sCompiler = sCompiler.withExternalDFDLVariablesImpl(extVars)
- }
-
- /**
- * Read external variables from a Daffodil configuration file
- *
- * @see <a target="_blank"
href='https://daffodil.apache.org/configuration/'>Daffodil Configuration
File</a> - Daffodil configuration file format
- *
- * @param extVarsFile file to read DFDL variables from.
- */
- @deprecated("Use DataProcessor.withExternalVariables.", "2.6.0")
- def setExternalDFDLVariables(extVarsFile: File): Unit = {
- val extVars = ExternalVariablesLoader.fileToBindings(extVarsFile)
- sCompiler = sCompiler.withExternalDFDLVariablesImpl(extVars)
- }
-
- /**
- * Enable/disable DFDL validation of resulting infoset with the DFDL schema
- *
- * @param value true to enable validation, false to disabled
- */
- @deprecated("Do not use this method. DFDL schema validation should be
performed.", "2.6.0")
- def setValidateDFDLSchemas(value: Boolean): Unit =
- sCompiler = sCompiler.withValidateDFDLSchemas(value)
-
-
- /**
- * Set a Daffodil tunable parameter
- *
- * @see <a target="_blank"
href='https://daffodil.apache.org/configuration/#tunable-parameters'>Tunable
Parameters</a> - list of tunables names of default values
- *
- * @param tunable name of the tunable parameter to set.
- * @param value value of the tunable parameter to set
- */
- @deprecated("Use withTunable.", "2.6.0")
- def setTunable(tunable: String, value: String): Unit = {
- sCompiler = sCompiler.withTunable(tunable, value)
- }
-
/**
* Create a new Compiler instance having a specific Daffodil tunable
parameter value.
*
@@ -305,18 +202,6 @@ class Compiler private[japi] (private var sCompiler:
SCompiler) {
copy(sCompiler = sCompiler.withTunable(tunable, value))
}
- /**
- * Set the value of multiple tunable parameters
- *
- * @see <a target="_blank"
href='https://daffodil.apache.org/configuration/#tunable-parameters'>Tunable
Parameters</a> - list of tunables names of default values
- *
- * @param tunables a map of key/value pairs, where the key is the tunable
name and the value is the value to set it to
- */
- @deprecated("Use withTunables.", "2.6.0")
- def setTunables(tunables: java.util.AbstractMap[String, String]): Unit = {
- sCompiler = sCompiler.withTunables(tunables.asScala.toMap)
- }
-
/**
* Create a new Compiler instance having specific Daffodil tunable parameter
values.
*
@@ -340,17 +225,6 @@ class ProcessorFactory private[japi] (private var pf:
SProcessorFactory)
private def copy(pf: SProcessorFactory = pf) = new ProcessorFactory(pf)
- /**
- * Specify a global element to be the root of DFDL Schema to start parsing
- *
- * @param name name of the root node
- * @param namespace namespace of the root node. Set to empty string to
specify
- * no namespace. Set to to NULL to figure out the namespace.
- */
- @deprecated("Use withDistinguishedRootNode.", "2.6.0")
- def setDistinguishedRootNode(name: String, namespace: String): Unit =
- pf = pf.withDistinguishedRootNode(name, namespace)
-
/**
* Get a new [[ProcessorFactory]] having a global element specified as the
root of DFDL Schema to start parsing.
*
@@ -404,14 +278,6 @@ abstract class WithDiagnostics private[japi] (wd:
SWithDiagnostics)
*/
def isError() = wd.isError
- /**
- * Determine if this object can be used in any future parse activities
- *
- * @return true it is safe to proceed, false otherwise
- */
- @deprecated("Use !isError() to determine if it is safe to proceed","2.0.0")
- def canProceed() = !isError
-
/**
* Get the list of [[Diagnostic]]'s created during the construction of the
parent object
*
@@ -481,22 +347,6 @@ class Diagnostic private[japi] (d: SDiagnostic) {
class DataLocation private[japi] (dl: SDataLocation) {
override def toString() = dl.toString
- /**
- * Determine if we're positioned at the end of data.
- *
- * Blocks until either one byte of data can be read, or end-of-data
- * is encountered.
- *
- * It is generally not advised to use this on network TCP data streams
- * as it will block waiting for the sender of data to provide more data
- * or close the stream.
- *
- * @return boolean indicating whether we are known to be positioned at
- * the end of data.
- */
- @deprecated("Use comparison of bitPos1b() with expected position instead.",
"3.1.0")
- def isAtEnd() = dl.isAtEnd
-
/**
* Get the position of the data, in bits, using 1-based indexing
*
@@ -531,19 +381,6 @@ class DataProcessor private[japi] (private var dp:
SDataProcessor)
private def copy(dp: SDataProcessor = dp) = new DataProcessor(dp)
- /**
- * Enable/disable debugging.
- *
- * Before enabling, [[DataProcessor#withDebugger]] or
[[DataProcessor#withDebuggerRunner(DebuggerRunner)]] must be
- * called with a non-null debugger.
- *
- * @param flag true to enable debugging, false to disabled
- */
- @deprecated("Use withDebugging.", "2.6.0")
- def setDebugging(flag: Boolean): Unit = {
- dp = dp.withDebugging(flag)
- }
-
/**
* Obtain a new [[DataProcessor]] instance with debugging enabled or
disabled.
*
@@ -556,17 +393,6 @@ class DataProcessor private[japi] (private var dp:
SDataProcessor)
copy(dp = dp.withDebugging(flag))
}
- /**
- * Set the debugger runner
- *
- * @param dr debugger runner
- */
- @deprecated("Use withDebuggerRunner.", "2.6.0")
- def setDebugger(dr: DebuggerRunner): Unit = {
- val debugger = newDebugger(dr)
- dp = dp.withDebugger(debugger)
- }
-
/**
* Obtain a new [[DataProcessor]] with a specified debugger runner.
*
@@ -600,19 +426,6 @@ class DataProcessor private[japi] (private var dp:
SDataProcessor)
debugger
}
- /**
- * Set validation mode
- *
- * @param mode mode to control validation
- * @throws InvalidUsageException if mode is not a valid ValidateMode value
- */
- @deprecated("Use withValidationMode.", "2.6.0")
- @throws(classOf[InvalidUsageException])
- def setValidationMode(mode: ValidationMode): Unit = {
- try { dp = dp.withValidationMode(ValidationConversions.modeToScala(mode)) }
- catch { case e: SInvalidUsageException => throw new
InvalidUsageException(e) }
- }
-
/**
* Obtain a new [[DataProcessor]] having a specific validation mode
*
@@ -632,23 +445,6 @@ class DataProcessor private[japi] (private var dp:
SDataProcessor)
def withValidator(validator: Validator): DataProcessor =
copy(dp =
dp.withValidationMode(org.apache.daffodil.api.ValidationMode.Custom(validator)))
- /**
- * Read external variables from a Daffodil configuration file
- *
- * @see <a target="_blank"
href='https://daffodil.apache.org/configuration/'>Daffodil Configuration
File</a> - Daffodil configuration file format
- *
- * @param extVars file to read DFDL variables from.
- * @throws ExternalVariableException if an error occurs while setting an
external variable
- */
- @deprecated("Use withExternalVariables.", "2.6.0")
- @throws(classOf[ExternalVariableException])
- def setExternalVariables(extVars: File): Unit = {
- //$COVERAGE-OFF$
- try { dp = dp.withExternalVariables(extVars) }
- catch { case e: SExternalVariableException => throw new
ExternalVariableException(e.getMessage) }
- //$COVERAGE-ON$
- }
-
/**
* Obtain a new [[DataProcessor]] with external variables read from a
Daffodil configuration file
*
@@ -663,46 +459,6 @@ class DataProcessor private[japi] (private var dp:
SDataProcessor)
catch { case e: SExternalVariableException => throw new
ExternalVariableException(e.getMessage) }
}
- /**
- * Set the value of multiple DFDL variables
- *
- * @param extVars a map of key/value pairs, where the key is the variable
- * name, and the value is the value of the variable. The key
- * may be preceded by a string of the form "{namespace}" to
- * define a namespace for the variable. If preceded with "{}",
- * then no namespace is used. If not preceded by anything,
- * then Daffodil will figure out the namespace.
- * @throws ExternalVariableException if an error occurs while setting an
external variable
- */
- @deprecated("Use withExternalVariables.", "2.6.0")
- @throws(classOf[ExternalVariableException])
- def setExternalVariables(extVars: Map[String, String]) = {
- //$COVERAGE-OFF$
- try { dp = dp.withExternalVariables(extVars) }
- catch { case e: SExternalVariableException => throw new
ExternalVariableException(e.getMessage) }
- //$COVERAGE-ON$
- }
-
- /**
- * Obtain a new [[DataProcessor]] with multiple DFDL variables set.
- *
- * @param extVars a map of key/value pairs, where the key is the variable
- * name, and the value is the value of the variable. The key
- * may be preceded by a string of the form "{namespace}" to
- * define a namespace for the variable. If preceded with "{}",
- * then no namespace is used. If not preceded by anything,
- * then Daffodil will figure out the namespace.
- * @throws ExternalVariableException if an error occurs while setting an
external variable
- */
- @deprecated("Use withExternalVariables that accepts a Java AbstractMap",
"3.0")
- @throws(classOf[ExternalVariableException])
- def withExternalVariables(extVars: Map[String, String]): DataProcessor = {
- //$COVERAGE-OFF$
- try { copy(dp = dp.withExternalVariables(extVars)) }
- catch { case e: SExternalVariableException => throw new
ExternalVariableException(e.getMessage) }
- //$COVERAGE-ON$
- }
-
/**
* Obtain a new [[DataProcessor]] with multiple DFDL variables set.
*
@@ -743,65 +499,6 @@ class DataProcessor private[japi] (private var dp:
SDataProcessor)
new DaffodilUnparseContentHandler(sContentHandler =
dp.newContentHandlerInstance(output).asInstanceOf[SDaffodilUnparseContentHandler])
- /**
- * Parse input data with a specified length
- *
- * @param input data to be parsed
- * @param lengthLimitInBits the length of the input data in bits, or -1 if
no limit
- * @return an object which contains the result, and/or diagnostic
information.
- */
- @deprecated("Use parse(InputSourceDataInputStream, InfosetOutputter) to
parse the data and get the infoset representation from the InfosetOutputter
instead of ParseResult#result()","2.2.0")
- def parse(input: ReadableByteChannel, lengthLimitInBits: Long): ParseResult
= {
- val is = Channels.newInputStream(input)
- val dis = new InputSourceDataInputStream(is)
- if (lengthLimitInBits > 0) {
- dis.dis.setBitLimit0b(MaybeULong(lengthLimitInBits))
- }
- val output = new JDOMInfosetOutputter()
- val pr = dp.parse(dis.dis, output).asInstanceOf[SParseResult]
- new ParseResult(pr, Maybe(output))
- }
-
- /**
- * Parse input data without specifying a length
- *
- * @param input data to be parsed
- * @return an object which contains the result, and/or diagnostic
information.
- */
- @deprecated("Use parse(InputSourceDataInputStream, InfosetOutputter) to
parse the data and get the infoset representation from the InfosetOutputter
instead of ParseResult#result()", "2.2.0")
- def parse(input: ReadableByteChannel): ParseResult = parse(input, -1)
-
- /**
- * Parse input data with a specified length
- *
- * @param input data to be parsed
- * @param output the InfosetOutputter that will be used to output the infoset
- * @param lengthLimitInBits the length of the input data in bits, or -1 if
no limit
- * @return an object which contains the result, and/or diagnostic
information.
- */
- @deprecated("Use parse(InputSourceDataInputStream, InfosetOutputter) to
parse the data and get the infoset representation from the InfosetOutputter
instead of ParseResult#result()", "2.2.0")
- def parse(input: ReadableByteChannel, output: InfosetOutputter,
lengthLimitInBits: Long): ParseResult = {
- val is = Channels.newInputStream(input)
- val dis = new InputSourceDataInputStream(is)
- if (lengthLimitInBits > 0) {
- dis.dis.setBitLimit0b(MaybeULong(lengthLimitInBits))
- }
- val pr = dp.parse(dis.dis, output).asInstanceOf[SParseResult]
- new ParseResult(pr, Nope)
- }
-
- /**
- * Parse input data without specifying a length
- *
- * Use this when you don't know how big the data is.
- *
- * @param input data to be parsed
- * @param output the InfosetOutputter that will be used to output the infoset
- * @return an object which contains the result, and/or diagnostic
information.
- */
- @deprecated("Use parse(InputSourceDataInputStream, InfosetOutputter) to
parse the data and get the infoset representation from the InfosetOutputter
instead of ParseResult#result()", "2.2.0")
- def parse(input: ReadableByteChannel, output: InfosetOutputter): ParseResult
= parse(input, output, -1)
-
/**
* Parse input data from an InputSourceDataInputStream and output the
infoset to an InfosetOutputter
*
@@ -811,7 +508,7 @@ class DataProcessor private[japi] (private var dp:
SDataProcessor)
*/
def parse(input: InputSourceDataInputStream, output: InfosetOutputter):
ParseResult = {
val pr = dp.parse(input.dis, output).asInstanceOf[SParseResult]
- new ParseResult(pr, Nope)
+ new ParseResult(pr)
}
/**
@@ -825,50 +522,15 @@ class DataProcessor private[japi] (private var dp:
SDataProcessor)
val ur = dp.unparse(input, output).asInstanceOf[SUnparseResult]
new UnparseResult(ur)
}
-
- /**
- * Unparse a JDOM2 infoset
- *
- * @param output the byte channel to write the data to
- * @param infoset the infoset to unparse, as a jdom event cursor
- * @return an object with contains the result and/or diagnostic information
- */
- @deprecated("Use unparse(InfosetInputter, WritableByteChannel)", "2.0.0")
- def unparse(output: WritableByteChannel, infoset: org.jdom2.Document):
UnparseResult = {
- val input = new JDOMInfosetInputter(infoset)
- unparse(input, output)
- }
}
/**
- * Result of calling
[[DataProcessor#parse(java.nio.channels.ReadableByteChannel, InfosetOutputter,
long)]], containing
+ * Result of calling [[DataProcessor#parse(InputSourceDataInputStream,
InfosetOutputter)]], containing
* the diagnostic information, and the final data location
*/
-class ParseResult private[japi] (pr: SParseResult, deprecatedOutput:
Maybe[JDOMInfosetOutputter])
+class ParseResult private[japi] (pr: SParseResult)
extends WithDiagnostics(pr) {
- /**
- * Get the resulting infoset as a jdom2 Document
- *
- * @throws InvalidUsageException if you call this when isError is true
- * because in that case there is no result document.
- *
- * @return a jdom2 Document representing the DFDL infoset for the parsed data
- */
- @deprecated("Use parse(ReadableByteChannel, InfosetInputter) to parse the
data and get the infoset representation from the InfosetOutputter","2.0.0")
- @throws(classOf[InvalidUsageException])
- def result(): org.jdom2.Document = {
- // When this result function is removed due to deprecation, we should also
- // remove the deprecatedOutput parameter to the ParseResult constructor
- if (deprecatedOutput.isDefined) {
- deprecatedOutput.get.getResult()
- } else {
- val ex = new org.apache.daffodil.processors.InvalidUsageException(
- "When passing an InfosetOutputter to parse(), you must get the infoset
result from the InfosetOutputter instead of the ParseResult.")
- throw new InvalidUsageException(ex)
- }
- }
-
/**
* Get the [[DataLocation]] where the parse completed
*
@@ -989,7 +651,7 @@ class DaffodilParseXMLReader private[japi] (xmlrdr:
SDaffodilParseXMLReader) ext
override def getProperty(name: String): AnyRef = {
val res = xmlrdr.getProperty(name)
if (name == DaffodilParseXMLReader.DAFFODIL_SAX_URN_PARSERESULT) {
- val pr = new ParseResult(res.asInstanceOf[SParseResult], Nope)
+ val pr = new ParseResult(res.asInstanceOf[SParseResult])
pr
} else {
res
diff --git
a/daffodil-japi/src/main/scala/org/apache/daffodil/japi/infoset/Infoset.scala
b/daffodil-japi/src/main/scala/org/apache/daffodil/japi/infoset/Infoset.scala
index 47eebe1d7..3ccfbb22e 100644
---
a/daffodil-japi/src/main/scala/org/apache/daffodil/japi/infoset/Infoset.scala
+++
b/daffodil-japi/src/main/scala/org/apache/daffodil/japi/infoset/Infoset.scala
@@ -236,25 +236,6 @@ class ScalaXMLInfosetOutputter(showFormatInfo: Boolean =
false)
class XMLTextInfosetOutputter private (outputter: SXMLTextInfosetOutputter)
extends InfosetOutputterProxy {
- /**
- * Output the infoset as XML Text, written to a java.io.Writer
- *
- * @param writer the java.io.Writer to write the XML text to
- * @param pretty enable or disable pretty printing. Pretty printing will only
- * insert indentation and newlines where it will not affect the
- * content of the XML.
- */
- @deprecated("This constructor is deprecated. Use
XMLTextInfosetOutputter(java.io.OutputStream, Boolean) instead.", "2.4.0")
- def this(writer: java.io.Writer, pretty: Boolean) = this(new
SXMLTextInfosetOutputter(writer, pretty))
-
- /**
- * Output the infoset as XML Text, written to a java.io.Writer
- *
- * @param writer the java.io.Writer to write the XML text to
- */
- @deprecated("This constructor is deprecated. Use
XMLTextInfosetOutputter(java.io.OutputStream, Boolean) instead.", "2.4.0")
- def this(writer: java.io.Writer) = this(writer, true)
-
/**
* Output the infoset as XML Text, written to a java.io.OutputStream
*
@@ -274,25 +255,6 @@ class XMLTextInfosetOutputter private (outputter:
SXMLTextInfosetOutputter)
class JsonInfosetOutputter private (outputter: SJsonInfosetOutputter)
extends InfosetOutputterProxy {
- /**
- * Output the infoset as json text, written to a java.io.Writer
- *
- * @param writer the java.io.Writer to write the json text to
- * @param pretty enable or disable pretty printing. Pretty printing will only
- * insert indentation and newlines where it will not affect the
- * content of the json.
- */
- @deprecated("This constructor is deprecated. Use
JsonInfosetOutputter(java.io.OutputStream, Boolean) instead.", "2.4.0")
- def this(writer: java.io.Writer, pretty: Boolean) = this(new
SJsonInfosetOutputter(writer, pretty))
-
- /**
- * Output the infoset as json text, written to a java.io.Writer
- *
- * @param writer the java.io.Writer to write the json text to
- */
- @deprecated("This constructor is deprecated. Use
JsonInfosetOutputter(java.io.OutputStream, Boolean) instead.", "2.4.0")
- def this(writer: java.io.Writer) = this(writer, true)
-
/**
* Output the infoset as json text, written to a java.io.OutputStream
*
@@ -366,14 +328,6 @@ class ScalaXMLInfosetInputter(node: scala.xml.Node)
class XMLTextInfosetInputter private (inputter: SXMLTextInfosetInputter)
extends InfosetInputterProxy {
- /**
- * Read in an infoset in the form of XML text from a java.io.Reader
- *
- * @param reader the java.io.Reader to read the XML text from
- */
- @deprecated("This constructor is deprecated. Use
XMLTextInfosetInputter(java.io.InputStream) instead.", "2.4.0")
- def this(reader: java.io.Reader) = this(new SXMLTextInfosetInputter(reader))
-
/**
* Read in an infoset in the form of XML text from a java.io.InputStream
*
@@ -390,14 +344,6 @@ class XMLTextInfosetInputter private (inputter:
SXMLTextInfosetInputter)
class JsonInfosetInputter private (inputter: SJsonInfosetInputter)
extends InfosetInputterProxy {
- /**
- * Read in an infoset in the form of json text from a java.io.Reader
- *
- * @param reader the java.io.Reader to read the json text from
- */
- @deprecated("This constructor is deprecated. Use
JsonInfosetInputter(java.io.InputStream) instead.", "2.4.0")
- def this(reader: java.io.Reader) = this(new SJsonInfosetInputter(reader))
-
/**
* Read in an infoset in the form of json text from a java.io.InputStream
*
diff --git
a/daffodil-japi/src/main/scala/org/apache/daffodil/japi/logger/Logger.scala
b/daffodil-japi/src/main/scala/org/apache/daffodil/japi/logger/Logger.scala
deleted file mode 100644
index 6f5b592eb..000000000
--- a/daffodil-japi/src/main/scala/org/apache/daffodil/japi/logger/Logger.scala
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * 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.japi.logger
-
-import java.io.File
-import scala.collection.JavaConverters._
-
-/**
- * Abstract log writer, which can be overridden to create a custom log writer.
- */
-@deprecated("Use Log4j for logging", "3.2.0")
-abstract class LogWriter {
- /**
- * Implement this method to determine how the log message is written.
- *
- * @param level level of the message
- * @param logID identification of class that created the log message
- * @param msg log message
- */
- protected def write(level: LogLevel, logID: String, msg: String): Unit
-
- /**
- * Override to change the prefix string of the log message.
- *
- * By default, the prefix is the empty string.
- *
- * @param level level of the message
- * @param logID identification of class that created the log message
- * @return the prefix to use for log messages. Defaults to the empty string
if not overridden.
- */
- protected def prefix(level: LogLevel, logID: String): String = ""
-
- /**
- * Override to change the suffix string of the log message.
- *
- * By default, the suffix is the empty string.
- *
- * @param level level of the message
- * @param logID identification of class that created the log message
- * @return the suffix to use for log messages. Defaults to the empty string
if not overridden.
- */
- protected def suffix(level: LogLevel, logID: String): String = ""
-
- /**
- * Generates a log message as a string and calls the write method.
- *
- * The default implementation generates a log message based on the prefix,
- * suffix, message string, and log arguments, and passes the generated log
- * message, level, and logId to [[LogWriter#write]].
- *
- * Can be overridden if more control is needed over the logging mechanism
and/or
- * log arguments are needed as separate entities.
- *
- * @param level level of the message
- * @param logID identification of class that created the log message
- * @param msg printf-style format string
- * @param args arguments passed to the logger, matching the format string
- */
- def log(level: LogLevel, logID: String, msg: String, args:
java.util.List[Any]): Unit = {
- val message =
- if (args.size > 0) {
- msg.format(args.asScala: _*)
- } else {
- msg
- }
- val p = prefix(level, logID)
- val s = suffix(level, logID)
- write(level, logID, p + message + s)
- }
-}
-
-/*
- * These three classes are all empty and are not ever actually used. They are
- * just place holders. Whenever the Java API uses one of these, it is
- * translated to the appropriate Scala log writer. They are marked final so
- * that they cannot be extended, since the Scala pattern matcher would still
- * match and use the equivalent Scala log writers and lose any added
- * functionality. One must extend the LogWriter to create their own log writer.
- */
-
-/**
- * [[LogWriter]] that writes log messages to stdout
- */
-@deprecated("Use Log4j for logging", "3.2.0")
-final class ConsoleLogWriter extends LogWriter {
- protected def write(level: LogLevel, logID: String, msg: String): Unit = {
- //do nothing
- }
-}
-
-/**
- * [[LogWriter]] that drops all log messages
- */
-@deprecated("Use Log4j for logging", "3.2.0")
-final class NullLogWriter extends LogWriter {
- protected def write(level: LogLevel, logID: String, msg: String): Unit = {
- //do nothing
- }
-}
-
-/**
- * [[LogWriter]] that writes all log messages to a file.
- *
- * @param file the file to write log messages to
- */
-@deprecated("Use Log4j for logging", "3.2.0")
-final class FileLogWriter(file: File) extends LogWriter {
- /**
- * Retrieve the file the log writer writes to
- *
- * @return the file the log writer writes to
- */
- def getFile = file
- protected def write(level: LogLevel, logID: String, msg: String): Unit = {
- //do nothing
- }
-}
diff --git
a/daffodil-japi/src/test/java/org/apache/daffodil/example/TestJavaAPI.java
b/daffodil-japi/src/test/java/org/apache/daffodil/example/TestJavaAPI.java
index 11a0235eb..8b34d0d77 100644
--- a/daffodil-japi/src/test/java/org/apache/daffodil/example/TestJavaAPI.java
+++ b/daffodil-japi/src/test/java/org/apache/daffodil/example/TestJavaAPI.java
@@ -971,7 +971,7 @@ public class TestJavaAPI {
}
@Test
- public void testJavaAPI22_setExternalVariablesUsingAbstractMap() throws
IOException, ClassNotFoundException, ExternalVariableException {
+ public void testJavaAPI22_withExternalVariablesUsingAbstractMap() throws
IOException, ClassNotFoundException, ExternalVariableException {
// Demonstrates here that we can set external variables using a
// Java AbstractMap after compilation but before parsing via
DataProcessor.
DebuggerRunnerForJAPITest debugger = new DebuggerRunnerForJAPITest();
diff --git
a/daffodil-lib/src/main/scala/org/apache/daffodil/api/Diagnostic.scala
b/daffodil-lib/src/main/scala/org/apache/daffodil/api/Diagnostic.scala
index c5359630b..b99dad4ab 100644
--- a/daffodil-lib/src/main/scala/org/apache/daffodil/api/Diagnostic.scala
+++ b/daffodil-lib/src/main/scala/org/apache/daffodil/api/Diagnostic.scala
@@ -224,10 +224,6 @@ abstract class Diagnostic protected (
*/
trait DataLocation {
def toString: String
-
- @deprecated("Use comparison of bitPos1b with expected position instead.",
"3.1.0")
- def isAtEnd: Boolean
-
def bitPos1b: Long
def bytePos1b: Long
}
diff --git
a/daffodil-lib/src/main/scala/org/apache/daffodil/processors/Runtime.scala
b/daffodil-lib/src/main/scala/org/apache/daffodil/processors/Runtime.scala
deleted file mode 100644
index 07f842f7d..000000000
--- a/daffodil-lib/src/main/scala/org/apache/daffodil/processors/Runtime.scala
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.processors
-
-/**
- * Mixin that captures the ability to set debuggers and debugging on/off
- * for multiple DFDL implementations.
- *
- * Must be here in this library for code sharing reasons.
- */
-trait HasSetDebugger {
-
- /**
- * dbg is AnyRef since the type of the debugger is specific to a particular
implementation of DFDL.
- *
- * Implementations of this mixin should cast this parameter down to the kind
of debugger they expect.
- */
- def setDebugger(dbg: AnyRef): Unit
-
- /**
- * Given a debugger. This turns on/off actual debugging.
- */
- def setDebugging(b: Boolean): Unit
-}
diff --git
a/daffodil-propgen/src/main/scala/org/apache/daffodil/propGen/TunableGenerator.scala
b/daffodil-propgen/src/main/scala/org/apache/daffodil/propGen/TunableGenerator.scala
index 108181433..42758064d 100644
---
a/daffodil-propgen/src/main/scala/org/apache/daffodil/propGen/TunableGenerator.scala
+++
b/daffodil-propgen/src/main/scala/org/apache/daffodil/propGen/TunableGenerator.scala
@@ -62,11 +62,11 @@ class TunableGenerator(schemaRootConfig: scala.xml.Node,
schemaRootExt: scala.xm
|object DaffodilTunables extends DaffodilTunablesStaticMixin {
|
| def apply(tunables: Map[String, String]): DaffodilTunables = {
- | apply().setTunables(tunables)
+ | apply().withTunables(tunables)
| }
|
| def apply(tunable: String, value: String): DaffodilTunables = {
- | apply().setTunable(tunable, value)
+ | apply().withTunable(tunable, value)
| }
|
| def apply(): DaffodilTunables = {
@@ -81,7 +81,7 @@ class TunableGenerator(schemaRootConfig: scala.xml.Node,
schemaRootExt: scala.xm
| Map.empty
| }
|
- | new DaffodilTunables().setTunables(configTunables)
+ | new DaffodilTunables().withTunables(configTunables)
| }
|}
|
@@ -91,11 +91,11 @@ class TunableGenerator(schemaRootConfig: scala.xml.Node,
schemaRootExt: scala.xm
val middle = """
| extends Serializable {
|
- | def setTunables(tunables: Map[String, String]): DaffodilTunables = {
- | tunables.foldLeft(this) { case (dafTuns, (tunable, value)) =>
dafTuns.setTunable(tunable, value) }
+ | def withTunables(tunables: Map[String, String]): DaffodilTunables = {
+ | tunables.foldLeft(this) { case (dafTuns, (tunable, value)) =>
dafTuns.withTunable(tunable, value) }
| }
|
- | def setTunable(tunable: String, value: String): DaffodilTunables = {
+ | def withTunable(tunable: String, value: String): DaffodilTunables = {
| tunable match {
""".trim.stripMargin
diff --git
a/daffodil-runtime1/src/main/scala/org/apache/daffodil/api/DFDLParserUnparser.scala
b/daffodil-runtime1/src/main/scala/org/apache/daffodil/api/DFDLParserUnparser.scala
index 804a65b5d..e76720db8 100644
---
a/daffodil-runtime1/src/main/scala/org/apache/daffodil/api/DFDLParserUnparser.scala
+++
b/daffodil-runtime1/src/main/scala/org/apache/daffodil/api/DFDLParserUnparser.scala
@@ -105,11 +105,6 @@ object DFDL {
* it will search for a unique element with your root element name, and
* if that is unambiguous, it will use it as the root.
*/
- @deprecated("Use arguments to compileSource, or compileFile method.",
"2.6.0")
- def setDistinguishedRootNode(name: String, namespace: String): Unit
-
- @deprecated("Use DataProcessor.withExternalVariables.", "2.6.0")
- def setExternalDFDLVariable(name: String, namespace: String, value:
String): Unit
/**
* Compilation returns a [[ProcessorFactory]], which must be interrogated
for diagnostics
@@ -146,8 +141,6 @@ object DFDL {
* To explicitly specify that there is no-namespace, pass "" as
* the namespace argument.
*/
- @deprecated("Use arguments to Compiler.compileSource or compileFile.",
"2.6.0")
- def setDistinguishedRootNode(name: String, namespace: String = null): Unit
/**
* Returns a [[DataProcessor]] to process data matching a compiled XPath
expression
@@ -194,27 +187,14 @@ object DFDL {
def withExternalVariables(extVars: Map[String, String]): DataProcessor
def withExternalVariables(extVars: File): DataProcessor
def withExternalVariables(extVars: Seq[Binding]): DataProcessor
+ def withDebugger(dbg:AnyRef): DataProcessor
+ def withDebugging(flag: Boolean): DataProcessor
def validationMode: ValidationMode.Type
def getTunables(): DaffodilTunables
def save(output: DFDL.Output): Unit
def variableMap: VariableMap
-
- @deprecated("Use withValidationMode.", "2.6.0")
- def setValidationMode(mode: ValidationMode.Type): Unit
- @deprecated("Use DataProcessor.withExternalVariables.", "2.6.0")
- def setExternalVariables(extVars: Map[String, String]): Unit
- @deprecated("Use DataProcessor.withExternalVariables.", "2.6.0")
- def setExternalVariables(extVars: File): Unit
- @deprecated("Use DataProcessor.withExternalVariables.", "2.6.0")
- def setExternalVariables(extVars: File, tunable: DaffodilTunables): Unit
- @deprecated("Use DataProcessor.withExternalVariables.", "2.6.0")
- def setExternalVariables(extVars: Seq[Binding]): Unit
- @deprecated("Use withTunables.", "2.6.0")
- def setTunable(tunable: String, value: String): Unit
- @deprecated("Use withTunables.", "2.6.0")
- def setTunables(tunables: Map[String,String]): Unit
}
trait DataProcessor extends DataProcessorBase with WithDiagnostics {
diff --git
a/daffodil-runtime1/src/main/scala/org/apache/daffodil/dsom/CompiledExpression1.scala
b/daffodil-runtime1/src/main/scala/org/apache/daffodil/dsom/CompiledExpression1.scala
index 586877329..b5042a6d9 100644
---
a/daffodil-runtime1/src/main/scala/org/apache/daffodil/dsom/CompiledExpression1.scala
+++
b/daffodil-runtime1/src/main/scala/org/apache/daffodil/dsom/CompiledExpression1.scala
@@ -103,9 +103,6 @@ abstract class CompiledExpression[+T <: AnyRef](
*
* isConstant must be true or this will throw.
*/
- @deprecated("Code should just call evaluate(...) on an Evaluatable object.",
"2016-02-18")
- def constant: T
-
def isConstant: Boolean
def evaluate(state: ParseOrUnparseState): T
diff --git
a/daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/JsonInfosetInputter.scala
b/daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/JsonInfosetInputter.scala
index 7d3a402c4..e45b62617 100644
---
a/daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/JsonInfosetInputter.scala
+++
b/daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/JsonInfosetInputter.scala
@@ -31,19 +31,11 @@ object JsonInfosetInputter {
lazy val jsonFactory = new JsonFactory()
}
-class JsonInfosetInputter private (input: Either[java.io.Reader,
java.io.InputStream])
+class JsonInfosetInputter(input: java.io.InputStream)
extends InfosetInputter {
- @deprecated("This constructor is deprecated. Use
JsonInfosetInputter(java.io.InputStream) instead.", "2.4.0")
- def this(reader: java.io.Reader) = { this(Left(reader)) }
-
- def this(is: java.io.InputStream) = { this(Right(is)) }
-
private lazy val jsp = {
- val j = input match {
- case Left(reader) => JsonInfosetInputter.jsonFactory.createParser(reader)
- case Right(is) => JsonInfosetInputter.jsonFactory.createParser(is)
- }
+ val j = JsonInfosetInputter.jsonFactory.createParser(input)
val tok = getNextToken(j)
if (tok != JsonToken.START_OBJECT) {
throw new IllegalContentWhereEventExpected("Expected json content
beginning with '{' but got '" + j.getText + "'")
diff --git
a/daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/JsonInfosetOutputter.scala
b/daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/JsonInfosetOutputter.scala
index 6658ae2c5..b450c409d 100644
---
a/daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/JsonInfosetOutputter.scala
+++
b/daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/JsonInfosetOutputter.scala
@@ -25,16 +25,11 @@ import org.apache.daffodil.dpath.NodeInfo
import org.apache.daffodil.util.Indentable
import org.apache.daffodil.util.MStackOfBoolean
-class JsonInfosetOutputter private (writer: java.io.Writer, pretty: Boolean,
dummy: Int)
+class JsonInfosetOutputter private (writer: java.io.Writer, pretty: Boolean)
extends InfosetOutputter with Indentable {
- @deprecated("This constructor is deprecated. Use
JsonInfosetOutputter(java.io.OutputStream, Boolean) instead.", "2.4.0")
- def this(writer: java.io.Writer, pretty: Boolean = true) = {
- this(writer, pretty, 0)
- }
-
def this(os: java.io.OutputStream, pretty: Boolean) = {
- this(new java.io.OutputStreamWriter(os, StandardCharsets.UTF_8), pretty, 0)
+ this(new java.io.OutputStreamWriter(os, StandardCharsets.UTF_8), pretty)
}
// Keeps track of if the next element we see is the first child or not of a
diff --git
a/daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/XMLTextInfosetInputter.scala
b/daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/XMLTextInfosetInputter.scala
index 7efbfc4a4..d78c806b1 100644
---
a/daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/XMLTextInfosetInputter.scala
+++
b/daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/XMLTextInfosetInputter.scala
@@ -188,24 +188,16 @@ object XMLTextInfoset {
}
}
-class XMLTextInfosetInputter private (input: Either[java.io.Reader,
java.io.InputStream])
+class XMLTextInfosetInputter(input: java.io.InputStream)
extends InfosetInputter {
- @deprecated("This constructor is deprecated. Use
XMLTextInfosetInputter(java.io.InputStream) instead.", "2.4.0")
- def this(reader: java.io.Reader) = { this(Left(reader)) }
-
- def this(is: java.io.InputStream) = { this(Right(is)) }
-
/**
* evAlloc is only to be used for diagnostic messages. It lets us easily
* capture and toString the event information. But we don't call it otherwise
* as it allocates an object, and we're trying to avoid that.
*/
private lazy val (xsr: XMLStreamReader, evAlloc: XMLEventAllocator) = {
- val xsr = input match {
- case Left(reader) =>
XMLTextInfoset.xmlInputFactory.createXMLStreamReader(reader)
- case Right(is) =>
XMLTextInfoset.xmlInputFactory.createXMLStreamReader(is)
- }
+ val xsr = XMLTextInfoset.xmlInputFactory.createXMLStreamReader(input)
//
// This gets the event allocator corresponding to the xmlStreamReader just
created.
diff --git
a/daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/XMLTextInfosetOutputter.scala
b/daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/XMLTextInfosetOutputter.scala
index 5ad73e261..54e1a647d 100644
---
a/daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/XMLTextInfosetOutputter.scala
+++
b/daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/XMLTextInfosetOutputter.scala
@@ -32,16 +32,11 @@ import org.apache.daffodil.util.Indentable
* @param pretty Whether or to enable pretty printing. Set to true, XML
* elements are indented and newlines are inserted.
*/
-class XMLTextInfosetOutputter private (writer: java.io.Writer, pretty:
Boolean, dummy: Int)
+class XMLTextInfosetOutputter private (writer: java.io.Writer, pretty: Boolean)
extends InfosetOutputter with Indentable with XMLInfosetOutputter {
- @deprecated("This constructor is deprecated. Use
XMLTextInfosetOutputter(java.io.OutputStream, Boolean) instead.", "2.4.0")
- def this(writer: java.io.Writer, pretty: Boolean = true) = {
- this(writer, pretty, 0)
- }
-
def this(os: java.io.OutputStream, pretty: Boolean) = {
- this(new java.io.OutputStreamWriter(os, StandardCharsets.UTF_8), pretty, 0)
+ this(new java.io.OutputStreamWriter(os, StandardCharsets.UTF_8), pretty)
}
private val sb = new StringBuilder()
diff --git
a/daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataLoc.scala
b/daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataLoc.scala
index a31608d0a..1a2948165 100644
---
a/daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataLoc.scala
+++
b/daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataLoc.scala
@@ -17,7 +17,6 @@
package org.apache.daffodil.processors
-import org.apache.daffodil.io.InputSourceDataInputStream
import org.apache.daffodil.exceptions._
import org.apache.daffodil.schema.annotation.props.gen.BitOrder
import org.apache.daffodil.util.Maybe
@@ -38,17 +37,6 @@ class DataLoc(
eitherStream: Either[DataOutputStream, DataInputStream],
val maybeERD: Maybe[ElementRuntimeData]) extends DataLocation {
- // $COVERAGE-OFF$
- @deprecated("Use bitPos1b to compare with expected position (possibly
bitLimit1b).", "3.1.0")
- override def isAtEnd = {
- eitherStream match {
- case Right(isdis: InputSourceDataInputStream) => isdis.isAtEnd
- case Left(_) => Assert.usageError("isAtEnd not defined for unparsing.")
- case Right(s) => Assert.invariantFailed("Unknown kind of data stream: "
+ s)
- }
- }
- // $COVERAGE-ON$
-
// override def toString = "DataLoc(bitPos1b='%s',
bitLimit1b='%s')".format(bitPos1b, bitLimit1b)
override def toString() = {
"byte " + bitPos1b / 8 + (if (bitLimit1b.isDefined) " limit(bytes) " +
bitLimit1b.get / 8 else "")
diff --git
a/daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataProcessor.scala
b/daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataProcessor.scala
index 3528e4378..482e1e47c 100644
---
a/daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataProcessor.scala
+++
b/daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataProcessor.scala
@@ -112,14 +112,6 @@ object DataProcessor {
}
super.withValidationMode(mode)
}
-
- @deprecated("Use withValidationMode.", "2.6.0")
- override def setValidationMode(mode: ValidationMode.Type): Unit = {
- if (mode == ValidationMode.Full) {
- throw new InvalidUsageException("'Full' validation not allowed when
using a restored parser.")
- }
- validationMode = mode
- }
}
}
@@ -128,24 +120,20 @@ object DataProcessor {
* back-end runtime.
*/
class DataProcessor private (
- //
- // Once the deprecated API goes away, these var can become val.
- //
- var ssrd: SchemaSetRuntimeData,
- var tunables: DaffodilTunables, // Compiler-set tunables
- var variableMap: VariableMap,
+ val ssrd: SchemaSetRuntimeData,
+ val tunables: DaffodilTunables, // Compiler-set tunables
+ val variableMap: VariableMap,
//
// The below do not need to be transient
// because this object itself isn't serialized. A SerializableDataProcessor
is.
// The values these will have (since this is a base class) are the correct
default values that we want
// back when the object is re-initialized.
//
- protected var areDebugging : Boolean,
- protected var optDebugger : Option[Debugger],
- var validationMode: ValidationMode.Type,
- private var externalVars: Queue[Binding])
+ protected val areDebugging : Boolean,
+ protected val optDebugger : Option[Debugger],
+ val validationMode: ValidationMode.Type,
+ private val externalVars: Queue[Binding])
extends DFDL.DataProcessor
- with HasSetDebugger
with Serializable
with MultipleEventHandler {
@@ -222,9 +210,6 @@ class DataProcessor private (
*
* Note that the default validation mode is "off", that is, no validation is
performed.
*/
- @deprecated("Use withValidationMode.", "2.6.0")
- def setValidationMode(mode: ValidationMode.Type): Unit = { validationMode =
mode }
-
def withValidationMode(mode:ValidationMode.Type): DataProcessor =
copy(validationMode = mode)
def withValidator(validator: Validator): DataProcessor =
withValidationMode(ValidationMode.Custom(validator))
@@ -246,25 +231,13 @@ class DataProcessor private (
optDebugger.get
}
- @deprecated("Use withDebugger.", "2.6.0")
- def setDebugger(dbg: AnyRef): Unit = {
- val optDbg = if (dbg eq null) None else Some(dbg.asInstanceOf[Debugger])
- optDebugger = optDbg
- }
-
def withDebugger(dbg:AnyRef) = {
val optDbg = if (dbg eq null) None else Some(dbg.asInstanceOf[Debugger])
copy(optDebugger = optDbg)
}
- @deprecated("Use withDebugging.", "2.6.0")
- def setDebugging(flag: Boolean): Unit = {
- areDebugging = flag
- tunables = tunables.setTunable("allowExternalPathExpressions",
flag.toString)
- }
-
def withDebugging(flag: Boolean): DataProcessor = {
- val newTunables = tunables.setTunable("allowExternalPathExpressions",
flag.toString)
+ val newTunables = tunables.withTunable("allowExternalPathExpressions",
flag.toString)
copy(areDebugging = flag, tunables = newTunables)
}
@@ -288,23 +261,11 @@ class DataProcessor private (
newVars
}
- @deprecated("Use withExternalVariables.", "2.6.0")
- def setExternalVariables(extVars: Map[String, String]): Unit = {
- val newBindings = loadExternalVariables(extVars)
- externalVars = newBindings
- }
-
def withExternalVariables(extVars: Map[String, String]): DataProcessor = {
val newBindings = loadExternalVariables(extVars)
copy(externalVars = newBindings)
}
- @deprecated("Use withExternalVariables.", "2.6.0")
- def setExternalVariables(extVars: File): Unit = {
- val newBindings = loadExternalVariables(extVars)
- externalVars = newBindings
- }
-
def withExternalVariables(extVars: File): DataProcessor = {
val newBindings = loadExternalVariables(extVars)
copy(externalVars = newBindings)
@@ -317,32 +278,14 @@ class DataProcessor private (
* @param extVars File containing configuration with external variable
bindings in it.
* @param tunable This is ignored.
*/
- @deprecated("Use withExternalVariables.", "2.6.0")
- def setExternalVariables(extVars: File, tunable: DaffodilTunables): Unit = {
- val newBindings = loadExternalVariables(extVars)
- externalVars = newBindings
- }
-
- @deprecated("Use withExternalVariables.", "2.6.0")
- def setExternalVariables(extVars: Seq[Binding]): Unit = {
- val newBindings = loadExternalVariables(extVars)
- externalVars = newBindings
- }
-
def withExternalVariables(extVars: Seq[Binding]): DataProcessor = {
val newBindings = loadExternalVariables(extVars)
copy(externalVars = newBindings)
}
- @deprecated("Use withTunables.", "2.6.0")
- def setTunable(tunable: String, value: String): Unit = tunables =
tunables.setTunable(tunable, value)
+ def withTunable(tunable: String, value: String): DataProcessor =
copy(tunables = tunables.withTunable(tunable, value))
- def withTunable(tunable: String, value: String): DataProcessor =
copy(tunables = tunables.setTunable(tunable, value))
-
- @deprecated("Use withTunables.", "2.6.0")
- def setTunables(tunablesArg: Map[String, String]): Unit = tunables =
tunables.setTunables(tunablesArg)
-
- def withTunables(tunablesArg: Map[String, String]): DataProcessor =
copy(tunables = tunables.setTunables(tunablesArg))
+ def withTunables(tunablesArg: Map[String, String]): DataProcessor =
copy(tunables = tunables.withTunables(tunablesArg))
override def isError = false
@@ -371,15 +314,17 @@ class DataProcessor private (
// Make a copy of this object, so that our state mods below don't
side-effect the user's object.
// Saving shouldn't have side-effects on the state of the object.
//
- val dpToSave = this.copy()
//
// Note that the serialization system *does* preserve these two settings.
This is for general serialization
// that may be required by other software (e.g., Apache Spark)
//
// But for our save/reload purposes, we don't want them preserved.
//
- dpToSave.externalVars = Queue.empty[Binding] // explicitly set these to
empty so restored processor won't have them.
- dpToSave.validationMode = ValidationMode.Off // explicitly turn off, so
restored processor won't be validating.
+
+ val dpToSave = this.copy(
+ externalVars = Queue.empty[Binding], // explicitly set these to empty so
restored processor won't have them.
+ validationMode = ValidationMode.Off, // explicitly turn off, so restored
processor won't be validating.
+ )
try {
//
diff --git
a/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/Runtime2DataProcessor.scala
b/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/Runtime2DataProcessor.scala
index a8053082f..13cc26ef9 100644
---
a/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/Runtime2DataProcessor.scala
+++
b/daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/Runtime2DataProcessor.scala
@@ -27,7 +27,6 @@ import org.apache.daffodil.api.ValidationMode
import org.apache.daffodil.api.ValidationResult
import org.apache.daffodil.api.ValidationWarning
import org.apache.daffodil.dsom.ValidationError
-import org.apache.daffodil.exceptions.Assert
import org.apache.daffodil.externalvars.Binding
import org.apache.daffodil.processors.Failure
import org.apache.daffodil.processors.ProcessorResult
@@ -58,6 +57,10 @@ class Runtime2DataProcessor(executableFile: os.Path) extends
DFDL.DataProcessorB
override def withExternalVariables(extVars: Seq[Binding]):
DFDL.DataProcessor = ???
+ override def withDebugger(dbg:AnyRef): DFDL.DataProcessor = ???
+
+ override def withDebugging(flag: Boolean): DFDL.DataProcessor = ???
+
override def validationMode: ValidationMode.Type = ???
override def getTunables(): DaffodilTunables = ???
@@ -66,20 +69,6 @@ class Runtime2DataProcessor(executableFile: os.Path) extends
DFDL.DataProcessorB
override def variableMap: VariableMap = ???
- override def setValidationMode(mode: ValidationMode.Type): Unit = ???
-
- override def setExternalVariables(extVars: Map[String, String]): Unit = ???
-
- override def setExternalVariables(extVars: File): Unit = ???
-
- override def setExternalVariables(extVars: File, tunable: DaffodilTunables):
Unit = ???
-
- override def setExternalVariables(extVars: Seq[Binding]): Unit = ???
-
- override def setTunable(tunable: String, value: String): Unit = ???
-
- override def setTunables(tunables: Map[String, String]): Unit = ???
-
/**
* Returns an object which contains the result, and/or diagnostic
information.
*/
@@ -162,11 +151,6 @@ object Runtime2DataLocation {
_bytePos1b: Long) extends DataLocation {
override def bitPos1b: Long = _bitPos1b
override def bytePos1b: Long = _bytePos1b
-
- // $COVERAGE-OFF$
- @deprecated("Use comparison of bitPos1b with expected position instead.",
"3.1.0")
- override def isAtEnd: Boolean = Assert.usageError("isAtEnd is deprecated
and not implemented in Runtime2.")
- // $COVERAGE-ON$
}
def apply(bitPos1b: Long,
diff --git
a/daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/Daffodil.scala
b/daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/Daffodil.scala
index 0636cfcb2..23a1f2143 100644
--- a/daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/Daffodil.scala
+++ b/daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/Daffodil.scala
@@ -19,7 +19,6 @@ package org.apache.daffodil.sapi
import java.io.File
import java.net.URI
-import java.nio.channels.Channels
import java.nio.channels.ReadableByteChannel
import java.nio.channels.WritableByteChannel
@@ -39,7 +38,6 @@ import org.apache.daffodil.debugger.{ InteractiveDebugger =>
SInteractiveDebugge
import org.apache.daffodil.debugger.{ TraceDebuggerRunner =>
STraceDebuggerRunner }
import org.apache.daffodil.dsom.ExpressionCompilers
import org.apache.daffodil.dsom.walker.RootView
-import org.apache.daffodil.externalvars.{ Binding, ExternalVariablesLoader }
import org.apache.daffodil.processors.{ DaffodilParseXMLReader =>
SDaffodilParseXMLReader }
import org.apache.daffodil.processors.{ DaffodilUnparseContentHandler =>
SDaffodilUnparseContentHandler }
import org.apache.daffodil.processors.{ DataProcessor => SDataProcessor }
@@ -51,12 +49,7 @@ import org.apache.daffodil.sapi.ValidationMode.ValidationMode
import org.apache.daffodil.sapi.debugger._
import org.apache.daffodil.sapi.infoset._
import org.apache.daffodil.sapi.io.InputSourceDataInputStream
-import org.apache.daffodil.sapi.logger._
import org.apache.daffodil.sapi.packageprivate._
-import org.apache.daffodil.util.Maybe
-import org.apache.daffodil.util.Maybe._
-import org.apache.daffodil.util.MaybeULong
-import org.apache.daffodil.xml.NS
import org.apache.daffodil.xml.XMLUtils
import org.apache.daffodil.xml.DFDLCatalogResolver
@@ -77,14 +70,6 @@ object Daffodil {
new Compiler(SCompiler())
}
- /** Set the LogWriter to use to capture logging messages from Daffodil */
- @deprecated("Use Log4j for logging", "3.2.0")
- def setLogWriter(lw: LogWriter): Unit = {}
-
- /** Set the maximum logging level */
- @deprecated("Use Log4j for logging", "3.2.0")
- def setLoggingLevel(lvl: LogLevel.Value): Unit = {}
-
}
/**
@@ -184,83 +169,6 @@ class Compiler private[sapi] (private var sCompiler:
SCompiler) {
}
}
- /**
- * Specify a global element to be the root of DFDL Schema to start parsing
- *
- * @param name name of the root node
- * @param namespace namespace of the root node. Set to empty string to
specify
- * no namespace. Set to to NULL to figure out the namespace.
- */
- @deprecated("Pass arguments to compileSource, or compileFile.", "2.6.0")
- def setDistinguishedRootNode(name: String, namespace: String): Unit =
- sCompiler = sCompiler.withDistinguishedRootNode(name, namespace)
-
- /**
- * Set the value of a DFDL variable
- *
- * @param name name of the variable
- * @param namespace namespace of the variable. Set to empty string to specify
- * no namespace. Set to to NULL to figure out the namespace.
- * @param value value to so the variable to
- */
- @deprecated("Use DataProcessor.setExternalVariables", "2.6.0")
- def setExternalDFDLVariable(name: String, namespace: String, value: String):
Unit = {
- val bindings = Seq(Binding(name, Some(NS(namespace)), value))
- sCompiler = sCompiler.withExternalDFDLVariablesImpl(bindings)
- }
-
- /**
- * Set the value of multiple DFDL variables
- *
- * @param extVarsMap a may of key/value pairs, where the key is the variable
- * name, and the value is the value of the variable. The
key
- * may be preceded by a string of the form "{namespace}" to
- * define a namespace for the variable. If preceded with
"{}",
- * then no namespace is used. With not preceded by
"{namespace}",
- * then Daffodil will figure out the namespace.
- */
- @deprecated("Use DataProcessor.setExternalVariables", "2.6.0")
- def setExternalDFDLVariables(extVarsMap: Map[String, String]): Unit = {
- val extVars = ExternalVariablesLoader.mapToBindings(extVarsMap)
- sCompiler = sCompiler.withExternalDFDLVariablesImpl(extVars)
- }
-
- /**
- * Read external variables from a Daffodil configuration file
- *
- * @see <a target="_blank"
href='https://daffodil.apache.org/configuration/'>Daffodil Configuration
File</a> - Daffodil configuration file format
- *
- * @param extVarsFile file to read DFDL variables from.
- */
- @deprecated("Use DataProcessor.setExternalVariables", "2.6.0")
- def setExternalDFDLVariables(extVarsFile: File): Unit = {
- val extVars = ExternalVariablesLoader.fileToBindings(extVarsFile)
- sCompiler = sCompiler.withExternalDFDLVariablesImpl(extVars)
- }
-
- /**
- * Enable/disable DFDL validation of resulting infoset with the DFDL schema
- *
- * @param value true to enable validation, false to disabled
- */
- @deprecated("Do not use this method. DFDL schema validation should be
performed.", "2.6.0")
- def setValidateDFDLSchemas(value: Boolean): Unit = {
- sCompiler = sCompiler.withValidateDFDLSchemas(value)
- }
-
- /**
- * Set a Daffodil tunable parameter
- *
- * @see <a target="_blank"
href='https://daffodil.apache.org/configuration/#tunable-parameters'>Tunable
Parameters</a> - list of tunables names of default values
- *
- * @param tunable name of the tunable parameter to set.
- * @param value value of the tunable parameter to set
- */
- @deprecated("Use withTunable.", "2.6.0")
- def setTunable(tunable: String, value: String): Unit = {
- sCompiler = sCompiler.withTunable(tunable, value)
- }
-
/**
* Return a new [[Compiler]] with a specific Daffodil tunable parameter
*
@@ -273,18 +181,6 @@ class Compiler private[sapi] (private var sCompiler:
SCompiler) {
copy(sCompiler = sCompiler.withTunable(tunable, value))
}
- /**
- * Set the value of multiple tunable parameters
- *
- * @see <a target="_blank"
href='https://daffodil.apache.org/configuration/#tunable-parameters'>Tunable
Parameters</a> - list of tunables names of default values
- *
- * @param tunables a map of key/value pairs, where the key is the tunable
name and the value is the value to set it to
- */
- @deprecated("Use withTunables.", "2.6.0")
- def setTunables(tunables: Map[String, String]): Unit = {
- sCompiler = sCompiler.withTunables(tunables.toMap)
- }
-
/**
* Return a new [[Compiler]] with multiple tunable parameters
*
@@ -305,17 +201,6 @@ class ProcessorFactory private[sapi] (private var pf:
SProcessorFactory)
private def copy(pf: SProcessorFactory = pf) = new ProcessorFactory(pf)
- /**
- * Specify a global element to be the root of DFDL Schema to start parsing
- *
- * @param name name of the root node
- * @param namespace namespace of the root node. Set to empty string to
specify
- * no namespace. Set to to NULL to figure out the namespace.
- */
- @deprecated("Use withDistinguishedRootNode.", "2.6.0")
- def setDistinguishedRootNode(name: String, namespace: String): Unit =
- pf = pf.withDistinguishedRootNode(name, namespace)
-
/**
* Get a new [[ProcessorFactory]] having a global element specified as the
root of DFDL Schema to start parsing.
*
@@ -366,14 +251,6 @@ abstract class WithDiagnostics private[sapi] (wd:
SWithDiagnostics)
*/
def isError() = wd.isError
- /**
- * Determine if this object can be used in any future parse activities
- *
- * @return true it is safe to proceed, false otherwise
- */
- @deprecated("Use !isError() to determine if it is safe to proceed","2.0.0")
- def canProceed() = !isError
-
/**
* Get the list of [[Diagnostic]]'s created during the construction of the
parent object
*
@@ -443,22 +320,6 @@ class Diagnostic private[sapi] (d: SDiagnostic) {
class DataLocation private[sapi] (dl: SDataLocation) {
override def toString() = dl.toString
- /**
- * Determine if we're positioned at the end of data.
- *
- * Blocks until either one byte of data can be read, or end-of-data
- * is encountered.
- *
- * It is generally not advised to use this on network TCP data streams
- * as it will block waiting for the sender of data to provide more data
- * or close the stream.
- *
- * @return boolean indicating whether we are known to be positioned at
- * the end of data.
- */
- @deprecated("Use comparison of bitPos1b() with expected position instead.",
"3.1.0")
- def isAtEnd() = dl.isAtEnd
-
/**
* Get the position of the data, in bits, using 1-based indexing
*/
@@ -489,19 +350,6 @@ class DataProcessor private[sapi] (private var dp:
SDataProcessor)
private def copy(dp: SDataProcessor = dp) = new DataProcessor(dp)
- /**
- * Enable/disable debugging.
- *
- * Before enabling, [[DataProcessor#withDebugger]] or
[[DataProcessor#withDebuggerRunner]] must be called with a
- * non-null debugger.
- *
- * @param flag true to enable debugging, false to disabled
- */
- @deprecated("Use withDebugging.", "2.6.0")
- def setDebugging(flag: Boolean): Unit = {
- dp = dp.withDebugging(flag)
- }
-
/**
* Obtain a new [[DataProcessor]] instance with debugging enabled or
disabled.
*
@@ -514,17 +362,6 @@ class DataProcessor private[sapi] (private var dp:
SDataProcessor)
copy(dp = dp.withDebugging(flag))
}
- /**
- * Set the debugger runner
- *
- * @param dr debugger runner
- */
- @deprecated("Use withDebuggerRunner.", "2.6.0")
- def setDebugger(dr: DebuggerRunner): Unit = {
- val debugger = newDebugger(dr)
- dp = dp.withDebugger(debugger)
- }
-
/**
* Obtain a new [[DataProcessor]] with a specified debugger runner.
*
@@ -558,20 +395,6 @@ class DataProcessor private[sapi] (private var dp:
SDataProcessor)
debugger
}
-
- /**
- * Set validation mode
- *
- * @param mode mode to control validation
- * @throws InvalidUsageException if mode is not a valid ValidateMode value
- */
- @deprecated("Use withValidationMode.", "2.6.0")
- @throws(classOf[InvalidUsageException])
- def setValidationMode(mode: ValidationMode): Unit = {
- try { dp = dp.withValidationMode(ValidationConversions.modeToScala(mode)) }
- catch { case e: SInvalidUsageException => throw new
InvalidUsageException(e) }
- }
-
/**
* Obtain a new [[DataProcessor]] having a specific validation mode
*
@@ -586,24 +409,6 @@ class DataProcessor private[sapi] (private var dp:
SDataProcessor)
def withValidator(validator: Validator): DataProcessor =
withValidationMode(ValidationMode.Custom(validator))
-
- /**
- * Read external variables from a Daffodil configuration file
- *
- * @see <a target="_blank"
href='https://daffodil.apache.org/configuration/'>Daffodil Configuration
File</a> - Daffodil configuration file format
- *
- * @param extVars file to read DFDL variables from.
- * @throws ExternalVariableException if an error occurs while setting an
external variable
- */
- @deprecated("Use withExternalVariables.", "2.6.0")
- @throws(classOf[ExternalVariableException])
- def setExternalVariables(extVars: File): Unit = {
- //$COVERAGE-OFF$
- try { dp = dp.withExternalVariables(extVars) }
- catch { case e: SExternalVariableException => throw new
ExternalVariableException(e.getMessage) }
- //$COVERAGE-ON$
- }
-
/**
* Obtain a new [[DataProcessor]] with external variables read from a
Daffodil configuration file
*
@@ -618,26 +423,6 @@ class DataProcessor private[sapi] (private var dp:
SDataProcessor)
catch { case e: SExternalVariableException => throw new
ExternalVariableException(e.getMessage) }
}
- /**
- * Set the value of multiple DFDL variables
- *
- * @param extVars a map of key/value pairs, where the key is the variable
- * name, and the value is the value of the variable. The key
- * may be preceded by a string of the form "{namespace}" to
- * define a namespace for the variable. If preceded with "{}",
- * then no namespace is used. If not preceded by anything,
- * then Daffodil will figure out the namespace.
- * @throws ExternalVariableException if an error occurs while setting an
external variable
- */
- @deprecated("Use withExternalVariables.", "2.6.0")
- @throws(classOf[ExternalVariableException])
- def setExternalVariables(extVars: Map[String, String]) = {
- //$COVERAGE-OFF$
- try { dp = dp.withExternalVariables(extVars) }
- catch { case e: SExternalVariableException => throw new
ExternalVariableException(e.getMessage) }
- //$COVERAGE-ON$
- }
-
/**
* Obtain a new [[DataProcessor]] with multiple DFDL variables set.
*
@@ -677,65 +462,6 @@ class DataProcessor private[sapi] (private var dp:
SDataProcessor)
new DaffodilUnparseContentHandler(sContentHandler =
dp.newContentHandlerInstance(output).asInstanceOf[SDaffodilUnparseContentHandler])
- /**
- * Parse input data with a specified length
- *
- * @param input data to be parsed
- * @param lengthLimitInBits the length of the input data in bits, or -1 if
no limit
- * @return an object which contains the result, and/or diagnostic
information.
- */
- @deprecated("Use parse(InputSourceDataInputStream, InfosetOutputter) to
parse the data and get the infoset representation from the InfosetOutputter
instead of ParseResult.result()","2.2.0")
- def parse(input: ReadableByteChannel, lengthLimitInBits: Long): ParseResult
= {
- val is = Channels.newInputStream(input)
- val dis = new InputSourceDataInputStream(is)
- if (lengthLimitInBits > 0) {
- dis.dis.setBitLimit0b(MaybeULong(lengthLimitInBits))
- }
- val output = new ScalaXMLInfosetOutputter()
- val pr = dp.parse(dis.dis, output).asInstanceOf[SParseResult]
- new ParseResult(pr, Maybe(output))
- }
-
- /**
- * Parse input data without specifying a length
- *
- * @param input data to be parsed
- * @return an object which contains the result, and/or diagnostic
information.
- */
- @deprecated("Use parse(InputSourceDataInputStream, InfosetOutputter) to
parse the data and get the infoset representation from the InfosetOutputter
instead of ParseResult.result()","2.2.0")
- def parse(input: ReadableByteChannel): ParseResult = parse(input, -1)
-
- /**
- * Parse input data with a specified length
- *
- * @param input data to be parsed
- * @param output the InfosetOutputter that will be used to output the infoset
- * @param lengthLimitInBits the length of the input data in bits, or -1 if
no limit
- * @return an object which contains the result, and/or diagnostic
information.
- */
- @deprecated("Use parse(InputSourceDataInputStream, InfosetOutputter) to
parse the data and get the infoset representation from the InfosetOutputter
instead of ParseResult.result()","2.2.0")
- def parse(input: ReadableByteChannel, output: InfosetOutputter,
lengthLimitInBits: Long): ParseResult = {
- val is = Channels.newInputStream(input)
- val dis = new InputSourceDataInputStream(is)
- if (lengthLimitInBits > 0) {
- dis.dis.setBitLimit0b(MaybeULong(lengthLimitInBits))
- }
- val pr = dp.parse(dis.dis, output).asInstanceOf[SParseResult]
- new ParseResult(pr, Nope)
- }
-
- /**
- * Parse input data without specifying a length
- *
- * Use this when you don't know how big the data is.
- *
- * @param input data to be parsed
- * @param output the InfosetOutputter that will be used to output the infoset
- * @return an object which contains the result, and/or diagnostic
information.
- */
- @deprecated("Use parse(InputSourceDataInputStream, InfosetOutputter) to
parse the data and get the infoset representation from the InfosetOutputter
instead of ParseResult.result()","2.2.0")
- def parse(input: ReadableByteChannel, output: InfosetOutputter): ParseResult
= parse(input, output, -1)
-
/**
* Parse input data from an InputSourceDataInputStream and output the
infoset to an InfosetOutputter
*
@@ -746,7 +472,7 @@ class DataProcessor private[sapi] (private var dp:
SDataProcessor)
*/
def parse(input: InputSourceDataInputStream, output: InfosetOutputter):
ParseResult = {
val pr = dp.parse(input.dis, output).asInstanceOf[SParseResult]
- new ParseResult(pr, Nope)
+ new ParseResult(pr)
}
/**
@@ -760,50 +486,15 @@ class DataProcessor private[sapi] (private var dp:
SDataProcessor)
val ur = dp.unparse(input, output).asInstanceOf[SUnparseResult]
new UnparseResult(ur)
}
-
- /**
- * Unparse a scala.xml.Node infoset
- *
- * @param output the byte channel to write the data to
- * @param infoset the infoset to unparse, as a scala xml Node
- * @return an object with contains the result and/or diagnostic information
- */
- @deprecated("Use unparse(InfosetInputter, WritableByteChannel)", "2.0.0")
- def unparse(output: WritableByteChannel, infoset: scala.xml.Node):
UnparseResult = {
- val input = new ScalaXMLInfosetInputter(infoset)
- unparse(input, output)
- }
}
/**
* Result of calling [[DataProcessor.parse(input:org\.apache\.daffodil*
DataProcessor.parse]], containing
* any diagnostic information, and the final data location
*/
-class ParseResult private[sapi] (pr: SParseResult, deprecatedOutput:
Maybe[ScalaXMLInfosetOutputter])
+class ParseResult private[sapi] (pr: SParseResult)
extends WithDiagnostics(pr) {
- /**
- * Get the resulting infoset as a scala.xml.Node
- *
- * @throws InvalidUsageException if you call this when isError is true
- * because in that case there is no result document.
- *
- * @return a scala.xml.Node representing the DFDL infoset for the parsed data
- */
- @deprecated("ParseResult carrying the infoset representation is deprecated.
Intead, use parse(ReadableByteChannel, InfosetInputter) to parse the data and
get the infoset representation from the InfosetOutputter","2.0.0")
- @throws(classOf[InvalidUsageException])
- def result(): scala.xml.Node = {
- // When this result function is removed due to deprecation, we should also
- // remove the deprecatedOutput parameter to the ParseResult constructor
- if (deprecatedOutput.isDefined) {
- deprecatedOutput.get.getResult()
- } else {
- val ex = new org.apache.daffodil.processors.InvalidUsageException(
- "When passing an InfosetOutputter to parse(), you must get the infoset
result from the InfosetOutputter instead of the ParseResult.")
- throw new InvalidUsageException(ex)
- }
- }
-
/**
* Get the [[DataLocation]] where the parse completed
*
@@ -925,7 +616,7 @@ class DaffodilParseXMLReader private[sapi] (xmlrdr:
SDaffodilParseXMLReader) ext
override def getProperty(name: String): AnyRef = {
val res = xmlrdr.getProperty(name)
if (name == DaffodilParseXMLReader.DAFFODIL_SAX_URN_PARSERESULT) {
- val pr = new ParseResult(res.asInstanceOf[SParseResult], Nope)
+ val pr = new ParseResult(res.asInstanceOf[SParseResult])
pr
} else {
res
diff --git
a/daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/infoset/Infoset.scala
b/daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/infoset/Infoset.scala
index 4a6e8fef3..667804746 100644
---
a/daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/infoset/Infoset.scala
+++
b/daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/infoset/Infoset.scala
@@ -241,25 +241,6 @@ class ScalaXMLInfosetOutputter(showFormatInfo: Boolean =
false)
class XMLTextInfosetOutputter private (outputter: SXMLTextInfosetOutputter)
extends InfosetOutputterProxy {
- /**
- * Output the infoset as XML Text, written to a java.io.Writer
- *
- * @param writer the java.io.Writer to write the XML text to
- * @param pretty enable or disable pretty printing. Pretty printing will only
- * insert indentation and newlines where it will not affect the
- * content of the XML.
- */
- @deprecated("This constructor is deprecated. Use
XMLTextInfosetOutputter(java.io.OutputStream, Boolean) instead.", "2.4.0")
- def this(writer: java.io.Writer, pretty: Boolean) = this(new
SXMLTextInfosetOutputter(writer, pretty))
-
- /**
- * Output the infoset as XML Text, written to a java.io.Writer
- *
- * @param writer the java.io.Writer to write the XML text to
- */
- @deprecated("This constructor is deprecated. Use
XMLTextInfosetOutputter(java.io.OutputStream, Boolean) instead.", "2.4.0")
- def this(writer: java.io.Writer) = this(writer, true)
-
/**
* Output the infoset as XML Text, written to a java.io.OutputStream
*
@@ -279,25 +260,6 @@ class XMLTextInfosetOutputter private (outputter:
SXMLTextInfosetOutputter)
class JsonInfosetOutputter private (outputter: SJsonInfosetOutputter)
extends InfosetOutputterProxy {
- /**
- * Output the infoset as json text, written to a java.io.Writer
- *
- * @param writer the java.io.Writer to write the json text to
- * @param pretty enable or disable pretty printing. Pretty printing will only
- * insert indentation and newlines where it will not affect the
- * content of the json.
- */
- @deprecated("This constructor is deprecated. Use
JsonInfosetOutputter(java.io.OutputStream, Boolean) instead.", "2.4.0")
- def this(writer: java.io.Writer, pretty: Boolean) = this(new
SJsonInfosetOutputter(writer, pretty))
-
- /**
- * Output the infoset as json text, written to a java.io.Writer
- *
- * @param writer the java.io.Writer to write the json text to
- */
- @deprecated("This constructor is deprecated. Use
JsonInfosetOutputter(java.io.OutputStream, Boolean) instead.", "2.4.0")
- def this(writer: java.io.Writer) = this(writer, true)
-
/**
* Output the infoset as json text, written to a java.io.OutputStream
*
@@ -371,14 +333,6 @@ class ScalaXMLInfosetInputter(node: scala.xml.Node)
class XMLTextInfosetInputter private (inputter: SXMLTextInfosetInputter)
extends InfosetInputterProxy {
- /**
- * Read in an infoset in the form of XML text from a java.io.Reader
- *
- * @param reader the java.io.Reader to read the XML text from
- */
- @deprecated("This constructor is deprecated. Use
XMLTextInfosetInputter(java.io.InputStream) instead.", "2.4.0")
- def this(reader: java.io.Reader) = this(new SXMLTextInfosetInputter(reader))
-
/**
* Read in an infoset in the form of XML text from a java.io.InputStream
*
@@ -395,14 +349,6 @@ class XMLTextInfosetInputter private (inputter:
SXMLTextInfosetInputter)
class JsonInfosetInputter private (inputter: SJsonInfosetInputter)
extends InfosetInputterProxy {
- /**
- * Read in an infoset in the form of json text from a java.io.Reader
- *
- * @param reader the java.io.Reader to read the json text from
- */
- @deprecated("This constructor is deprecated. Use
JsonInfosetInputter(java.io.InputStream) instead.", "2.4.0")
- def this(reader: java.io.Reader) = this(new SJsonInfosetInputter(reader))
-
/**
* Read in an infoset in the form of json text from a java.io.InputStream
*
diff --git
a/daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/logger/Logger.scala
b/daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/logger/Logger.scala
deleted file mode 100644
index 2785e6da9..000000000
--- a/daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/logger/Logger.scala
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * 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.sapi.logger
-
-import java.io.File
-
-/**
- * Logging levels.
- * <p>
- * Error, Warning, and Info are intended for general use. The default is Info.
- * <p>
- * Levels Resolver Compile, Debug, and OOLAGDebug are intended for Daffodil
developer
- * use.
- */
-@deprecated("Use Log4j for logging", "3.2.0")
-object LogLevel extends Enumeration {
- type LogLevel = Value
- val Error = Value(10)
- val Warning = Value(20)
- val Info = Value(30)
- val Resolver = Value(35)
- val Compile = Value(40)
- val Debug = Value(50)
- val OOLAGDebug = Value(60)
- val DelimDebug = Value(70)
-}
-
-/**
- * Abstract log writer, which can be overridden to create a custom log writer.
- */
-@deprecated("Use Log4j for logging", "3.2.0")
-abstract class LogWriter {
- /**
- * Implement this method to determine how the log message is written.
- *
- * @param level level of the message
- * @param logID identification of class that created the log message
- * @param msg log message
- */
- protected def write(level: LogLevel.Value, logID: String, msg: String): Unit
-
- /**
- * Override to change the prefix string of the log message.
- *
- * By default, the prefix is the empty string.
- *
- * @param level level of the message
- * @param logID identification of class that created the log message
- * @return the prefix to use for log messages. Defaults to the empty string
if not overridden.
- */
- protected def prefix(level: LogLevel.Value, logID: String): String = ""
-
- /**
- * Override to change the suffix string of the log message.
- *
- * By default, the suffix is the empty string.
- *
- * @param level level of the message
- * @param logID identification of class that created the log message
- * @return the suffix to use for log messages. Defaults to the empty string
if not overridden.
- */
- protected def suffix(level: LogLevel.Value, logID: String): String = ""
-
- /**
- * Generates a log message as a string and calls the write method.
- *
- * The default implementation generates a log message based on the prefix,
- * suffix, message string, and log arguments, and passes the generated log
- * message, level, and logId to [[LogWriter.write]].
- *
- * Can be overridden if more control is needed over the logging mechanism
and/or
- * log arguments are needed as separate entities.
- *
- * @param level level of the message
- * @param logID identification of class that created the log message
- * @param msg printf-style format string
- * @param args arguments passed to the logger, matching the format string
- */
- def log(level: LogLevel.Value, logID: String, msg: String, args: Seq[Any]):
Unit = {
- val message =
- if (args.size > 0) {
- msg.format(args: _*)
- } else {
- msg
- }
- val p = prefix(level, logID)
- val s = suffix(level, logID)
- write(level, logID, p + message + s)
- }
-}
-
-/*
- * These three classes are all empty and are not ever actually used. They are
- * just place holders. Whenever the Scala API uses one of these, it is
- * translated to the appropriate Scala log writer. They are marked final so
- * that they cannot be extended, since the Scala pattern matcher would still
- * match and use the equivalent Scala log writers and lose any added
- * functionality. One must extend the LogWriter to create their own log writer.
- */
-
-/**
- * [[LogWriter]] that writes log messages to stdout
- */
-@deprecated("Use Log4j for logging", "3.2.0")
-final class ConsoleLogWriter extends LogWriter {
- protected def write(level: LogLevel.Value, logID: String, msg: String): Unit
= {
- //do nothing
- }
-}
-
-/**
- * [[LogWriter]] that drops all log messages
- */
-@deprecated("Use Log4j for logging", "3.2.0")
-final class NullLogWriter extends LogWriter {
- protected def write(level: LogLevel.Value, logID: String, msg: String): Unit
= {
- //do nothing
- }
-}
-
-/**
- * [[LogWriter]] that writes all log messages to a file.
- *
- * @param file the file to write log messages to
- */
-@deprecated("Use Log4j for logging", "3.2.0")
-final class FileLogWriter(file: File) extends LogWriter {
- /**
- * Retrieve the file the log writer writes to
- */
- def getFile = file
- protected def write(level: LogLevel.Value, logID: String, msg: String): Unit
= {
- //do nothing
- }
-}
diff --git
a/daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala
b/daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala
index 8b2f02498..f3a3eba90 100644
--- a/daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala
+++ b/daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala
@@ -51,7 +51,6 @@ import org.apache.daffodil.exceptions.UnsuppressableException
import org.apache.daffodil.externalvars.Binding
import org.apache.daffodil.io.FormatInfo
import org.apache.daffodil.io.InputSourceDataInputStream
-import org.apache.daffodil.processors.HasSetDebugger
import org.apache.daffodil.processors.charset.BitsCharsetDecoder
import org.apache.daffodil.processors.charset.BitsCharsetEncoder
import org.apache.daffodil.processors.charset.BitsCharsetNonByteSize
@@ -177,8 +176,7 @@ class DFDLTestSuite private[tdml] (
val defaultValidationDefault: String,
val defaultImplementationsDefault: Seq[String],
val shouldDoErrorComparisonOnCrossTests: Boolean,
- val shouldDoWarningComparisonOnCrossTests: Boolean)
- extends HasSetDebugger {
+ val shouldDoWarningComparisonOnCrossTests: Boolean) {
val TMP_DIR = System.getProperty("java.io.tmpdir", ".")
@@ -414,12 +412,12 @@ class DFDLTestSuite private[tdml] (
}
var areDebugging = false
- override def setDebugging(flag: Boolean) = {
+ def setDebugging(flag: Boolean) = {
areDebugging = flag
}
var daffodilDebugger: AnyRef = null
- override def setDebugger(db: AnyRef) = {
+ def setDebugger(db: AnyRef) = {
daffodilDebugger = db
}
diff --git
a/daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/processor/TDMLDFDLProcessor.scala
b/daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/processor/TDMLDFDLProcessor.scala
index b6e40c9b0..6aa0a548b 100644
---
a/daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/processor/TDMLDFDLProcessor.scala
+++
b/daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/processor/TDMLDFDLProcessor.scala
@@ -49,29 +49,14 @@ trait AbstractTDMLDFDLProcessorFactory {
def validateDFDLSchemas: Boolean
- @deprecated("Use withValidateDFDLSchemas.", "2.6.0")
- def setValidateDFDLSchemas(bool: Boolean): Unit
-
def withValidateDFDLSchemas(bool: Boolean): R
- @deprecated("Use withCheckAllTopLevel.", "2.6.0")
- def setCheckAllTopLevel(checkAllTopLevel: Boolean): Unit
-
def withCheckAllTopLevel(checkAllTopLevel: Boolean): R
- @deprecated("Use withTunables.", "2.6.0")
- def setTunables(tunables: Map[String, String]): Unit
-
def withTunables(tunables: Map[String, String]): R
- @deprecated("Use TDMLDFDLProcessor.withExternalDFDLVariables", "2.6.0")
- def setExternalDFDLVariables(externalVarBindings: Seq[Binding]): Unit
-
def withExternalDFDLVariables(externalVarBindings: Seq[Binding]): R
- @deprecated("Use arguments to getProcessor()", "2.6.0")
- def setDistinguishedRootNode(name: String, namespace: String): Unit
-
def getProcessor(schemaSource: DaffodilSchemaSource, useSerializedProcessor:
Boolean,
optRootName: Option[String] = None, optRootNamespace: Option[String] =
None,
tunables: Map[String, String]): TDML.CompileResult
@@ -84,29 +69,14 @@ trait TDMLDFDLProcessor {
protected type R <: TDMLDFDLProcessor
- @deprecated("Use withDebugging.", "2.6.0")
- def setDebugging(onOff: Boolean): Unit
-
def withDebugging(onOff: Boolean): R
- @deprecated("Use withTracing.", "2.6.0")
- def setTracing(onOff: Boolean): Unit
-
def withTracing(onOff: Boolean): R
- @deprecated("Use withDebugger.", "2.6.0")
- def setDebugger(db: AnyRef): Unit
-
def withDebugger(db: AnyRef): R
- @deprecated("Use withValidationMode.", "2.6.0")
- def setValidationMode(validationMode: ValidationMode.Type): Unit
-
def withValidationMode(validationMode: ValidationMode.Type): R
- @deprecated("Use withExternalDFDLVariables.", "2.6.0")
- def setExternalDFDLVariables(externalVarBindings: Seq[Binding]): Unit
-
def withExternalDFDLVariables(externalVarBindings: Seq[Binding]): R
def isError: Boolean
@@ -118,9 +88,6 @@ trait TDMLDFDLProcessor {
def unparse(infosetXML: scala.xml.Node, outStream: java.io.OutputStream):
TDMLUnparseResult
def unparse(parseResult: TDMLParseResult, outStream: java.io.OutputStream):
TDMLUnparseResult
-
- @deprecated("Function no longer called, cleanup must be handled in
individual TDMLResults.", "3.3.0")
- def cleanUp(): Unit = { /* Do nothing */ }
}
trait TDMLResult {
diff --git
a/daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/processor/DaffodilTDMLDFDLProcessor.scala
b/daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/processor/DaffodilTDMLDFDLProcessor.scala
index 203c0043a..231edb617 100644
---
a/daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/processor/DaffodilTDMLDFDLProcessor.scala
+++
b/daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/processor/DaffodilTDMLDFDLProcessor.scala
@@ -77,42 +77,20 @@ final class TDMLDFDLProcessorFactory private (
validateDFDLSchemas: Boolean = validateDFDLSchemas) =
new TDMLDFDLProcessorFactory(compiler, checkAllTopLevel,
validateDFDLSchemas)
- @deprecated("Use withValidateDFDLSchemas.", "2.6.0")
- override def setValidateDFDLSchemas(bool: Boolean): Unit = {
- compiler = compiler.withValidateDFDLSchemas(bool)
- }
-
def withValidateDFDLSchemas(bool: Boolean): TDMLDFDLProcessorFactory = {
copy(compiler = compiler.withValidateDFDLSchemas(bool))
}
- @deprecated("Use withCheckAllTopLevel.", "2.6.0")
- override def setCheckAllTopLevel(checkAllTopLevel: Boolean): Unit = {
- compiler = compiler.withCheckAllTopLevel(checkAllTopLevel)
- }
-
override def withCheckAllTopLevel(checkAllTopLevel: Boolean):
TDMLDFDLProcessorFactory = {
copy(compiler = compiler.withCheckAllTopLevel(checkAllTopLevel))
}
- @deprecated("Use withTunables.", "2.6.0")
- override def setTunables(tunables: Map[String, String]): Unit =
- compiler = compiler.withTunables(tunables)
-
override def withTunables(tunables: Map[String, String]):
TDMLDFDLProcessorFactory =
copy(compiler = compiler.withTunables(tunables))
- @deprecated("Use DaffodilTDMLDFDLProcessor.setExternalDFDLVariables.",
"2.6.0")
- override def setExternalDFDLVariables(externalVarBindings: Seq[Binding]):
Unit =
- compiler = compiler.withExternalDFDLVariablesImpl(externalVarBindings)
-
override def withExternalDFDLVariables(externalVarBindings: Seq[Binding]):
TDMLDFDLProcessorFactory =
copy(compiler =
compiler.withExternalDFDLVariablesImpl(externalVarBindings))
- @deprecated("Use arguments to getProcessor()", "2.6.0")
- override def setDistinguishedRootNode(name: String, namespace: String): Unit
=
- compiler = compiler.withDistinguishedRootNode(name, namespace)
-
/**
* This doesn't fetch a serialized processor, it runs whatever the processor
is
* through a serialize then unserialize path to get a processor as if
@@ -187,18 +165,9 @@ class DaffodilTDMLDFDLProcessor private (private var dp:
DataProcessor) extends
private def blobPrefix = ""
private def blobSuffix = ".bin"
- @deprecated("Use withDebugging.", "2.6.0")
- override def setDebugging(b: Boolean) =
- dp = dp.withDebugging(b)
-
override def withDebugging(b: Boolean): DaffodilTDMLDFDLProcessor =
copy(dp = dp.withDebugging(b))
- @deprecated("Use withTracing.", "2.6.0")
- override def setTracing(bool: Boolean): Unit = {
- dp = newTracing(bool)
- }
-
override def withTracing(bool: Boolean): DaffodilTDMLDFDLProcessor = {
copy(dp = newTracing(bool))
}
@@ -210,30 +179,15 @@ class DaffodilTDMLDFDLProcessor private (private var dp:
DataProcessor) extends
dp.withDebugging(false)
}
- @deprecated("Use withDebugger.", "2.6.0")
- override def setDebugger(db: AnyRef): Unit = {
- Assert.usage(dp ne null)
- val d = dp.asInstanceOf[Debugger]
- dp = dp.withDebugger(d)
- }
-
override def withDebugger(db: AnyRef): DaffodilTDMLDFDLProcessor = {
Assert.usage(dp ne null)
val d = dp.asInstanceOf[Debugger]
copy(dp = dp.withDebugger(d))
}
- @deprecated("Use withValidationMode.", "2.6.0")
- override def setValidationMode(validationMode: ValidationMode.Type): Unit =
- dp = dp.withValidationMode(validationMode)
-
override def withValidationMode(validationMode: ValidationMode.Type):
DaffodilTDMLDFDLProcessor =
copy(dp = dp.withValidationMode(validationMode))
- @deprecated("Use withExternalDFDLVariables.", "2.6.0")
- override def setExternalDFDLVariables(externalVarBindings: Seq[Binding]):
Unit =
- dp = dp.withExternalVariables(externalVarBindings)
-
override def withExternalDFDLVariables(externalVarBindings: Seq[Binding]):
DaffodilTDMLDFDLProcessor =
copy(dp = dp.withExternalVariables(externalVarBindings))
diff --git
a/daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/processor/Runtime2TDMLDFDLProcessor.scala
b/daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/processor/Runtime2TDMLDFDLProcessor.scala
index 927bc99d6..c7f9c4fa3 100644
---
a/daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/processor/Runtime2TDMLDFDLProcessor.scala
+++
b/daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/processor/Runtime2TDMLDFDLProcessor.scala
@@ -50,45 +50,20 @@ final class Runtime2TDMLDFDLProcessorFactory private(
validateDFDLSchemas: Boolean = validateDFDLSchemas) =
new Runtime2TDMLDFDLProcessorFactory(compiler, checkAllTopLevel,
validateDFDLSchemas)
- /**
- * Deprecated methods must be implemented. Some are just stubs though now.
- */
- @deprecated("Use withValidateDFDLSchemas.", "2.6.0")
- override def setValidateDFDLSchemas(bool: Boolean): Unit = {
- compiler = compiler.withValidateDFDLSchemas(bool)
- }
-
override def withValidateDFDLSchemas(bool: Boolean):
Runtime2TDMLDFDLProcessorFactory = {
copy(compiler = compiler.withValidateDFDLSchemas(bool))
}
- @deprecated("Use withCheckAllTopLevel.", "2.6.0")
- override def setCheckAllTopLevel(checkAllTopLevel: Boolean): Unit = {
- compiler = compiler.withCheckAllTopLevel(checkAllTopLevel)
- }
-
override def withCheckAllTopLevel(checkAllTopLevel: Boolean):
Runtime2TDMLDFDLProcessorFactory = {
copy(compiler = compiler.withCheckAllTopLevel(checkAllTopLevel))
}
- @deprecated("Use withTunables.", "2.6.0")
- override def setTunables(tunables: Map[String, String]): Unit =
- compiler = compiler.withTunables(tunables)
-
override def withTunables(tunables: Map[String, String]):
Runtime2TDMLDFDLProcessorFactory =
copy(compiler = compiler.withTunables(tunables))
- @deprecated("Use DaffodilTDMLDFDLProcessor.setExternalDFDLVariables.",
"2.6.0")
- override def setExternalDFDLVariables(externalVarBindings: Seq[Binding]):
Unit =
- compiler = compiler.withExternalDFDLVariablesImpl(externalVarBindings)
-
override def withExternalDFDLVariables(externalVarBindings: Seq[Binding]):
Runtime2TDMLDFDLProcessorFactory =
copy(compiler =
compiler.withExternalDFDLVariablesImpl(externalVarBindings))
- @deprecated("Use arguments to getProcessor()", "2.6.0")
- override def setDistinguishedRootNode(name: String, namespace: String): Unit
=
- compiler = compiler.withDistinguishedRootNode(name, namespace)
-
// Return result is a TDML.CompileResult - so it's the result
// of compiling the schema for the test.
override def getProcessor(
@@ -149,24 +124,14 @@ class Runtime2TDMLDFDLProcessor(tempDir: os.Path,
executable: os.Path)
private val dataProcessor = new Runtime2DataProcessor(executable)
- @deprecated("Use withDebugging.", "2.6.0")
- override def setDebugging(b: Boolean) = ???
override def withDebugging(b: Boolean): Runtime2TDMLDFDLProcessor = this
- @deprecated("Use withTracing.", "2.6.0")
- override def setTracing(bool: Boolean): Unit = ???
override def withTracing(bool: Boolean): Runtime2TDMLDFDLProcessor = this
- @deprecated("Use withDebugger.", "2.6.0")
- override def setDebugger(db: AnyRef): Unit = ???
override def withDebugger(db: AnyRef): Runtime2TDMLDFDLProcessor = this
- @deprecated("Use withValidationMode.", "2.6.0")
- override def setValidationMode(validationMode: ValidationMode.Type): Unit =
???
override def withValidationMode(validationMode: ValidationMode.Type):
Runtime2TDMLDFDLProcessor = this
- @deprecated("Use withExternalDFDLVariables.", "2.6.0")
- override def setExternalDFDLVariables(externalVarBindings: Seq[Binding]):
Unit = ???
override def withExternalDFDLVariables(externalVarBindings: Seq[Binding]):
Runtime2TDMLDFDLProcessor = this
// No need to report errors from this class itself