Class ElementTemplate

All Implemented Interfaces:
ToplevelTemplate

class ElementTemplate extends ContainerTemplate implements ToplevelTemplate
Contains basic information for one particular element and the methods for generating the different constructors, parsers and top-level inquiry methods.

(Parsers and access methods for the content are generated in TypedDOMGenerator, for the attributes in TypedAttrsGenerator.)

  • Field Details

    • element

      final DTD.Element element
      The original definition of this element.
    • nname

      final NamespaceName nname
      The name of the element, AFTER it has been translated according to the namespace PIs contained in the DTD source. (Is not related to the "DTD as such", but only to the generated code!)
    • tagName

      final String tagName
      The name of the element, as it is verbatim contained in the DTD. Used for Java identifier generation after certain replacements.
    • tagIndex

      final int tagIndex
      DOCME
    • isPublic

      final boolean isPublic
      DOCME
    • tagNameField

      GeneratedField tagNameField
      Field in the generated code of the element which holds the tag of the element, das defined in the DTD.
    • hasAtts

      boolean hasAtts
    • isEmpty

      boolean isEmpty
    • parsingConstructor

      @Opt @Opt GeneratedConstructor parsingConstructor

      Survey on all GeneratedConstructor-s:

      The constructors in AbstractElementTemplate are nearly parameterless and only needed for the UPWARD chain from a particular model element class via abstract elements and package.Element to tdom.runtime.TypedElement. They use only the name parameter. (WHY? IS KNOWN STATIC !?!?!) Thus they throw nothing.

         typedConstructor = new Element(NamespaceName)
         untypedConstructor = new Element(W3CDOM)
        

      Further irrelevant GeneratedConstructor-s:
      one in DTDTemplate ("new DTD(MsgRcv)")
      two in DumperTemplate (ContentHandler plus LexicalHandler)

      Most GeneratedConstructor are built when TypedDOMGenerator visits the content models, and must be accessible when "finish" generates API documentation.

                                                     S=shallow D=descending
                                                     | live on C=Container/E=Element Template
                                                     | |  X=ContentModelException
                                                     | |  |  S=AttributeSyntaxExc(iff approp)
                                                     | |  |   M=AttributeMissingExc(iff approp)
                                                     | |  |   AX=AttributeExc iff any Att present
         typedConstructor = new Ele/CP(C1,C2,C3)     S C     SM
         typedConstructorSafe = new Ele/CP(SV,C1,..) S E      M
         untypedConstructor = new Element(w3cDom..)  D C  X   AX
                              new Seq(CntMap..)      D C  X   AX
         parsingConstructor = new Element(CntMap..)  S E  X   AX  INTERNAL ONLY "C"-->FIXME CHECK
         disambigConstructor = new Ele/CP()          S C      M
         disambigConstructorSafe = new Ele(SF)       S C      M
         semiparsingConstructor = new E(SaxAtt,E..)  S E  X  SM
         semiparsingConstructorConstructorShort = new E(E..)    
                                                     S E  X   M
         pcdataOnlyConstructor=new E(String)         S E     SM   (built in TypedDOMGenerator !?)
      
         CntMap=ContentMap  Ele/CP=Element or Choice or Sequence SV=SafeValues-flag
         SaxAtt = SAX.Attributes
      
         ADDITIONAL for the mixed content case there are 
         pcdataEmptyConstructor=new E() = disambigConstructor
         pcdataEmptyConstructorSafe =new E(SV) = disambigConstructorSafe
      
         pcdataOnlyConstructor =new E(String) 
         pcdataOnlyConstructorSafe =new E(SV, String) 
        
      The "..Safe" variants are generated ONLY if there are unsafe attributes.

      The constructors of the generated common "Document" superclass is trivial and invokes the constructors of the runtime class with the DTD class as only argument.
      Some of the constructors in the generated "Document_[XY]" classes initiate parsing:

                                                     S=shallow D=descending
                                                     | 
                                                     |    X=ContentModelException
                                                     |    |  S=AttributeSyntaxExc(iff approp)
                                                     |    |   M=AttributeMissingExc(iff approp)
                                                     |    |   AX=AttributeExc iff any Att present
         typedConstructor = new Doc_[XY](Element)    S         
         untypedConstructor = new Doc_[XY](w3cDom..) D    X   AX
         saxConstructor = new Doc_[XY](SaxStr)       D    X   AX    (SaxStr=SAXEventStream)
         decodeConstructor = new Doc_[XY](JIS)       D    X   AX    (JIS=java.io.InputStream)
        

      The "ContentClass" classes generated for MIXED content get one constructor for each possible element type, and one for pcdata (=String), and one common with the altIndex as parameter.
      (( Additionally there is a "FactoryConstructor" ??? DOCME ))

      Closely related to the constructors are the parse() and decode() methods and their signatures. MORE TO COME DOCME

      ---------------------------------------------------------------

      Generating constructors: (ml 20170727) The DOM and SAX constructors and parsers are not used with fine granularity, so they can follow a global decision: Iff there is any one attribute contained in the DTD, they declare to throw TdomAttributeException.
      typedConstructor, untypedConstructor and disambigConstructor are defined on the super class level, They do ALWAYS exist and are also used for Choice and Sequence.
      The other constructors live only in this code file.
      "untypedConstructor" has parameters: (DOM-element, ext, listener). It is PRIVATE, used by parse(DOM-element...) which is NOT VISIBLE in api doc, but has package scope. The user method for parsing DOM objects is finally DTD.[FIXME].
      "typedConstructor" has parameters: (complete content model copied from "set(..)" method).
      It is public and presented to the user. It does not throw TdomContentException, but possibly TdomAttributeException.
      "semiparsingConstructor" has a optional SAX ATTRIBUTE LIST and a sequence of /Element. It can throw content and attribute exceptions
      "semiparsingConstructorShort" is a shortcut with no sax attribute list.
      "parsingConstructor" has ContentMapping, Extension, Listener. It is INTERNAL ONLY and used by FIXME ASK BT
      "disambigConstructor" is needed iff zero-length content is possible but not necessary, as in case of "MIXED" content. It treats the empty case explcitly. This is necessary because otherwise the empty signature would be ambigious between "typed" and "untyped" and rejected when compiling the applying code.
      pcdataOnlyConstructor convenience constructor accepting one string. (Is built in TypedDOMGenerator)

    • pcdataOnlyConstructor

      @Opt @Opt GeneratedConstructor pcdataOnlyConstructor

      Survey on all GeneratedConstructor-s:

      The constructors in AbstractElementTemplate are nearly parameterless and only needed for the UPWARD chain from a particular model element class via abstract elements and package.Element to tdom.runtime.TypedElement. They use only the name parameter. (WHY? IS KNOWN STATIC !?!?!) Thus they throw nothing.

         typedConstructor = new Element(NamespaceName)
         untypedConstructor = new Element(W3CDOM)
        

      Further irrelevant GeneratedConstructor-s:
      one in DTDTemplate ("new DTD(MsgRcv)")
      two in DumperTemplate (ContentHandler plus LexicalHandler)

      Most GeneratedConstructor are built when TypedDOMGenerator visits the content models, and must be accessible when "finish" generates API documentation.

                                                     S=shallow D=descending
                                                     | live on C=Container/E=Element Template
                                                     | |  X=ContentModelException
                                                     | |  |  S=AttributeSyntaxExc(iff approp)
                                                     | |  |   M=AttributeMissingExc(iff approp)
                                                     | |  |   AX=AttributeExc iff any Att present
         typedConstructor = new Ele/CP(C1,C2,C3)     S C     SM
         typedConstructorSafe = new Ele/CP(SV,C1,..) S E      M
         untypedConstructor = new Element(w3cDom..)  D C  X   AX
                              new Seq(CntMap..)      D C  X   AX
         parsingConstructor = new Element(CntMap..)  S E  X   AX  INTERNAL ONLY "C"-->FIXME CHECK
         disambigConstructor = new Ele/CP()          S C      M
         disambigConstructorSafe = new Ele(SF)       S C      M
         semiparsingConstructor = new E(SaxAtt,E..)  S E  X  SM
         semiparsingConstructorConstructorShort = new E(E..)    
                                                     S E  X   M
         pcdataOnlyConstructor=new E(String)         S E     SM   (built in TypedDOMGenerator !?)
      
         CntMap=ContentMap  Ele/CP=Element or Choice or Sequence SV=SafeValues-flag
         SaxAtt = SAX.Attributes
      
         ADDITIONAL for the mixed content case there are 
         pcdataEmptyConstructor=new E() = disambigConstructor
         pcdataEmptyConstructorSafe =new E(SV) = disambigConstructorSafe
      
         pcdataOnlyConstructor =new E(String) 
         pcdataOnlyConstructorSafe =new E(SV, String) 
        
      The "..Safe" variants are generated ONLY if there are unsafe attributes.

      The constructors of the generated common "Document" superclass is trivial and invokes the constructors of the runtime class with the DTD class as only argument.
      Some of the constructors in the generated "Document_[XY]" classes initiate parsing:

                                                     S=shallow D=descending
                                                     | 
                                                     |    X=ContentModelException
                                                     |    |  S=AttributeSyntaxExc(iff approp)
                                                     |    |   M=AttributeMissingExc(iff approp)
                                                     |    |   AX=AttributeExc iff any Att present
         typedConstructor = new Doc_[XY](Element)    S         
         untypedConstructor = new Doc_[XY](w3cDom..) D    X   AX
         saxConstructor = new Doc_[XY](SaxStr)       D    X   AX    (SaxStr=SAXEventStream)
         decodeConstructor = new Doc_[XY](JIS)       D    X   AX    (JIS=java.io.InputStream)
        

      The "ContentClass" classes generated for MIXED content get one constructor for each possible element type, and one for pcdata (=String), and one common with the altIndex as parameter.
      (( Additionally there is a "FactoryConstructor" ??? DOCME ))

      Closely related to the constructors are the parse() and decode() methods and their signatures. MORE TO COME DOCME

      ---------------------------------------------------------------

      Generating constructors: (ml 20170727) The DOM and SAX constructors and parsers are not used with fine granularity, so they can follow a global decision: Iff there is any one attribute contained in the DTD, they declare to throw TdomAttributeException.
      typedConstructor, untypedConstructor and disambigConstructor are defined on the super class level, They do ALWAYS exist and are also used for Choice and Sequence.
      The other constructors live only in this code file.
      "untypedConstructor" has parameters: (DOM-element, ext, listener). It is PRIVATE, used by parse(DOM-element...) which is NOT VISIBLE in api doc, but has package scope. The user method for parsing DOM objects is finally DTD.[FIXME].
      "typedConstructor" has parameters: (complete content model copied from "set(..)" method).
      It is public and presented to the user. It does not throw TdomContentException, but possibly TdomAttributeException.
      "semiparsingConstructor" has a optional SAX ATTRIBUTE LIST and a sequence of /Element. It can throw content and attribute exceptions
      "semiparsingConstructorShort" is a shortcut with no sax attribute list.
      "parsingConstructor" has ContentMapping, Extension, Listener. It is INTERNAL ONLY and used by FIXME ASK BT
      "disambigConstructor" is needed iff zero-length content is possible but not necessary, as in case of "MIXED" content. It treats the empty case explcitly. This is necessary because otherwise the empty signature would be ambigious between "typed" and "untyped" and rejected when compiling the applying code.
      pcdataOnlyConstructor convenience constructor accepting one string. (Is built in TypedDOMGenerator)

    • pcdataOnlyConstructorSafe

      @Opt @Opt GeneratedConstructor pcdataOnlyConstructorSafe

      Survey on all GeneratedConstructor-s:

      The constructors in AbstractElementTemplate are nearly parameterless and only needed for the UPWARD chain from a particular model element class via abstract elements and package.Element to tdom.runtime.TypedElement. They use only the name parameter. (WHY? IS KNOWN STATIC !?!?!) Thus they throw nothing.

         typedConstructor = new Element(NamespaceName)
         untypedConstructor = new Element(W3CDOM)
        

      Further irrelevant GeneratedConstructor-s:
      one in DTDTemplate ("new DTD(MsgRcv)")
      two in DumperTemplate (ContentHandler plus LexicalHandler)

      Most GeneratedConstructor are built when TypedDOMGenerator visits the content models, and must be accessible when "finish" generates API documentation.

                                                     S=shallow D=descending
                                                     | live on C=Container/E=Element Template
                                                     | |  X=ContentModelException
                                                     | |  |  S=AttributeSyntaxExc(iff approp)
                                                     | |  |   M=AttributeMissingExc(iff approp)
                                                     | |  |   AX=AttributeExc iff any Att present
         typedConstructor = new Ele/CP(C1,C2,C3)     S C     SM
         typedConstructorSafe = new Ele/CP(SV,C1,..) S E      M
         untypedConstructor = new Element(w3cDom..)  D C  X   AX
                              new Seq(CntMap..)      D C  X   AX
         parsingConstructor = new Element(CntMap..)  S E  X   AX  INTERNAL ONLY "C"-->FIXME CHECK
         disambigConstructor = new Ele/CP()          S C      M
         disambigConstructorSafe = new Ele(SF)       S C      M
         semiparsingConstructor = new E(SaxAtt,E..)  S E  X  SM
         semiparsingConstructorConstructorShort = new E(E..)    
                                                     S E  X   M
         pcdataOnlyConstructor=new E(String)         S E     SM   (built in TypedDOMGenerator !?)
      
         CntMap=ContentMap  Ele/CP=Element or Choice or Sequence SV=SafeValues-flag
         SaxAtt = SAX.Attributes
      
         ADDITIONAL for the mixed content case there are 
         pcdataEmptyConstructor=new E() = disambigConstructor
         pcdataEmptyConstructorSafe =new E(SV) = disambigConstructorSafe
      
         pcdataOnlyConstructor =new E(String) 
         pcdataOnlyConstructorSafe =new E(SV, String) 
        
      The "..Safe" variants are generated ONLY if there are unsafe attributes.

      The constructors of the generated common "Document" superclass is trivial and invokes the constructors of the runtime class with the DTD class as only argument.
      Some of the constructors in the generated "Document_[XY]" classes initiate parsing:

                                                     S=shallow D=descending
                                                     | 
                                                     |    X=ContentModelException
                                                     |    |  S=AttributeSyntaxExc(iff approp)
                                                     |    |   M=AttributeMissingExc(iff approp)
                                                     |    |   AX=AttributeExc iff any Att present
         typedConstructor = new Doc_[XY](Element)    S         
         untypedConstructor = new Doc_[XY](w3cDom..) D    X   AX
         saxConstructor = new Doc_[XY](SaxStr)       D    X   AX    (SaxStr=SAXEventStream)
         decodeConstructor = new Doc_[XY](JIS)       D    X   AX    (JIS=java.io.InputStream)
        

      The "ContentClass" classes generated for MIXED content get one constructor for each possible element type, and one for pcdata (=String), and one common with the altIndex as parameter.
      (( Additionally there is a "FactoryConstructor" ??? DOCME ))

      Closely related to the constructors are the parse() and decode() methods and their signatures. MORE TO COME DOCME

      ---------------------------------------------------------------

      Generating constructors: (ml 20170727) The DOM and SAX constructors and parsers are not used with fine granularity, so they can follow a global decision: Iff there is any one attribute contained in the DTD, they declare to throw TdomAttributeException.
      typedConstructor, untypedConstructor and disambigConstructor are defined on the super class level, They do ALWAYS exist and are also used for Choice and Sequence.
      The other constructors live only in this code file.
      "untypedConstructor" has parameters: (DOM-element, ext, listener). It is PRIVATE, used by parse(DOM-element...) which is NOT VISIBLE in api doc, but has package scope. The user method for parsing DOM objects is finally DTD.[FIXME].
      "typedConstructor" has parameters: (complete content model copied from "set(..)" method).
      It is public and presented to the user. It does not throw TdomContentException, but possibly TdomAttributeException.
      "semiparsingConstructor" has a optional SAX ATTRIBUTE LIST and a sequence of /Element. It can throw content and attribute exceptions
      "semiparsingConstructorShort" is a shortcut with no sax attribute list.
      "parsingConstructor" has ContentMapping, Extension, Listener. It is INTERNAL ONLY and used by FIXME ASK BT
      "disambigConstructor" is needed iff zero-length content is possible but not necessary, as in case of "MIXED" content. It treats the empty case explcitly. This is necessary because otherwise the empty signature would be ambigious between "typed" and "untyped" and rejected when compiling the applying code.
      pcdataOnlyConstructor convenience constructor accepting one string. (Is built in TypedDOMGenerator)

    • semiparsingPreConstructor

      @Opt @Opt GeneratedConstructor semiparsingPreConstructor

      Survey on all GeneratedConstructor-s:

      The constructors in AbstractElementTemplate are nearly parameterless and only needed for the UPWARD chain from a particular model element class via abstract elements and package.Element to tdom.runtime.TypedElement. They use only the name parameter. (WHY? IS KNOWN STATIC !?!?!) Thus they throw nothing.

         typedConstructor = new Element(NamespaceName)
         untypedConstructor = new Element(W3CDOM)
        

      Further irrelevant GeneratedConstructor-s:
      one in DTDTemplate ("new DTD(MsgRcv)")
      two in DumperTemplate (ContentHandler plus LexicalHandler)

      Most GeneratedConstructor are built when TypedDOMGenerator visits the content models, and must be accessible when "finish" generates API documentation.

                                                     S=shallow D=descending
                                                     | live on C=Container/E=Element Template
                                                     | |  X=ContentModelException
                                                     | |  |  S=AttributeSyntaxExc(iff approp)
                                                     | |  |   M=AttributeMissingExc(iff approp)
                                                     | |  |   AX=AttributeExc iff any Att present
         typedConstructor = new Ele/CP(C1,C2,C3)     S C     SM
         typedConstructorSafe = new Ele/CP(SV,C1,..) S E      M
         untypedConstructor = new Element(w3cDom..)  D C  X   AX
                              new Seq(CntMap..)      D C  X   AX
         parsingConstructor = new Element(CntMap..)  S E  X   AX  INTERNAL ONLY "C"-->FIXME CHECK
         disambigConstructor = new Ele/CP()          S C      M
         disambigConstructorSafe = new Ele(SF)       S C      M
         semiparsingConstructor = new E(SaxAtt,E..)  S E  X  SM
         semiparsingConstructorConstructorShort = new E(E..)    
                                                     S E  X   M
         pcdataOnlyConstructor=new E(String)         S E     SM   (built in TypedDOMGenerator !?)
      
         CntMap=ContentMap  Ele/CP=Element or Choice or Sequence SV=SafeValues-flag
         SaxAtt = SAX.Attributes
      
         ADDITIONAL for the mixed content case there are 
         pcdataEmptyConstructor=new E() = disambigConstructor
         pcdataEmptyConstructorSafe =new E(SV) = disambigConstructorSafe
      
         pcdataOnlyConstructor =new E(String) 
         pcdataOnlyConstructorSafe =new E(SV, String) 
        
      The "..Safe" variants are generated ONLY if there are unsafe attributes.

      The constructors of the generated common "Document" superclass is trivial and invokes the constructors of the runtime class with the DTD class as only argument.
      Some of the constructors in the generated "Document_[XY]" classes initiate parsing:

                                                     S=shallow D=descending
                                                     | 
                                                     |    X=ContentModelException
                                                     |    |  S=AttributeSyntaxExc(iff approp)
                                                     |    |   M=AttributeMissingExc(iff approp)
                                                     |    |   AX=AttributeExc iff any Att present
         typedConstructor = new Doc_[XY](Element)    S         
         untypedConstructor = new Doc_[XY](w3cDom..) D    X   AX
         saxConstructor = new Doc_[XY](SaxStr)       D    X   AX    (SaxStr=SAXEventStream)
         decodeConstructor = new Doc_[XY](JIS)       D    X   AX    (JIS=java.io.InputStream)
        

      The "ContentClass" classes generated for MIXED content get one constructor for each possible element type, and one for pcdata (=String), and one common with the altIndex as parameter.
      (( Additionally there is a "FactoryConstructor" ??? DOCME ))

      Closely related to the constructors are the parse() and decode() methods and their signatures. MORE TO COME DOCME

      ---------------------------------------------------------------

      Generating constructors: (ml 20170727) The DOM and SAX constructors and parsers are not used with fine granularity, so they can follow a global decision: Iff there is any one attribute contained in the DTD, they declare to throw TdomAttributeException.
      typedConstructor, untypedConstructor and disambigConstructor are defined on the super class level, They do ALWAYS exist and are also used for Choice and Sequence.
      The other constructors live only in this code file.
      "untypedConstructor" has parameters: (DOM-element, ext, listener). It is PRIVATE, used by parse(DOM-element...) which is NOT VISIBLE in api doc, but has package scope. The user method for parsing DOM objects is finally DTD.[FIXME].
      "typedConstructor" has parameters: (complete content model copied from "set(..)" method).
      It is public and presented to the user. It does not throw TdomContentException, but possibly TdomAttributeException.
      "semiparsingConstructor" has a optional SAX ATTRIBUTE LIST and a sequence of /Element. It can throw content and attribute exceptions
      "semiparsingConstructorShort" is a shortcut with no sax attribute list.
      "parsingConstructor" has ContentMapping, Extension, Listener. It is INTERNAL ONLY and used by FIXME ASK BT
      "disambigConstructor" is needed iff zero-length content is possible but not necessary, as in case of "MIXED" content. It treats the empty case explcitly. This is necessary because otherwise the empty signature would be ambigious between "typed" and "untyped" and rejected when compiling the applying code.
      pcdataOnlyConstructor convenience constructor accepting one string. (Is built in TypedDOMGenerator)

    • semiparsingConstructor

      @Opt @Opt GeneratedConstructor semiparsingConstructor

      Survey on all GeneratedConstructor-s:

      The constructors in AbstractElementTemplate are nearly parameterless and only needed for the UPWARD chain from a particular model element class via abstract elements and package.Element to tdom.runtime.TypedElement. They use only the name parameter. (WHY? IS KNOWN STATIC !?!?!) Thus they throw nothing.

         typedConstructor = new Element(NamespaceName)
         untypedConstructor = new Element(W3CDOM)
        

      Further irrelevant GeneratedConstructor-s:
      one in DTDTemplate ("new DTD(MsgRcv)")
      two in DumperTemplate (ContentHandler plus LexicalHandler)

      Most GeneratedConstructor are built when TypedDOMGenerator visits the content models, and must be accessible when "finish" generates API documentation.

                                                     S=shallow D=descending
                                                     | live on C=Container/E=Element Template
                                                     | |  X=ContentModelException
                                                     | |  |  S=AttributeSyntaxExc(iff approp)
                                                     | |  |   M=AttributeMissingExc(iff approp)
                                                     | |  |   AX=AttributeExc iff any Att present
         typedConstructor = new Ele/CP(C1,C2,C3)     S C     SM
         typedConstructorSafe = new Ele/CP(SV,C1,..) S E      M
         untypedConstructor = new Element(w3cDom..)  D C  X   AX
                              new Seq(CntMap..)      D C  X   AX
         parsingConstructor = new Element(CntMap..)  S E  X   AX  INTERNAL ONLY "C"-->FIXME CHECK
         disambigConstructor = new Ele/CP()          S C      M
         disambigConstructorSafe = new Ele(SF)       S C      M
         semiparsingConstructor = new E(SaxAtt,E..)  S E  X  SM
         semiparsingConstructorConstructorShort = new E(E..)    
                                                     S E  X   M
         pcdataOnlyConstructor=new E(String)         S E     SM   (built in TypedDOMGenerator !?)
      
         CntMap=ContentMap  Ele/CP=Element or Choice or Sequence SV=SafeValues-flag
         SaxAtt = SAX.Attributes
      
         ADDITIONAL for the mixed content case there are 
         pcdataEmptyConstructor=new E() = disambigConstructor
         pcdataEmptyConstructorSafe =new E(SV) = disambigConstructorSafe
      
         pcdataOnlyConstructor =new E(String) 
         pcdataOnlyConstructorSafe =new E(SV, String) 
        
      The "..Safe" variants are generated ONLY if there are unsafe attributes.

      The constructors of the generated common "Document" superclass is trivial and invokes the constructors of the runtime class with the DTD class as only argument.
      Some of the constructors in the generated "Document_[XY]" classes initiate parsing:

                                                     S=shallow D=descending
                                                     | 
                                                     |    X=ContentModelException
                                                     |    |  S=AttributeSyntaxExc(iff approp)
                                                     |    |   M=AttributeMissingExc(iff approp)
                                                     |    |   AX=AttributeExc iff any Att present
         typedConstructor = new Doc_[XY](Element)    S         
         untypedConstructor = new Doc_[XY](w3cDom..) D    X   AX
         saxConstructor = new Doc_[XY](SaxStr)       D    X   AX    (SaxStr=SAXEventStream)
         decodeConstructor = new Doc_[XY](JIS)       D    X   AX    (JIS=java.io.InputStream)
        

      The "ContentClass" classes generated for MIXED content get one constructor for each possible element type, and one for pcdata (=String), and one common with the altIndex as parameter.
      (( Additionally there is a "FactoryConstructor" ??? DOCME ))

      Closely related to the constructors are the parse() and decode() methods and their signatures. MORE TO COME DOCME

      ---------------------------------------------------------------

      Generating constructors: (ml 20170727) The DOM and SAX constructors and parsers are not used with fine granularity, so they can follow a global decision: Iff there is any one attribute contained in the DTD, they declare to throw TdomAttributeException.
      typedConstructor, untypedConstructor and disambigConstructor are defined on the super class level, They do ALWAYS exist and are also used for Choice and Sequence.
      The other constructors live only in this code file.
      "untypedConstructor" has parameters: (DOM-element, ext, listener). It is PRIVATE, used by parse(DOM-element...) which is NOT VISIBLE in api doc, but has package scope. The user method for parsing DOM objects is finally DTD.[FIXME].
      "typedConstructor" has parameters: (complete content model copied from "set(..)" method).
      It is public and presented to the user. It does not throw TdomContentException, but possibly TdomAttributeException.
      "semiparsingConstructor" has a optional SAX ATTRIBUTE LIST and a sequence of /Element. It can throw content and attribute exceptions
      "semiparsingConstructorShort" is a shortcut with no sax attribute list.
      "parsingConstructor" has ContentMapping, Extension, Listener. It is INTERNAL ONLY and used by FIXME ASK BT
      "disambigConstructor" is needed iff zero-length content is possible but not necessary, as in case of "MIXED" content. It treats the empty case explcitly. This is necessary because otherwise the empty signature would be ambigious between "typed" and "untyped" and rejected when compiling the applying code.
      pcdataOnlyConstructor convenience constructor accepting one string. (Is built in TypedDOMGenerator)

    • semiparsingConstructorShort

      @Opt @Opt GeneratedConstructor semiparsingConstructorShort

      Survey on all GeneratedConstructor-s:

      The constructors in AbstractElementTemplate are nearly parameterless and only needed for the UPWARD chain from a particular model element class via abstract elements and package.Element to tdom.runtime.TypedElement. They use only the name parameter. (WHY? IS KNOWN STATIC !?!?!) Thus they throw nothing.

         typedConstructor = new Element(NamespaceName)
         untypedConstructor = new Element(W3CDOM)
        

      Further irrelevant GeneratedConstructor-s:
      one in DTDTemplate ("new DTD(MsgRcv)")
      two in DumperTemplate (ContentHandler plus LexicalHandler)

      Most GeneratedConstructor are built when TypedDOMGenerator visits the content models, and must be accessible when "finish" generates API documentation.

                                                     S=shallow D=descending
                                                     | live on C=Container/E=Element Template
                                                     | |  X=ContentModelException
                                                     | |  |  S=AttributeSyntaxExc(iff approp)
                                                     | |  |   M=AttributeMissingExc(iff approp)
                                                     | |  |   AX=AttributeExc iff any Att present
         typedConstructor = new Ele/CP(C1,C2,C3)     S C     SM
         typedConstructorSafe = new Ele/CP(SV,C1,..) S E      M
         untypedConstructor = new Element(w3cDom..)  D C  X   AX
                              new Seq(CntMap..)      D C  X   AX
         parsingConstructor = new Element(CntMap..)  S E  X   AX  INTERNAL ONLY "C"-->FIXME CHECK
         disambigConstructor = new Ele/CP()          S C      M
         disambigConstructorSafe = new Ele(SF)       S C      M
         semiparsingConstructor = new E(SaxAtt,E..)  S E  X  SM
         semiparsingConstructorConstructorShort = new E(E..)    
                                                     S E  X   M
         pcdataOnlyConstructor=new E(String)         S E     SM   (built in TypedDOMGenerator !?)
      
         CntMap=ContentMap  Ele/CP=Element or Choice or Sequence SV=SafeValues-flag
         SaxAtt = SAX.Attributes
      
         ADDITIONAL for the mixed content case there are 
         pcdataEmptyConstructor=new E() = disambigConstructor
         pcdataEmptyConstructorSafe =new E(SV) = disambigConstructorSafe
      
         pcdataOnlyConstructor =new E(String) 
         pcdataOnlyConstructorSafe =new E(SV, String) 
        
      The "..Safe" variants are generated ONLY if there are unsafe attributes.

      The constructors of the generated common "Document" superclass is trivial and invokes the constructors of the runtime class with the DTD class as only argument.
      Some of the constructors in the generated "Document_[XY]" classes initiate parsing:

                                                     S=shallow D=descending
                                                     | 
                                                     |    X=ContentModelException
                                                     |    |  S=AttributeSyntaxExc(iff approp)
                                                     |    |   M=AttributeMissingExc(iff approp)
                                                     |    |   AX=AttributeExc iff any Att present
         typedConstructor = new Doc_[XY](Element)    S         
         untypedConstructor = new Doc_[XY](w3cDom..) D    X   AX
         saxConstructor = new Doc_[XY](SaxStr)       D    X   AX    (SaxStr=SAXEventStream)
         decodeConstructor = new Doc_[XY](JIS)       D    X   AX    (JIS=java.io.InputStream)
        

      The "ContentClass" classes generated for MIXED content get one constructor for each possible element type, and one for pcdata (=String), and one common with the altIndex as parameter.
      (( Additionally there is a "FactoryConstructor" ??? DOCME ))

      Closely related to the constructors are the parse() and decode() methods and their signatures. MORE TO COME DOCME

      ---------------------------------------------------------------

      Generating constructors: (ml 20170727) The DOM and SAX constructors and parsers are not used with fine granularity, so they can follow a global decision: Iff there is any one attribute contained in the DTD, they declare to throw TdomAttributeException.
      typedConstructor, untypedConstructor and disambigConstructor are defined on the super class level, They do ALWAYS exist and are also used for Choice and Sequence.
      The other constructors live only in this code file.
      "untypedConstructor" has parameters: (DOM-element, ext, listener). It is PRIVATE, used by parse(DOM-element...) which is NOT VISIBLE in api doc, but has package scope. The user method for parsing DOM objects is finally DTD.[FIXME].
      "typedConstructor" has parameters: (complete content model copied from "set(..)" method).
      It is public and presented to the user. It does not throw TdomContentException, but possibly TdomAttributeException.
      "semiparsingConstructor" has a optional SAX ATTRIBUTE LIST and a sequence of /Element. It can throw content and attribute exceptions
      "semiparsingConstructorShort" is a shortcut with no sax attribute list.
      "parsingConstructor" has ContentMapping, Extension, Listener. It is INTERNAL ONLY and used by FIXME ASK BT
      "disambigConstructor" is needed iff zero-length content is possible but not necessary, as in case of "MIXED" content. It treats the empty case explcitly. This is necessary because otherwise the empty signature would be ambigious between "typed" and "untyped" and rejected when compiling the applying code.
      pcdataOnlyConstructor convenience constructor accepting one string. (Is built in TypedDOMGenerator)

    • typedConstructorSafe

      @Opt @Opt GeneratedConstructor typedConstructorSafe

      Survey on all GeneratedConstructor-s:

      The constructors in AbstractElementTemplate are nearly parameterless and only needed for the UPWARD chain from a particular model element class via abstract elements and package.Element to tdom.runtime.TypedElement. They use only the name parameter. (WHY? IS KNOWN STATIC !?!?!) Thus they throw nothing.

         typedConstructor = new Element(NamespaceName)
         untypedConstructor = new Element(W3CDOM)
        

      Further irrelevant GeneratedConstructor-s:
      one in DTDTemplate ("new DTD(MsgRcv)")
      two in DumperTemplate (ContentHandler plus LexicalHandler)

      Most GeneratedConstructor are built when TypedDOMGenerator visits the content models, and must be accessible when "finish" generates API documentation.

                                                     S=shallow D=descending
                                                     | live on C=Container/E=Element Template
                                                     | |  X=ContentModelException
                                                     | |  |  S=AttributeSyntaxExc(iff approp)
                                                     | |  |   M=AttributeMissingExc(iff approp)
                                                     | |  |   AX=AttributeExc iff any Att present
         typedConstructor = new Ele/CP(C1,C2,C3)     S C     SM
         typedConstructorSafe = new Ele/CP(SV,C1,..) S E      M
         untypedConstructor = new Element(w3cDom..)  D C  X   AX
                              new Seq(CntMap..)      D C  X   AX
         parsingConstructor = new Element(CntMap..)  S E  X   AX  INTERNAL ONLY "C"-->FIXME CHECK
         disambigConstructor = new Ele/CP()          S C      M
         disambigConstructorSafe = new Ele(SF)       S C      M
         semiparsingConstructor = new E(SaxAtt,E..)  S E  X  SM
         semiparsingConstructorConstructorShort = new E(E..)    
                                                     S E  X   M
         pcdataOnlyConstructor=new E(String)         S E     SM   (built in TypedDOMGenerator !?)
      
         CntMap=ContentMap  Ele/CP=Element or Choice or Sequence SV=SafeValues-flag
         SaxAtt = SAX.Attributes
      
         ADDITIONAL for the mixed content case there are 
         pcdataEmptyConstructor=new E() = disambigConstructor
         pcdataEmptyConstructorSafe =new E(SV) = disambigConstructorSafe
      
         pcdataOnlyConstructor =new E(String) 
         pcdataOnlyConstructorSafe =new E(SV, String) 
        
      The "..Safe" variants are generated ONLY if there are unsafe attributes.

      The constructors of the generated common "Document" superclass is trivial and invokes the constructors of the runtime class with the DTD class as only argument.
      Some of the constructors in the generated "Document_[XY]" classes initiate parsing:

                                                     S=shallow D=descending
                                                     | 
                                                     |    X=ContentModelException
                                                     |    |  S=AttributeSyntaxExc(iff approp)
                                                     |    |   M=AttributeMissingExc(iff approp)
                                                     |    |   AX=AttributeExc iff any Att present
         typedConstructor = new Doc_[XY](Element)    S         
         untypedConstructor = new Doc_[XY](w3cDom..) D    X   AX
         saxConstructor = new Doc_[XY](SaxStr)       D    X   AX    (SaxStr=SAXEventStream)
         decodeConstructor = new Doc_[XY](JIS)       D    X   AX    (JIS=java.io.InputStream)
        

      The "ContentClass" classes generated for MIXED content get one constructor for each possible element type, and one for pcdata (=String), and one common with the altIndex as parameter.
      (( Additionally there is a "FactoryConstructor" ??? DOCME ))

      Closely related to the constructors are the parse() and decode() methods and their signatures. MORE TO COME DOCME

      ---------------------------------------------------------------

      Generating constructors: (ml 20170727) The DOM and SAX constructors and parsers are not used with fine granularity, so they can follow a global decision: Iff there is any one attribute contained in the DTD, they declare to throw TdomAttributeException.
      typedConstructor, untypedConstructor and disambigConstructor are defined on the super class level, They do ALWAYS exist and are also used for Choice and Sequence.
      The other constructors live only in this code file.
      "untypedConstructor" has parameters: (DOM-element, ext, listener). It is PRIVATE, used by parse(DOM-element...) which is NOT VISIBLE in api doc, but has package scope. The user method for parsing DOM objects is finally DTD.[FIXME].
      "typedConstructor" has parameters: (complete content model copied from "set(..)" method).
      It is public and presented to the user. It does not throw TdomContentException, but possibly TdomAttributeException.
      "semiparsingConstructor" has a optional SAX ATTRIBUTE LIST and a sequence of /Element. It can throw content and attribute exceptions
      "semiparsingConstructorShort" is a shortcut with no sax attribute list.
      "parsingConstructor" has ContentMapping, Extension, Listener. It is INTERNAL ONLY and used by FIXME ASK BT
      "disambigConstructor" is needed iff zero-length content is possible but not necessary, as in case of "MIXED" content. It treats the empty case explcitly. This is necessary because otherwise the empty signature would be ambigious between "typed" and "untyped" and rejected when compiling the applying code.
      pcdataOnlyConstructor convenience constructor accepting one string. (Is built in TypedDOMGenerator)

    • contentClass

      MetaType contentClass
    • documentTemplate

      DocumentTemplate documentTemplate
    • idAttribute

      String idAttribute
    • locationClass

      static final MetaType locationClass
    • listOfEthereals

      static final MetaType listOfEthereals
    • initMethodComment

      static final Format initMethodComment
    • initMethod2Comment

      static final Format initMethod2Comment
    • semiparsingConstructorStatements

      final List<Format> semiparsingConstructorStatements
      Accumulator for the generated semi-parser code.
    • requiredAttributes

      final List<String> requiredAttributes
      contains the field names of form attr_[xxx]. Has been filled by TypedAttrsGenerator in "processOneAttDef" by invoking addRequiredAttribute(String).
    • allAttributes

      final Map<String,MetaClass> allAttributes
      Keys are the original dtd name. This info is only needed for documentation text generation. Has been filled by TypedAttrsGenerator in "processOneAttDef" by invoking addAttribute(String,MetaClass).
  • Constructor Details

  • Method Details