Package

org.apache.daffodil

dsom

Permalink

package dsom

DSOM - DFDL Schema Object Model

Overview

DSOM is the abstract syntax "tree" of a DFDL schema. It is not actually a tree, it is a graph, as there are back-pointers, and shared objects.

A schema is made up of SchemaComponent objects. A SchemaSet is a collection of Schema. A schema is a collection of SchemaDocument that have a common namespace. The SchemaSet is the ultimate root of all the objects in a compilation unit. The Term class is the base for everything that can have a representation in the data stream. .

Many SchemaComponent carry DFDL annotations; hence, AnnotatedSchemaComponent is a key base trait.

UML Class Diagram

See the Daffodil Wiki for class diagrams.

Terminology

Parsing - in this description we are talking about the Daffodil Schema Compiler. So when we refer to "parsing" the XML, we are referring to the recursive descent walk of the DFDL schema, with that schema represented as Scala's scala.xml.Node objects. Strictly speaking, the string text in files of the DFDL schema's XML is already parsed into Scala's scala.xml.Node objects, but it is the walk through that structure constructing the DSOM tree/graph that we refer to as "parsing" the DFDL schema.

Principles of Operation

Constructing the DSOM Graph

The DSOM object graph must be constructed by looking at only the XML without examining any DFDL annotations. The DSOM structure is required in order to implement DFDL's scoping rules for finding annotations including both properties (like dfdl:byteOrder) and statements (like dfdl:assert); hence, one must have the DSOM graph before one can begin accessing DFDL annotations or you end up in cycles/stack-overflows.

This requires a careful consideration of class/trait members and methods that are used when constructing the DSOM graph, and those used after the DSOM graph has been created, in order to compile it into the runtime data structures.

There are a few exceptions to the above. The dfdl:hiddenGroupRef attribute is one such. It must be local to the Sequence object, and has implications for the parsing of the XML as it implies there should be no children of that xs:sequence. Since it is not scoped, the DSOM graph is not needed in order to access it. Only the local Sequence object and it's DFDLSequence annotation object. The AnnotatedSchemaComponent trait provides methods for this local-only property lookup.

The DSOM object graph is also needed in order to issue good diagnostic messages from the compiler; hence, Daffodil validates the DFDL schema before parsing it into the DSOM graph. Careful consideration must be given if a SchemaDefinitionError (SDE) is issued while constructing the DSOM graph.

If you run into stack-overflows while the DSOM graph is being constructed, the above is a common cause of them, as the SDE diagnostic messaging uses DSOM graph information to construct context information about the error for inclusion in the messages. If the DSOM graph is still being constructed at that time, then this can be circular.

Using the DSOM Graph

DSOM supports Daffodil schema compilation by way of the OOLAG pattern which is an object oriented way of using the attribute grammars compiler technique.

Many attributes (in the attribute grammar sense, nothing to do with XML attributes) are simply Scala lazy val definitions, but some are declared as OOLAG attributes (using org.apache.daffodil.oolag.OOLAG.OOLAGHost.LV) which provides for gathering of multiple diagnostic messages (SchemaDefinitionError) before abandoning compilation.

DFDL schema compilation largely occurs by evaluating lazy val members of DSOM objects. These include the members of the grammar traits (@see org.apache.daffodil.grammar package), which are mixed in to the appropriate DSOM traits/classes.

FAQ

Q: Why invent this? Why not use XSOM, or the Apache XML Schema library?

