Class TypedNode<X extends TypedExtension>

java.lang.Object
eu.bandm.tools.tdom.runtime.TypedNode<X>
Direct Known Subclasses:
TypedAttribute, TypedDocument, TypedEthereal, TypedSubstantial, TypedSubtree

public abstract class TypedNode<X extends TypedExtension> extends Object
Fundamental superclass for all classes which implement tdom components. Additionally contains some static retrieval methods.
  • Constructor Details

    • TypedNode

      protected TypedNode()
  • Method Details

    • getLocation

      @Opt public final @Opt Location<XMLDocumentIdentifier> getLocation()
      Return the location in the original text document.
      Returns:
      (maybe null) the location, if known.
    • setLocation

      public final void setLocation(@Opt @Opt Location<XMLDocumentIdentifier> location)
      Set the location information.
      Parameters:
      location - (maybe null) the new location. Old location is overwritten, even wehn param is null.
    • setLocation

      public final void setLocation(@Opt @Opt Locatable<XMLDocumentIdentifier> loc)
      Set the location information.
      Parameters:
      loc - (maybe null) the new location.
    • setLocation

      protected final void setLocation(@Opt @Opt Location<XMLDocumentIdentifier> begin, @Opt @Opt Location<XMLDocumentIdentifier> end)
      Set the location information to an interval, if both limits are not null. Otherwise to one of them which is not null, otherwise to null. Is called from generated code, operating on unknown SAX event sources, therefore incomplete location info may arrive here. See Location.region(Location,Location) for details of error processing, etc.
      Parameters:
      begin - begin of location region
      end - end of location region
    • asBoolean

      public static <V extends Enum<V> & EnumerationValue> boolean asBoolean(EnumerationAttribute<V> att, V value)
      Returns whether the contents of an attribute is equal to one particular typed attribute value. This can be used to decode false/true information, as in
         ----option.dtd:----
               hexadecimalIntegers (yes|no) 'yes'
         ----Compiler.java:---
         if (asBoolean(data0.readAttr_fragmentedLists(),
                       Element_optionlist.Attr_fragmentedLists.Value.Value_yes))...
        
    • asBoolean

      public static <V> boolean asBoolean(TypedAttribute<String> att, String value)
    • asTrimmedString

      public static String asTrimmedString(TypedElement.PCDataContainer el)
      Returns the contents of its argument as a trimmed string. The interface TypedElement.PCDataContainer is added to each generated model class if it represents an element with a content model which contains "PCDATA".
      Parameters:
      el - (maybe null) a model element which contains PCDATA.
      Returns:
      the string value, the concatenation of all PCDATA directly contained in the elemnt. Is ==null in case of null input or empty string.
    • asTrimmedString

      @Opt public static @Opt String asTrimmedString(@Opt @Opt NmTokenAttribute att)
      Returns the contents of its argument as a trimmed string.
      Parameters:
      att - (maybe null) an attribute object.
      Returns:
      the string value, ==null in case of null input or empty string.
    • asTrimmedString

      @Opt public static @Opt String asTrimmedString(@Opt @Opt CDataAttribute att)
      Returns the contents of its argument as a trimmed string.
      Parameters:
      att - (maybe null) an attribute object.
      Returns:
      the string value, ==null in case of null input or empty string.
    • asTrimmedString

      @Opt public static @Opt String asTrimmedString(@Opt @Opt String s)
      Returns its argument as a trimmed string.
      Parameters:
      s - (maybe null) input string.
      Returns:
      the string value, ==null in case of null input or empty string.
    • asInt

      Returns the contents of its argument as a decimal encoded integer value. The interface TypedElement.PCDataContainer is added to each generated model class if it represents an element with a content model which contains "PCDATA".
      Returns:
      the Integer value, ==null in case of null input or empty string input or conversion error.
    • asInt

      @Opt public static @Opt Integer asInt(@Opt @Opt NmTokenAttribute att)
      Returns the value of its argument as a decimal encoded integer value.
      Returns:
      the Integer value, ==null in case of null input or empty string input or conversion error.
    • asInt

      @Opt public static @Opt Integer asInt(@Opt @Opt CDataAttribute att)
      Returns the value of its argument as a decimal encoded integer value.
      Returns:
      the Integer value, ==null in case of null input or empty string input or conversion error.
    • asInt

      @Opt public static @Opt Integer asInt(@Opt @Opt String s)
      Returns the value of its argument as a decimal encoded integer value.
      Returns:
      the Integer value, ==null in case of null input or empty string input or conversion error.
    • asLong

      @Opt public static @Opt Long asLong(TypedElement.PCDataContainer el)
      Returns the contents of its argument as a decimal encoded long value. The interface TypedElement.PCDataContainer is added to each generated model class if it represents an element with a content model which contains "PCDATA".
      Returns:
      the Long value, ==null in case of null input or empty string input or conversion error.
    • asLong

      @Opt public static @Opt Long asLong(@Opt @Opt NmTokenAttribute att)
      Returns the value of its argument as a decimal encoded long value.
      Returns:
      the Long value, ==null in case of null input or empty string input or conversion error.
    • asLong

      @Opt public static @Opt Long asLong(@Opt @Opt CDataAttribute att)
      Returns the value of its argument as a decimal encoded long value.
      Returns:
      the Long value, ==null in case of null input or empty string input or conversion error.
    • asLong

      @Opt public static @Opt Long asLong(@Opt @Opt String s)
      Returns the value of its argument as a decimal encoded long value.
      Returns:
      the Long value, ==null in case of null input or empty string input or conversion error.
    • asFloat

      @Opt public static @Opt Float asFloat(@Opt TypedElement.PCDataContainer el)
      Returns the contents of its argument as a decimal encoded float value. The interface TypedElement.PCDataContainer is added to each generated model class if it represents an element with a content model which contains "PCDATA".
      Returns:
      the Float value, ==null in case of null input or empty string input or conversion error.
    • asFloat

      @Opt public static @Opt Float asFloat(@Opt @Opt NmTokenAttribute att)
      Returns the value of its argument as a decimal encoded float value.
      Returns:
      the Float value, ==null in case of null input or empty string input or conversion error.
    • asFloat

      @Opt public static @Opt Float asFloat(@Opt @Opt CDataAttribute att)
      Returns the value of its argument as a decimal encoded float value.
      Returns:
      the Float value, ==null in case of null input or empty string input or conversion error.
    • asFloat

      @Opt public static @Opt Float asFloat(@Opt @Opt String s)
      Returns the value of its argument as a decimal encoded float value.
      Returns:
      the Float value, ==null in case of null input or empty string input or conversion error.
    • asDouble

      @Opt public static @Opt Double asDouble(TypedElement.PCDataContainer el)
      Returns the contents of its argument as a decimal encoded double value. The interface TypedElement.PCDataContainer is added to each generated model class if it represents an element with a content model which contains "PCDATA".
      Returns:
      the Double value, ==null in case of null input or empty string input or conversion error.
    • asDouble

      @Opt public static @Opt Double asDouble(@Opt @Opt NmTokenAttribute att)
      Returns the value of its argument as a decimal encoded double value.
      Returns:
      the Double value, ==null in case of null input or empty string input or conversion error.
    • asDouble

      @Opt public static @Opt Double asDouble(@Opt @Opt CDataAttribute att)
      Returns the value of its argument as a decimal encoded double value.
      Returns:
      the Double value, ==null in case of null input or empty string input or conversion error.
    • asDouble

      @Opt public static @Opt Double asDouble(@Opt @Opt String s)
      Returns the value of its argument as a decimal encoded double value.
      Returns:
      the Double value, ==null in case of null input or empty string input or conversion error.
    • asHexInt

      @Opt public static @Opt Integer asHexInt(@Opt TypedElement.PCDataContainer el)
      Returns the contents of its argument as a hexdecimal encoded integer value. A prefix "0x" or "0X" MAY be present and is discarded, but is not required. The interface TypedElement.PCDataContainer is added to each generated model class if it represents an element with a content model which contains "PCDATA".
      Returns:
      the Integer value, ==null in case of null input or empty string input or conversion error.
    • asHexInt

      @Opt public static @Opt Integer asHexInt(@Opt @Opt NmTokenAttribute att)
      Returns the value of its argument as a hexdecimal encoded integer value. A prefix "0x" or "0X" MAY be present and is discarded, but is not required.
      Returns:
      the Integer value, ==null in case of null input or empty string input or conversion error.
    • asHexInt

      @Opt public static @Opt Integer asHexInt(@Opt @Opt CDataAttribute att)
      Returns the value of its argument as a hexdecimal encoded integer value. A prefix "0x" or "0X" MAY be present and is discarded, but is not required.
      Returns:
      the Integer value, ==null in case of null input or empty string input or conversion error.
    • asHexInt

      @Opt public static @Opt Integer asHexInt(@Opt @Opt String s)
      Returns the value of its argument as a hexdecimal encoded integer value. A prefix "0x" or "0X" MAY be present and is discarded, but is not required.
      Returns:
      the Integer value, ==null in case of null input or empty string input or conversion error.
    • asBigInteger

      @Opt public static @Opt BigInteger asBigInteger(TypedElement.PCDataContainer el)
      Returns the contents of its argument as a decimal encoded BigInteger value. The interface TypedElement.PCDataContainer is added to each generated model class if it represents an element with a content model which contains "PCDATA".
      Returns:
      the BigInteger value, ==null in case of null input or empty string input or conversion error.
    • asBigInteger

      @Opt public static @Opt BigInteger asBigInteger(@Opt @Opt NmTokenAttribute att)
      Returns the value of its argument as a decimal encoded BigInteger value.
      Returns:
      the BigInteger value, ==null in case of null input or empty string input or conversion error.
    • asBigInteger

      @Opt public static @Opt BigInteger asBigInteger(@Opt @Opt CDataAttribute att)
      Returns the value of its argument as a decimal encoded BigInteger value.
      Returns:
      the BigInteger value, ==null in case of null input or empty string input or conversion error.
    • asBigInteger

      @Opt public static @Opt BigInteger asBigInteger(@Opt @Opt String s)
      Returns the value of its argument as a decimal encoded BigInteger value.
      Returns:
      the BigInteger value, ==null in case of null input or empty string input or conversion error.
    • asBigDecimal

      @Opt public static @Opt BigDecimal asBigDecimal(TypedElement.PCDataContainer el)
      Returns the contents of its argument as a decimal encoded BigDecimal value. The interface TypedElement.PCDataContainer is added to each generated model class if it represents an element with a content model which contains "PCDATA".
      Returns:
      the BigDecimal value, ==null in case of null input or empty string input or conversion error.
    • asBigDecimal

      @Opt public static @Opt BigDecimal asBigDecimal(@Opt @Opt NmTokenAttribute att)
      Returns the value of its argument as a decimal encoded BigDecimal value.
      Returns:
      the BigDecimal value, ==null in case of null input or empty string input or conversion error.
    • asBigDecimal

      @Opt public static @Opt BigDecimal asBigDecimal(@Opt @Opt CDataAttribute att)
      Returns the value of its argument as a decimal encoded BigDecimal value.
      Returns:
      the BigDecimal value, ==null in case of null input or empty string input or conversion error.
    • asBigDecimal

      @Opt public static @Opt BigDecimal asBigDecimal(@Opt @Opt String s)
      Returns the value of its argument as a decimal encoded BigDecimal value.
      Returns:
      the BigDecimal value, ==null in case of null input or empty string input or conversion error.
    • getPCData

      protected static String getPCData(NodeList nodes)
      Gets the pc data content of a W3C DOM. (IS NOT TDOM RELATED, aber HIER? FIXME )
    • extractEthereals

      protected static List<TypedEthereal> extractEthereals(SAXEventStream sev)
    • encode

      public abstract void encode(EncodingOutputStream out, X ext) throws IOException
      Abstract fall-back method which MUST be overridden and always throws an Exception.
      Throws:
      IOException
    • encodeOptional

      protected static <E extends TypedExtension> void encodeOptional(boolean asAbstract, TypedNode<E> node, EncodingOutputStream out, E ext) throws IOException
      Throws:
      IOException
    • encodeStar

      protected static <E extends TypedExtension> void encodeStar(boolean asAbstract, TypedNode<E>[] nodes, EncodingOutputStream out, E ext) throws IOException
      Throws:
      IOException
    • encodeStar

      protected static <E extends TypedExtension> void encodeStar(boolean asAbstract, CheckedList<? extends TypedNode<E>> nodes, EncodingOutputStream out, E ext) throws IOException
      Throws:
      IOException
    • encodePlus

      protected static <E extends TypedExtension> void encodePlus(boolean asAbstract, TypedNode<E>[] nodes, EncodingOutputStream out, E ext) throws IOException
      Throws:
      IOException
    • encodePlus

      protected static <E extends TypedExtension> void encodePlus(boolean asAbstract, CheckedListPlus<? extends TypedNode<E>> nodes, EncodingOutputStream out, E ext) throws IOException
      Throws:
      IOException
    • encode

      public void encode(boolean asAbstract, EncodingOutputStream out, X ext) throws IOException
      Throws:
      IOException
    • checkStrict

      protected static <T> T checkStrict(String name, T arg)
    • checkStar

      protected static <T> T[] checkStar(String name, T[] arg)
    • checkStar

      protected static <T> CheckedList<T> checkStar(String name, CheckedList<T> arg)
    • checkPlus

      protected static <T> T[] checkPlus(String name, T[] arg)
      (internal use only) bttodo
    • checkPlus

      protected static <T> CheckedListPlus<T> checkPlus(String name, CheckedListPlus<T> arg)