Class TypedAttrsGenerator

java.lang.Object
eu.bandm.tools.tdom.TypedAttrsGenerator

class TypedAttrsGenerator extends Object
Is an extraction of all Attribute-related code, only for readability. (All this was originally contained in TypedDOMGenerator.)
  • Field Details

    • setPrivateType

      static final MetaType setPrivateType
    • setSortedType

      static final MetaType setSortedType
  • Constructor Details

  • Method Details

    • prepareCommon

      void prepareCommon(DTD.Dtd dtd)
      Do all analysis needed before the first single element is visited. Results are stored in selectedIntegersAtts, commonAttrs, commonAttlist. Then the latter is processed and source code generated for all common attributes. This fills further commonAttrParentClasses, commonAttrValueClasses, commonAttrSharedOwnerInterfaces, commonAttrSharedClasses, for later usage with the elements' attlists.
    • processOneAttlist

      void processOneAttlist(@Opt DTD.Attlist attlist, @Opt @Opt ElementTemplate elementTemplate)
      Generate source code for all Definitions in one Attlist. Can run in three modes: for the top-level common attributes with elementTemplate==null. Otherwise for an element.
    • processOneAttDef

      void processOneAttDef(DTD.AttDef attDef, @Opt @Opt ElementTemplate elementTemplate)
      Generate source code for one particular Attribute definition. Can run in three modes: for the top-level common attributes with elementTemplate==null. Otherwise this is for an element, either with share==true, use a common attribute, or share==false, create a completely fresh implementation.
    • reAdjustNormalEnum

      @Opt protected @Opt GeneratedField reAdjustNormalEnum(Location<XMLDocumentIdentifier> location, String piKey, GeneratedClass attrClass, GeneratedEnum valuesEnum, DTD.AttType type, boolean hasDefaultValue, DTD.DefaultDecl defaultValue)
      Creates additional source code for EnumerationAttribute-s. This includes the inner enum class for the Value type, a conversion map and access methods. The (already generated) attrClass gets a corrected superclass, namely the runtime class EnumerationAttribute instantiated with the value class.
    • makeSelectedIntegersAttr

      protected GeneratedClass makeSelectedIntegersAttr(Location<XMLDocumentIdentifier> location, @Opt @Opt GeneratedClass elementClass, DTD.AttType type, String name)
      Generates the class which implements an Attribute of the SelectedIntegersAttribute type. (only called from processOneAttDef(eu.bandm.tools.dtd.DTD.AttDef,@eu.bandm.tools.annotations.Opt eu.bandm.tools.tdom.ElementTemplate) and could be inlined. Extracted for readability only.)