A:We had trouble with other XML-schema libraries for lack of adequate support for annotations, non-native attributes, and schema documents as first class objects. So DSOM is specific to Daffodil Basically these libraries are more about implementing XML Schema and validation, and not so much about a complex language built on the annotations of the schema. DSOM is really mostly about the annotations.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. dsom
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract class AbstractElementRef extends ElementBase with HasRefMixin with NamedMixin with NestingLexicalMixin

    Permalink
  2. trait AnnotatedMixin extends AnyRef

    Permalink

    Every component that can be annotated.

    Every component that can be annotated. Review Note: It's no longer clear that this separation is strictly speaking needed. It's possible that this could be collapsed back into AnnotatedSchemaComponent or made smaller anyway.

  3. trait AnnotatedSchemaComponent extends SchemaComponent with AnnotatedMixin with OverlapCheckMixin

    Permalink

    Shared characteristics of any annotated schema component.

    Shared characteristics of any annotated schema component.

    Not all components can carry DFDL annotations.

  4. abstract class AnnotatedSchemaComponentImpl extends AnnotatedSchemaComponent

    Permalink

    Convenience class for implemening AnnotatedSchemaComponent trait

  5. final class ChainPropProvider extends Logging with PropTypes

    Permalink

    flat chain of format annotations connected by dfdl:ref (short form) or ref (long form) references to named defined formats.

    flat chain of format annotations connected by dfdl:ref (short form) or ref (long form) references to named defined formats.

    Could be the nonDefault formats being chained together, or could be the default formats being chained together.

  6. final class Choice extends ChoiceTermBase with ChoiceDefMixin

    Permalink
  7. final class ChoiceBranchImpliedSequence extends SequenceTermBase with SequenceDefMixin with ChoiceBranchImpliedSequenceRuntime1Mixin

    Permalink

    For the case when a choice branch happens to be a local element decl or element ref with varying or multiple occurrences.

    For the case when a choice branch happens to be a local element decl or element ref with varying or multiple occurrences. In that case we encapsulate them with this so that we have a compiler invariant that all terms have an enclosing sequence.

    There can't be separators, but the driving of the iteration for the occurrences, is in the sequence parsers/unparsers. So this implements that, leveraging the sequence machinery. In effect this is specifying the properties needed to ensure it is handled as a degenerate sequence having only one element decl within it.

  8. trait ChoiceDefMixin extends AnnotatedSchemaComponent with GroupDefLike

    Permalink

    Captures concepts common to all choice definitions, which includes both local and global choice definitions, but not choice group references.

    Captures concepts common to all choice definitions, which includes both local and global choice definitions, but not choice group references.

    Choices are a bit complicated.

    They can have initiators and terminators. This is most easily thought of as wrapping each choice inside a sequence having only the choice inside it, and moving the initiator and terminator specification to that sequence.

    That sequence is then the term replacing the choice wherever the choice is.

    Choices can have children which are scalar elements. In this case, that scalar element behaves as if it were a child of the enclosing sequence (which could be the one we just injected above the choice.

    Choices can have children which are recurring elements. In this case, the behavior is as if the recurring child was placed inside a sequence which has no initiator nor terminator, but repeats the separator specification from the sequence context that encloses the choice.

    All that, and the complexities of separator suppression too.

    There's also issues like this:

    <choice> <element .../> <sequence/> </choice>

    in the above, one alternative is an empty sequence. So this choice may produce an element which takes up a child position, and potentially requires separation, or it may produce nothing at all.

  9. final class ChoiceGroupRef extends ChoiceTermBase with GroupRef

    Permalink
  10. abstract class ChoiceTermBase extends ModelGroup with Choice_AnnotationMixin with RawDelimitedRuntimeValuedPropertiesMixin with ChoiceGrammarMixin with ChoiceAGMixin with HasOptRepTypeMixinImpl

    Permalink
  11. trait CommonContextMixin extends NestingMixin

    Permalink
  12. sealed abstract class ComplexTypeBase extends SchemaComponentImpl with TypeBase with NonPrimTypeMixin

    Permalink
  13. abstract class DFDLAnnotation extends SchemaComponent with NestingLexicalMixin

    Permalink

    Base class for any DFDL annotation

    Base class for any DFDL annotation

    Note about SchemaComponent as a base class: Many things are now derived from SchemaComponent that were not before. Just turns out that there is a lot of desirable code sharing between things that aren't strictly-speaking SchemaComponents and things that previously were not. Accomplishing that sharing with mixins and self-typing etc. was just too troublesome. So now many things are schema components. E.g., all annotation objects, the Include and Import objects which represent those statements in a schema, the proxy DFDLSchemaFile object, etc.

  14. final class DFDLAssert extends DFDLAssertionBase

    Permalink
  15. abstract class DFDLAssertionBase extends DFDLStatement

    Permalink
  16. final class DFDLChoice extends DFDLModelGroup

    Permalink
  17. final class DFDLDefineEscapeScheme extends DFDLDefiningAnnotation

    Permalink

    Escape scheme definitions

    Escape scheme definitions

    These cannot be shared easily, since they can contain expressions (for escapeCharacter and escapeEscapeCharacter) which must be evaluated in the context of a point of use location.

    These are copied for each point of use so that these properties behave the way regular properties that are not grouped together on a common structure, all work, which is that each term has its own expression compilation for these properties, as it would for any regular expression-valued property like byteOrder or encoding or a delimiter.

  18. final class DFDLDefineEscapeSchemeFactory extends DFDLDefiningAnnotation

    Permalink
  19. final class DFDLDefineFormat extends DFDLDefiningAnnotation

    Permalink
  20. class DFDLDefineVariable extends DFDLDefiningAnnotation

    Permalink
  21. abstract class DFDLDefiningAnnotation extends DFDLAnnotation with GlobalNonElementComponentMixin with NestingLexicalMixin

    Permalink

    Unlike say GlobalElementDecl, Defining annotations don't have a factory, because they don't have any characteristics that depend on context, i.e., that have to access the referring context to compute.

  22. final class DFDLDiscriminator extends DFDLAssertionBase

    Permalink
  23. final class DFDLElement extends DFDLNonDefaultFormatAnnotation

    Permalink
  24. final class DFDLEnumerationFactory extends DFDLFormatAnnotation

    Permalink
  25. final class DFDLEscapeScheme extends DFDLFormatAnnotation with EscapeScheme_AnnotationMixin with RawEscapeSchemeRuntimeValuedPropertiesMixin

    Permalink
  26. final class DFDLFormat extends DFDLFormatAnnotation

    Permalink
  27. abstract class DFDLFormatAnnotation extends DFDLAnnotation with LeafPropProvider

    Permalink

    Base class for annotations that carry format properties

  28. final class DFDLGroup extends DFDLNonDefaultFormatAnnotation

    Permalink
  29. abstract class DFDLModelGroup extends DFDLNonDefaultFormatAnnotation

    Permalink
  30. final class DFDLNewVariableInstance extends VariableReference

    Permalink
  31. abstract class DFDLNonDefaultFormatAnnotation extends DFDLFormatAnnotation

    Permalink
  32. final class DFDLProperty extends DFDLAnnotation with LocalNonElementComponentMixin

    Permalink
  33. final class DFDLSchemaFile extends SchemaComponentImpl with ErrorHandler

    Permalink

    represents one schema document file

    represents one schema document file

    manages loading of it, and keeping track of validation errors

  34. final class DFDLSequence extends DFDLModelGroup

    Permalink
  35. final class DFDLSetVariable extends VariableReference

    Permalink
  36. final class DFDLSimpleType extends DFDLNonDefaultFormatAnnotation

    Permalink
  37. abstract class DFDLStatement extends DFDLAnnotation with NestingLexicalMixin with HasTermCheck

    Permalink

    Base class for assertions, variable assignments, etc

  38. trait DelimitedRuntimeValuedPropertiesMixin extends TermRuntimeValuedPropertiesMixin with RawDelimitedRuntimeValuedPropertiesMixin

    Permalink
  39. case class DeprecatedProperty(namespace: NS, property: String, replacement: String) extends Product with Serializable

    Permalink
  40. trait ElementBase extends Term with ElementLikeMixin with LocalElementMixin with Element_AnnotationMixin with NillableMixin with ElementBaseGrammarMixin with ElementRuntimeValuedPropertiesMixin with StringTextMixin with NumberTextMixin with CalendarTextMixin with BooleanTextMixin with TextNumberFormatMixin with EmptyElementParsePolicyMixin with OverlapCheckMixin

    Permalink

    Shared by all forms of elements, local or global or element reference.

  41. trait ElementDeclFactoryDelegatingMixin extends ElementDeclInstanceImplMixin

    Permalink
  42. trait ElementDeclFactoryImplMixin extends ElementDeclMixin

    Permalink
  43. sealed trait ElementDeclInstanceImplMixin extends ElementDeclMixin

    Permalink
  44. sealed trait ElementDeclMixin extends ElementLikeMixin

    Permalink

    Shared by all element declarations local or global

  45. trait ElementDeclNonFactoryDelegatingMixin extends ElementDeclFactoryImplMixin with ElementDeclInstanceImplMixin

    Permalink
  46. trait ElementFormDefaultMixin extends AnyRef

    Permalink

    elementFormDefault is an attribute of the xs:schema element.

    elementFormDefault is an attribute of the xs:schema element. It defaults to 'qualified'. That means nested local element definitions, their names are in the target namespace. So, if you have

    Examples:
    1. <foo xmlns="myURI>">42

      That is, you must explicitly go to the no-namespace syntax. It doesn't happen implicitly. This trait is mixed into things that are affected by elementFormDefault. Namely the local element declaration class.

    2. ,
    3. <tns:foo><bar>42</bar></tns:foo>

      In this case you really don't want to setup xmlns='myURI' because this happens:

    4. ,
    5. <foo xmlns="myURI"><bar>42</bar></foo>

      But if elementFormDefault='unqualified', the instance doc would be like:

    6. ,
    7. <tns:foo><tns:bar>42</tns:bar></tns:foo>

      or the possibly nicer (for a large result)

    8. ,
    9. <schema elementFormDefault='qualified'
              targetNamespace="myURI" xmlns:tns="myURI"...>
      <element name='foo'...>
         <complexType>
            <sequence>
               <element name='bar'.../>
            ...

      Now a DFDL/Xpath expression to reach that 'bar' element looks like /tns:foo/tns:bar Contrarywise, if elementFormDefault='unqualfied'...

       
      
         
            
               
            ...
      }}}
      Now a path to reach element bar would look like /tns:foo/bar.
      See how 'bar' isn't preceded by the tns prefix. That's becasue the child elements are
      all 'no namespace' elements.
      This also affects what a result document is like from namespaces perspective.
      Suppose the above 'bar' element is an xs:int. Then with elemenFormDefault='qualified', an
      instance would look like:

  47. trait ElementLikeMixin extends AnnotatedSchemaComponent with ProvidesDFDLStatementMixin

    Permalink
  48. final class ElementRef extends AbstractElementRef

    Permalink

    There are 3 first-class concrete children of ElementBase.

    There are 3 first-class concrete children of ElementBase. Root, LocalElementDecl, and ElementRef

  49. trait ElementRuntimeValuedPropertiesMixin extends DelimitedRuntimeValuedPropertiesMixin with OccursAGMixin with LengthAGMixin with SimpleTypeRuntimeValuedPropertiesMixin with RawElementRuntimeValuedPropertiesMixin

    Permalink
  50. case class EnclosingComponentDef(encloser: SchemaComponent, lexicalPosition: Int) extends Product with Serializable

    Permalink

    When a global schema component is referenced, the "backpointer" is represented by this class.

    When a global schema component is referenced, the "backpointer" is represented by this class. The lexical position is the index within the enclosing construct's lexical parent. For example, if an element ref is referencing a global element decl, then the encloser is the elementRef, and the lexical position is which index, within the sequence/choice that contains that particular elementRef.

  51. final class EnumerationDefFactory extends SchemaComponentFactory with NestingLexicalMixin with HasRepValueAttributes

    Permalink
  52. trait EscapeSchemeRefMixin extends AnyRef

    Permalink
  53. class ExpressionCompiler[T <: AnyRef] extends ExpressionCompilerBase[T]

    Permalink
  54. trait Facets extends AnyRef

    Permalink
  55. final class GlobalChoiceGroupDef extends GlobalGroupDef with ChoiceDefMixin

    Permalink
  56. final class GlobalComplexTypeDef extends ComplexTypeBase with GlobalNonElementComponentMixin with NestingTraversesToReferenceMixin

    Permalink

    For unit testing purposes, the element argument might be supplied as null.

  57. final class GlobalComplexTypeDefFactory extends SchemaComponentFactory with GlobalNonElementComponentMixin

    Permalink
  58. sealed trait GlobalComponent extends NamedMixin with PrefixAndNamespaceMixin

    Permalink

    All global components share these characteristics.

    All global components share these characteristics. The difference between this and the not-Global flavor has to do with the elementFormDefault attribute of the xs:schema element. Global things are always qualified

  59. trait GlobalElementComponentMixin extends GlobalComponent

    Permalink
  60. final class GlobalElementDecl extends AnnotatedSchemaComponentImpl with GlobalElementComponentMixin with ElementDeclFactoryDelegatingMixin with NestingTraversesToReferenceMixin with ResolvesLocalProperties

    Permalink
  61. class GlobalElementDeclFactory extends SchemaComponentFactory with GlobalElementComponentMixin with ElementDeclFactoryImplMixin

    Permalink

    Factory to create an instance of a global element declaration either to be the root of the data, or when referenced from an element reference, in which case a backpointer from the global element decl instance will point back to the element reference.

    Factory to create an instance of a global element declaration either to be the root of the data, or when referenced from an element reference, in which case a backpointer from the global element decl instance will point back to the element reference.

    This backpointer is needed in order to determine some attributes that refer outward to what something is contained within. E.g., nearestEnclosingSequence is an attribute that might be the sequence containing the element reference that is referencing this global element declaration.

  62. sealed abstract class GlobalGroupDef extends AnnotatedSchemaComponentImpl with GroupDefLike with GlobalNonElementComponentMixin with NestingTraversesToReferenceMixin with ResolvesLocalProperties

    Permalink

    Global Group Defs carry annotations that are combined wiht those of the corresponding group reference that refers to them.

    Global Group Defs carry annotations that are combined wiht those of the corresponding group reference that refers to them.

    These are not carried on the xs:group element itself, but the xs:sequence or xs:choice XML child. When we refer to the annotations on a global group definition, we are referring to the annotations on the xs:sequence or xs:choice.

  63. final class GlobalGroupDefFactory extends SchemaComponentFactory with GlobalNonElementComponentMixin

    Permalink
  64. trait GlobalNonElementComponentMixin extends GlobalComponent

    Permalink
  65. final class GlobalSequenceGroupDef extends GlobalGroupDef with SequenceDefMixin

    Permalink
  66. final class GlobalSimpleTypeDef extends SimpleTypeDefBase with GlobalNonElementComponentMixin with NestingLexicalMixin with NamedMixin

    Permalink

    Call forElement, and supply an element using this globalSimpalType, and you get back an instance that is one-to-one with the element.

    Call forElement, and supply an element using this globalSimpalType, and you get back an instance that is one-to-one with the element.

    Call forDeriviedType, and supply a different simpleType that uses this one, and you get back an instance that is one-to-one with that other type

  67. trait GroupDefLike extends AnnotatedSchemaComponent with ProvidesDFDLStatementMixin

    Permalink

    Common concepts for components that define groups.

    Common concepts for components that define groups.

    This includes both global group definitions, and local sequence and choice groups.

  68. trait GroupRef extends AnyRef

    Permalink
  69. final class GroupRefFactory extends SchemaComponentFactory with HasRefMixin

    Permalink

    A GroupRefFactory (group reference) is an indirection to factories to create a SequenceGroupRef, or ChoiceGroupRef.

    A GroupRefFactory (group reference) is an indirection to factories to create a SequenceGroupRef, or ChoiceGroupRef.

    The refXMLArg is the xml for the group reference.

    This factory exists in order to make error messages refer to the right part of the schema.

  70. trait HasOptRepTypeMixin extends AnyRef

    Permalink
  71. trait HasOptRepTypeMixinImpl extends SchemaComponent with HasOptRepTypeMixin

    Permalink
  72. sealed trait HasRepValueAttributes extends AnnotatedSchemaComponent with ResolvesLocalProperties

    Permalink
  73. trait HasTermCheck extends AnyRef

    Permalink

    Mixin for objects that are shared, but have consistency checks to be run that are based on the concrete Term objects they are associated with.

    Mixin for objects that are shared, but have consistency checks to be run that are based on the concrete Term objects they are associated with.

    E.g., DFDL statements may have checks that need to know the encoding (if it is known at compile time). We call this on each statement to enable the checking code to be expressed on that statement where it is relevant, but have it be callable from the concrete Term once it is created.

    This is a way to avoid use of backpointers from shared objects to every thing referencing them.

  74. abstract class IIBase extends SchemaComponent with NestingLexicalMixin

    Permalink

    Include/Import = "II" for short

  75. final class Import extends IIBase

    Permalink

    An import statement.

    An import statement.

    The enclosingGoalNamespace argument is Some(noNamespace) for a topLevel schema file that has no targetNamespace attribute.

    Now consider that we could be an import which is inside an included schema which includes another included, etc. A nest of included schemas the innermost of which then contains an import. We have to verify that the ultimate goal namespace at the start of that chain of includes is different from this imported schema's goalNamespace.

  76. final class Include extends IIBase

    Permalink

    enclosingGoalNS is None if this include is being included (by one include hop, or several) into a schema having 'no namespace'

    enclosingGoalNS is None if this include is being included (by one include hop, or several) into a schema having 'no namespace'

    enclosingGoalNS is Some(str) if this include is being included (by one include hop, or several) into a schema having a targetNamespace.

  77. trait InitiatedTerminatedMixin extends GrammarMixin with AnnotatedMixin with DelimitedRuntimeValuedPropertiesMixin

    Permalink
  78. trait LayeringRuntimeValuedPropertiesMixin extends RawLayeringRuntimeValuedPropertiesMixin

    Permalink
  79. trait LeafPropProvider extends LookupLocation with PropTypes with Logging

    Permalink

    A single annotation which combines short form, long form, and element form property bindings together.

    A single annotation which combines short form, long form, and element form property bindings together.

    From this perspective, there are no ref chains connecting format annotations together.

  80. final class LocalComplexTypeDef extends ComplexTypeBase with LocalNonElementComponentMixin with NestingLexicalMixin

    Permalink
  81. sealed trait LocalComponentMixinBase extends NamedMixin

    Permalink
  82. trait LocalElementComponentMixin extends LocalComponentMixinBase with ElementFormDefaultMixin

    Permalink
  83. class LocalElementDecl extends LocalElementDeclBase

    Permalink
  84. sealed abstract class LocalElementDeclBase extends ElementBase with LocalElementComponentMixin with ElementDeclNonFactoryDelegatingMixin with NestingLexicalMixin

    Permalink
  85. trait LocalElementMixin extends ParticleMixin with LocalElementGrammarMixin

    Permalink

    Common to local element decls and element references

  86. trait LocalNonElementComponentMixin extends LocalComponentMixinBase with PrefixAndNamespaceMixin

    Permalink
  87. final class LocalSimpleTypeDef extends SimpleTypeDefBase with LocalNonElementComponentMixin with NestingLexicalMixin

    Permalink
  88. abstract class ModelGroup extends Term with ModelGroupGrammarMixin with OverlapCheckMixin with NestingLexicalMixin

    Permalink

    Base class for all model groups, which are term containers.

    Base class for all model groups, which are term containers.

    There are ultimately 4 concrete classes that implement this: Sequence, Choice, SequenceGroupRef, and ChoiceGroupRef

  89. trait NamedMixin extends GetAttributesMixin with NamedMixinBase

    Permalink

    Common Mixin for things that have a name attribute.

  90. trait NestingLexicalMixin extends NestingMixin

    Permalink

    Mixin for all schema factories and schema components with no backpointers, just a lexical parent.

    Mixin for all schema factories and schema components with no backpointers, just a lexical parent. This means all the non-global schema components.

  91. trait NestingMixin extends AnyRef

    Permalink
  92. trait NestingTraversesToReferenceMixin extends NestingMixin

    Permalink

    Mixin for all global schema components

  93. trait NonPrimTypeMixin extends AnyRef

    Permalink
  94. trait OverlapCheckMixin extends AnyRef

    Permalink
  95. trait ParticleMixin extends RequiredOptionalMixin

    Permalink
  96. sealed trait PrefixAndNamespaceMixin extends AnyRef

    Permalink
  97. class PrefixLengthQuasiElementDecl extends QuasiElementDeclBase

    Permalink
  98. final class PrimitiveType extends SimpleTypeBase with NamedMixin

    Permalink

    PrimType nodes are part of the runtime.

    PrimType nodes are part of the runtime. For compilation, we need a notion of primitive type that derives from the same base a SimpleTypeBase and ComplexTypeBase, and it needs to have methods that take and return compiler-only object types; hence we can't define a base in the runtime because it can't have those methods; hence, can't achieve the polymorphism over all sorts of types.

    So for the compiler, a PrimitiveType is just a wrapper around a PrimType object.

  99. trait PropertyReferencedElementInfosMixin extends AnyRef

    Permalink
  100. trait ProvidesDFDLStatementMixin extends ThrowsSDE with HasTermCheck

    Permalink

    The other kind of DFDL annotations are DFDL 'statements'.

    The other kind of DFDL annotations are DFDL 'statements'. This trait is everything shared by schema components that can carry statements.

    Factory for creating the corresponding DFDLAnnotation objects.

  101. sealed abstract class QuasiElementDeclBase extends LocalElementDeclBase

    Permalink

    A QuasiElement is similar to a LocalElement except it will have no representation in the infoset, acting only as a temporary element that can be parsed/unparsed.

    A QuasiElement is similar to a LocalElement except it will have no representation in the infoset, acting only as a temporary element that can be parsed/unparsed. As an example, this is used as an element for parsing/unparsing prefix lengths. No element exists in the infoset or in the schema to represent a prefix length (only a simple type), so a quasi-element is used as a place where properties related to the prefix simple type can be accessed.

  102. trait RawCommonRuntimeValuedPropertiesMixin extends PropertyMixin

    Permalink
  103. trait RawDelimitedRuntimeValuedPropertiesMixin extends RawCommonRuntimeValuedPropertiesMixin

    Permalink
  104. trait RawElementRuntimeValuedPropertiesMixin extends RawDelimitedRuntimeValuedPropertiesMixin with RawSimpleTypeRuntimeValuedPropertiesMixin

    Permalink
  105. trait RawEscapeSchemeRuntimeValuedPropertiesMixin extends PropertyMixin

    Permalink
  106. trait RawLayeringRuntimeValuedPropertiesMixin extends PropertyMixin

    Permalink
  107. trait RawSequenceRuntimeValuedPropertiesMixin extends RawDelimitedRuntimeValuedPropertiesMixin

    Permalink
  108. trait RawSimpleTypeRuntimeValuedPropertiesMixin extends RawCommonRuntimeValuedPropertiesMixin

    Permalink
  109. case class RefSpec(from: SchemaComponent, to: SchemaComponentFactory, index: Int) extends Product with Serializable

    Permalink
  110. class RepTypeQuasiElementDecl extends QuasiElementDeclBase

    Permalink
  111. trait RequiredOptionalMixin extends AnyRef

    Permalink
  112. trait ResolvesDFDLStatementMixin extends ThrowsSDE with ProvidesDFDLStatementMixin

    Permalink
  113. trait ResolvesLocalProperties extends FindPropertyMixin

    Permalink

    Mixin for non-terms that need to lookup local properties

  114. trait ResolvesScopedProperties extends FindPropertyMixin

    Permalink

    Mixin for Term, which can lookup all properties using DFDL scoping rules.

  115. final class Restriction extends SchemaComponentImpl with Facets with NestingLexicalMixin with TypeChecks

    Permalink

    A schema component for simple type restrictions

  116. final class Root extends AbstractElementRef with RootGrammarMixin

    Permalink

    Root is a special kind of ElementRef that has no enclosing group.

    Root is a special kind of ElementRef that has no enclosing group.

    This is the entity that is compiled by the schema compiler.

  117. final class Schema extends SchemaComponentImpl

    Permalink

    A schema is all the schema documents sharing a single target namespace.

    A schema is all the schema documents sharing a single target namespace.

    That is, one can write several schema documents which all have the same target namespace, and in that case all those schema documents make up the 'schema'.

  118. trait SchemaComponent extends BasicComponent with ImplementsThrowsOrSavesSDE with GetAttributesMixin with SchemaComponentIncludesAndImportsMixin with ResolvesQNames with SchemaFileLocatableImpl with PropTypes

    Permalink

    The core root class of the DFDL Schema object model.

    The core root class of the DFDL Schema object model.

    Every schema component has a schema document, and a schema, and a namespace.

  119. abstract class SchemaComponentFactory extends SchemaComponent with NestingLexicalMixin

    Permalink

    Anything that can be computed without reference to the point of use or point of reference can be computed here on these factory objects.

  120. abstract class SchemaComponentImpl extends SchemaComponent

    Permalink
  121. trait SchemaComponentIncludesAndImportsMixin extends CommonContextMixin

    Permalink

    Mixin for all SchemaComponents

  122. trait SchemaDocIncludesAndImportsMixin extends AnyRef

    Permalink

    Mixin for SchemaDocument

  123. final class SchemaDocument extends AnnotatedSchemaComponent with SchemaDocumentMixin

    Permalink

    Handles only things specific to DFDL about schema documents.

    Handles only things specific to DFDL about schema documents.

    I.e., default format properties, named format properties, etc.

  124. trait SchemaDocumentMixin extends AnyRef

    Permalink

    Common to both types we use for dealing with schema documents.

  125. trait SchemaFileLocatableImpl extends SchemaFileLocatable

    Permalink
  126. final class SchemaSet extends SchemaComponentImpl with SchemaSetIncludesAndImportsMixin

    Permalink

    A schema set is exactly that, a set of schemas.

    A schema set is exactly that, a set of schemas. Each schema has a target namespace (or 'no namespace'), so a schema set is conceptually a mapping from a namespace URI (or empty string, meaning no namespace) onto schema.

    Constructing these from XML Nodes is a unit-test interface. The real constructor takes a sequence of file names, and you can optionally specify a root element via the rootSpec argument.

    A schema set is a SchemaComponent (derived from that base), so as to inherit the error/warning accumulation behavior that all SchemaComponents share. A schema set invokes our XML Loader, which can produce validation errors, and those have to be gathered so we can give the user back a group of them, not just one.

    Schema set is however, a kind of a fake SchemaComponent in that it doesn't correspond to any user-specified schema object. And unlike other schema components obviously it does not live within a schema document.

  127. trait SchemaSetIncludesAndImportsMixin extends AnyRef

    Permalink

    Mixin for SchemaSet

  128. final class Sequence extends SequenceGroupTermBase with SequenceDefMixin

    Permalink

    Represents a local sequence definition.

  129. trait SequenceDefMixin extends AnnotatedSchemaComponent with GroupDefLike with FindPropertyMixin

    Permalink

    Captures concepts associated with definitions of Sequence groups.

    Captures concepts associated with definitions of Sequence groups.

    Used by GlobalSequenceGroupDef and local Sequence, but not by SequenceGroupRef. Used on objects that can carry DFDLSequence annotation objects.

  130. final class SequenceGroupRef extends SequenceGroupTermBase with GroupRef

    Permalink
  131. abstract class SequenceGroupTermBase extends SequenceTermBase with Sequence_AnnotationMixin with SequenceRuntimeValuedPropertiesMixin with SeparatorSuppressionPolicyMixin with LayeringRuntimeValuedPropertiesMixin

    Permalink

    Base for anything sequence-like that actually has the sequence properties.

    Base for anything sequence-like that actually has the sequence properties. So actual sequences, group refs to them, but NOT implied sequences inside choice branches.

  132. trait SequenceRuntimeValuedPropertiesMixin extends DelimitedRuntimeValuedPropertiesMixin with Sequence_AnnotationMixin with RawSequenceRuntimeValuedPropertiesMixin

    Permalink
  133. abstract class SequenceTermBase extends ModelGroup with SequenceGrammarMixin

    Permalink

    Base for anything sequence-like.

    Base for anything sequence-like.

    Sequences, group refs to sequences, and the implied sequences that are choice branches, are all instances.

  134. sealed trait SimpleTypeBase extends TypeBase with HasOptRepTypeMixin

    Permalink
  135. abstract class SimpleTypeDefBase extends AnnotatedSchemaComponentImpl with SimpleTypeBase with NonPrimTypeMixin with ProvidesDFDLStatementMixin with OverlapCheckMixin with HasOptRepTypeMixinImpl with NamedMixin with HasRepValueAttributes

    Permalink
  136. trait SimpleTypeRuntimeValuedPropertiesMixin extends DFDLSimpleTypeMixin with RawSimpleTypeRuntimeValuedPropertiesMixin with TextStandardExponentRepMixin

    Permalink
  137. trait Term extends AnnotatedSchemaComponent with ResolvesScopedProperties with ResolvesDFDLStatementMixin with TermRuntimeValuedPropertiesMixin with TermGrammarMixin with DelimitedRuntimeValuedPropertiesMixin with InitiatedTerminatedMixin with TermEncodingMixin with EscapeSchemeRefMixin

    Permalink

    Term, and what is and isn't a Term, is a key concept in DSOM.

    Term, and what is and isn't a Term, is a key concept in DSOM.

    From elements, ElementRef and LocalElementDecl are Term. A GlobalElementDecl is *not* a Term. From sequences, Sequence and SequenceGroupRef are Term. GlobalSequenceGroupDef is *not* a Term. From choices, Choice and ChoiceGroupRef are Term. GlobalChoiceGroupDef is *not* a Term.

    Terms are the things we actually generate parsers/unparsers for. Non-Terms just contribute information used by Terms.

  138. trait TermEncodingMixin extends KnownEncodingMixin

    Permalink

    Captures concepts around dfdl:encoding property and Terms.

    Captures concepts around dfdl:encoding property and Terms.

    Just factored out into a trait for isolation of related code.

  139. trait TermRuntimeValuedPropertiesMixin extends DFDLBaseTypeMixin with PropertyReferencedElementInfosMixin with ChoiceAGMixin with RawCommonRuntimeValuedPropertiesMixin

    Permalink
  140. trait TypeBase extends AnyRef

    Permalink
  141. sealed trait TypeChecks extends AnyRef

    Permalink
  142. final class Union extends SchemaComponentImpl with NestingLexicalMixin

    Permalink

    A schema component for simple type unions

  143. class ValidateSchemasErrorHandler extends ErrorHandler

    Permalink
  144. abstract class VariableReference extends DFDLStatement

    Permalink
  145. final class XMLSchemaDocument extends SchemaComponentImpl with SchemaDocumentMixin with SchemaDocIncludesAndImportsMixin

    Permalink

    Handles everything about schema documents that has nothing to do with DFDL.

    Handles everything about schema documents that has nothing to do with DFDL. Things like namespace, include, import, elementFormDefault etc.

