You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2020/03/18 19:11:41 UTC
[GitHub] [incubator-daffodil] olabusayoT commented on a change in pull
request #326: Daffodil 2280 cleanup - removes backpointers and factory
patterns no longer needed
olabusayoT commented on a change in pull request #326: Daffodil 2280 cleanup - removes backpointers and factory patterns no longer needed
URL: https://github.com/apache/incubator-daffodil/pull/326#discussion_r394504084
##########
File path: daffodil-core/src/main/scala/org/apache/daffodil/dsom/GroupRef.scala
##########
@@ -53,24 +53,43 @@ trait GroupRef { self: ModelGroup =>
* A GroupRefFactory (group reference) is an indirection to
* factories to create a SequenceGroupRef, or ChoiceGroupRef.
*
- * The refXMLArg is the xml for the group reference.
+ * The refXML is the xml for the group reference.
*
* This factory exists in order to make error messages refer to the
- * right part of the schema.
+ * right part of the schema and to navigate the ref prior to creating
+ * the object so that we can create a more specific kind of group ref that
+ * knows if it is referring to a choice or a sequence.
*/
-final class GroupRefFactory(refXMLArg: Node, val refLexicalParent: SchemaComponent, position: Int, isHidden: Boolean)
- extends SchemaComponentFactory(refXMLArg, Some(refLexicalParent.schemaDocument))
+object GroupRefFactory {
+
+ def apply(refXML: Node, refLexicalParent: SchemaComponent, position: Int, isHidden: Boolean) = {
+ val f = new GroupRefFactory(refXML, refLexicalParent, position, isHidden)
+ f.groupRef
+ }
+}
+
+/**
+ * This is a quasi schema component. It is such simply to share a bunch of
+ * mechanism that schema components inherit, in a hassle free manner.
+ * (E.g., diagnostics mechanism that keeps track of file and line number).
+ */
+final class GroupRefFactory private (refXML: Node, val refLexicalParent: SchemaComponent, position: Int, isHidden: Boolean)
Review comment:
I think this is supposed to be ordered as "private final class..."
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services