mbeckerle commented on code in PR #1112:
URL: https://github.com/apache/daffodil/pull/1112#discussion_r1387444278
##########
daffodil-core/src/test/scala/org/apache/daffodil/core/util/TestUtils.scala:
##########
@@ -40,13 +40,13 @@ import org.apache.daffodil.lib.xml._
import org.apache.daffodil.runtime1.api.DFDL
import org.apache.daffodil.runtime1.debugger._
import org.apache.daffodil.runtime1.infoset.InfosetInputter
-import org.apache.daffodil.runtime1.infoset.InfosetOutputter
import org.apache.daffodil.runtime1.infoset.ScalaXMLInfosetInputter
import org.apache.daffodil.runtime1.infoset.ScalaXMLInfosetOutputter
import org.apache.daffodil.runtime1.processors.DataProcessor
import org.apache.daffodil.runtime1.processors.VariableMap
import org.apache.commons.io.output.NullOutputStream
+import org.apache.daffodil.runtime1.infoset.InfosetOutputter
import org.junit.Assert.assertEquals
Review Comment:
Revert. Just a re-ordering of imports.
##########
daffodil-core/src/test/scala/org/apache/daffodil/core/general/TestRuntimeProperties.scala:
##########
@@ -37,7 +37,8 @@ import org.junit.Test
*/
class RedactingScalaXMLInfosetOutputter extends ScalaXMLInfosetOutputter {
- override def startSimple(diSimple: DISimple): Unit = {
+ override def startSimple(se: InfosetSimpleElement): Unit = {
+ val diSimple = se.asInstanceOf[DISimple]
Review Comment:
This should be able to be done without need for DISimple.
##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/infoset/InfosetImpl.scala:
##########
@@ -14,13 +14,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.daffodil.runtime1.infoset
-import java.lang.{ Boolean => JBoolean }
-import java.lang.{ Number => JNumber }
-import java.math.{ BigDecimal => JBigDecimal }
-import java.util.HashMap
+import java.lang.{
Review Comment:
Revise these imports into standard style.
##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/infoset/InfosetOutputter.scala:
##########
@@ -1,22 +1,9 @@
-/*
Review Comment:
Restore banner.
##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/api/Metadata.scala:
##########
@@ -0,0 +1,80 @@
+package org.apache.daffodil.runtime1.api
+
+import org.apache.daffodil.lib.exceptions.SchemaFileLocation
+import org.apache.daffodil.lib.xml.NS
+import org.apache.daffodil.lib.xml.NamedQName
+import org.apache.daffodil.runtime1.dpath.PrimTypeNode
+
+/*
+ * This is the supportable API for access to the RuntimeData structures
+ */
+trait Metadata {
+ def schemaFileLocation: SchemaFileLocation
+ def path: String
+ def diagnosticDebugName: String
+ override def toString = diagnosticDebugName
+}
+
+trait TermMetadata extends Metadata {
+ def isArray: Boolean
+}
+
+trait ElementMetadata extends TermMetadata {
+ def isSimpleType: Boolean
+ def isComplexType: Boolean
+
+ def name: String
+ def namespace: NS
+ def optNamespacePrefix: Option[String]
+ def isArray: Boolean
+ def isOptional: Boolean
+ def namedQName: NamedQName
+
+ def sscd: String
+ def isNillable: Boolean
+
+ def runtimeProperties: java.util.Map[String, String]
+
+}
+
+trait ComplexElementMetadata extends ElementMetadata {
+
+ def childMetadata: Seq[ElementMetadata]
+}
+
+trait SimpleElementMetadata extends ElementMetadata {
+ def primType: PrimTypeNode
+}
+
+trait ModelGroupMetadata extends TermMetadata {}
+
+trait SequenceMetadata extends ModelGroupMetadata {}
+
+trait ChoiceMetadata extends ModelGroupMetadata {}
+
+/**
+ * Base class used by clients who want to walk the runtime schema information.
+ */
+abstract class MetadataHandler() {
+
+ /**
+ * Called for simple type element metadata (for declarations or references)
+ */
+ def simpleElementMetadata(m: SimpleElementMetadata): Unit
+
+ /**
+ * Called for complex type element metadata (for declarations or references)
+ *
+ * Subsequent calls will be for the model group making up the content
+ * of the element.
+ */
+ def startComplexElementMetadata(m: ComplexElementMetadata): Unit
+ def endComplexElementMetadata(m: ComplexElementMetadata): Unit
+
+ // def startSequenceMetadata(m: SequenceMetadata): Unit
Review Comment:
Decide if these exist or not.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]