Value Members

  1. object DeprecatedProperty extends Serializable

    Permalink
  2. object ElementBase

    Permalink

    Note about DSOM design versus say XSOM or Apache XSD library.

    Note about DSOM design versus say XSOM or Apache XSD library.

    Some XSD object models have a single Element class, and distinguish local/global and element references based on attributes of the instances.

    Our approach is to provide common behaviors on base classes or traits/mixins, and to have distinct classes for each instance type.

  3. object ExpressionCompilers extends ExpressionCompilerClass

    Permalink
  4. object IIUtils

    Permalink

    Maps an optional namespace and optional schemaLocation to an Include or Import object.

    Maps an optional namespace and optional schemaLocation to an Include or Import object.

    As we include/import schemas, we append to one of these, and before we include/import we check to see if it is already here.

    About use of Delay[T]:

    This is fairly deep function programming stuff, but it let's us have our cake and eat it too for one thing. In processing of import statements like this <xs:include schemaLocation="..."/>, the chicken/egg problem arises about namespaces. We have to read the file just in order to know the namespace in order to be able to decide if we have seen this (NS, URL) pair before, and therefore don't need to load the file....

    So we maintain this growing map of (NS, URL) => file called an IIMap.

    We use delay on this, because it lets us construct the DFDLSchemaFile, construct the XMLSchemaDocument object, both of which require that we pass in the IIMap. Then we can ask the XMLSchemaDocument for the targetNamespace of the file, which will cause the file to be read. But none of this needs the IIMap argument yet.

    We then look at this new (tns, url) pair, and see if it is already in the map. If not, we extend the IIMap,... and by the magic of Delayed evaluation, that map is the one being passed to the DFDLSchemaFile and XMLSchemaDocument above.

    Seems cyclical, but it isn't. We can call the constructors, passing them a promise (aka Delayed IIMap) to deliver the IIMap when it is needed. Turns out it isn't needed for the constructed object to answer the question "what is the targetNamespace". But that target namespace information IS needed to determine the IIMap which will be supplied when demanded.

    From an ObjectOriented programing perspective, we don't pass an IIMap, we pass an IIMap factory (a delayed IIMap is effectively that). That factory isn't being called yet, and by the way it has pointers back to data structures that will be filled in later, so it can't be called yet. You wouldn't write an OO program this way usually.

    Note that we must use a map that maintains insertion order, of which ListMap is one of them.

  5. object ModelGroupFactory

    Permalink

    A factory for model groups.

    A factory for model groups.

    Takes care of detecting group references, and constructing the proper SequenceGroupRef or ChoiceGroupRef object.

  6. object PrimitiveType

    Permalink
  7. object ResolvesProperties

    Permalink

    Only objects from which we generate processors (parsers/unparsers) can lookup scoped property values.

    Only objects from which we generate processors (parsers/unparsers) can lookup scoped property values.

    This avoids the possibility of a property being resolved incorrectly by not looking at the complete chain of schema components contributing to the property resolution.

    The only objects that should resolve properties are instances of Term ElementRef, Root, LocalElementDecl, Sequence, Choice, SequenceRef, ChoiceRef, EnumerationFactory, SimpleTypeDefFactory,

    All "real" terms are able to resolve properties. Most other objects just contribute properties to the mix, but they are not points where properties are used to generate processors.

    EnumerationFactory and SimpleTypeDefFactory are the oddballs out. In addition to being used to generate processors, these classes our also used to generate abstract TypeCalculators, which are not necessarily attached to any particular element, nor used to generate any processor (for instance, there may be a globalSimpleType whose only purpose is to define a TypeCalculator for use in DPath expressions)

  8. object TermFactory

    Permalink

    Factory for Terms

  9. object UnparserInfo

    Permalink

    Information needed specifically for unparsing.

Inherited from AnyRef

Inherited from Any

Ungrouped