Class TypedElement.MixedContent<E extends TypedElement<E,X>,X extends TypedExtension>

java.lang.Object
eu.bandm.tools.tdom.runtime.TypedElement.MixedContent<E,X>
All Implemented Interfaces:
TypedContent
Direct Known Subclasses:
Element_a_blink.Content, Element_a_bold.Content, Element_a_emph.Content, Element_a_footnote.Content, Element_a_footnotetext.Content, Element_a_indexhi.Content, Element_a_indexlo.Content, Element_a_ital.Content, Element_a_larger.Content, Element_a_listitem.Content, Element_a_p.Content, Element_a_scaps.Content, Element_a_smaller.Content, Element_a_spanstyle.Content, Element_a_src.Content, Element_a_SRC.Content, Element_a_strikeout.Content, Element_a_td.Content, Element_a_text.Content, Element_a_th.Content, Element_a_ulin.Content, Element_a_xemph.Content, Element_a_xlang.Content, Element_a.Content, Element_abbr.Content, Element_acronym.Content, Element_address.Content, Element_b.Content, Element_bdo.Content, Element_big.Content, Element_button.Content, Element_caption.Content, Element_cite.Content, Element_code.Content, Element_dd.Content, Element_del.Content, Element_desc.Content, Element_dfn.Content, Element_div.Content, Element_dt.Content, Element_em.Content, Element_fieldset.Content, Element_h1.Content, Element_h2.Content, Element_h3.Content, Element_h4.Content, Element_h5.Content, Element_h6.Content, Element_i.Content, Element_ins.Content, Element_kbd.Content, Element_label.Content, Element_legend.Content, Element_li.Content, Element_object.Content, Element_p.Content, Element_pre.Content, Element_q.Content, Element_samp.Content, Element_small.Content, Element_span.Content, Element_strong.Content, Element_sub.Content, Element_sup.Content, Element_td.Content, Element_th.Content, Element_tt.Content, Element_var.Content, TypedElement.UnmixedContent
Enclosing class:
TypedElement<E extends TypedElement<E,X>,X extends TypedExtension>

public abstract static class TypedElement.MixedContent<E extends TypedElement<E,X>,X extends TypedExtension> extends Object implements TypedContent
Base class for all generated classes which model "mixed contents" or "unmixed contents". This corresponds to the content models "<!ELEMENT e (#PCDATA) >" and "<!ELEMENT e (#PCDATA | x | y | z)* >".
For every element and every alternative in this choice, a subclass of this is generated. (In case of #PCDATA only, all elements share one single class generated as "Element.UnmixedContent").
This classes work as "wrappers" around the classes which represent the elements appearing in this alternative. This is necessary since Java does not support "type sums". (Indeed, all these classes, and those derived from TypedChoice, etc., are only needed to realize these "sums of types" in a type-safe way !-)
ATTENTION "implements Visitable<..>" and "implements Matchable<..>" are added not here, but in generated code, since they are specific for the generated base classes.
  • Field Details

  • Constructor Details

    • MixedContent

      public MixedContent(String pcdata)
      Creates the variant corresponding to the "#PCDATA" in the content model.
    • MixedContent

      public MixedContent(TypedPCData pcdata)
      Creates the variant corresponding to the "#PCDATA" in the content model.
    • MixedContent

      protected MixedContent(int altIndex, E element)
  • Method Details

    • getContent

      public TypedSubstantial<X> getContent()
    • getAltCount

      public abstract int getAltCount()
      Returns the number of different variants, NOT including "#PCDATA" in the content model.
      Returns:
      the number of different variants, NOT including "#PCDATA".
    • getAltIndex

      public final int getAltIndex()
    • isPCData

      public final boolean isPCData()
      Returns whether this is the "#PCDATA" variant.
      Returns:
      whether this is the "#PCDATA" variant.
    • toPCData

      @Opt public final @Opt TypedPCData toPCData()
      Returns the unwrapped PCDATA content, or null if it is not this variant.
      Returns:
      the unwrapped PCDATA content, or null if it is not this variant.
    • encode

      public final void encode(EncodingOutputStream out, X ext) throws IOException
      Throws:
      IOException