Package eu.bandm.tools.tdom.runtime
Class TypedNode<X extends TypedExtension>
java.lang.Object
eu.bandm.tools.tdom.runtime.TypedNode<X>
- Direct Known Subclasses:
TypedAttribute
,TypedDocument
,TypedEthereal
,TypedSubstantial
,TypedSubtree
Fundamental superclass for all classes which implement tdom components.
Additionally contains some static retrieval methods.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
TypedNode.ParseListener<E extends TypedElement<?,
?>> Listener interface which may be registered with the tdom generated parsing code and will be called after each successful parsing step. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Opt BigDecimal
Returns the value of its argument as a decimal encoded BigDecimal value.static @Opt BigDecimal
Returns the value of its argument as a decimal encoded BigDecimal value.static @Opt BigDecimal
Returns the value of its argument as a decimal encoded BigDecimal value.static @Opt BigDecimal
Returns the contents of its argument as a decimal encoded BigDecimal value.static @Opt BigInteger
Returns the value of its argument as a decimal encoded BigInteger value.static @Opt BigInteger
Returns the value of its argument as a decimal encoded BigInteger value.static @Opt BigInteger
Returns the value of its argument as a decimal encoded BigInteger value.static @Opt BigInteger
Returns the contents of its argument as a decimal encoded BigInteger value.static <V extends Enum<V> & EnumerationValue>
booleanasBoolean
(EnumerationAttribute<V> att, V value) Returns whether the contents of an attribute is equal to one particular typed attribute value.static <V> boolean
asBoolean
(TypedAttribute<String> att, String value) asDouble
(@Opt CDataAttribute att) Returns the value of its argument as a decimal encoded double value.asDouble
(@Opt NmTokenAttribute att) Returns the value of its argument as a decimal encoded double value.Returns the value of its argument as a decimal encoded double value.Returns the contents of its argument as a decimal encoded double value.asFloat
(@Opt CDataAttribute att) Returns the value of its argument as a decimal encoded float value.asFloat
(@Opt NmTokenAttribute att) Returns the value of its argument as a decimal encoded float value.Returns the value of its argument as a decimal encoded float value.Returns the contents of its argument as a decimal encoded float value.asHexInt
(@Opt CDataAttribute att) Returns the value of its argument as a hexdecimal encoded integer value.asHexInt
(@Opt NmTokenAttribute att) Returns the value of its argument as a hexdecimal encoded integer value.Returns the value of its argument as a hexdecimal encoded integer value.Returns the contents of its argument as a hexdecimal encoded integer value.asInt
(@Opt CDataAttribute att) Returns the value of its argument as a decimal encoded integer value.asInt
(@Opt NmTokenAttribute att) Returns the value of its argument as a decimal encoded integer value.Returns the value of its argument as a decimal encoded integer value.Returns the contents of its argument as a decimal encoded integer value.asLong
(@Opt CDataAttribute att) Returns the value of its argument as a decimal encoded long value.asLong
(@Opt NmTokenAttribute att) Returns the value of its argument as a decimal encoded long value.Returns the value of its argument as a decimal encoded long value.Returns the contents of its argument as a decimal encoded long value.Returns the contents of its argument as a trimmed string.Returns the contents of its argument as a trimmed string.Returns its argument as a trimmed string.static String
Returns the contents of its argument as a trimmed string.protected static <T> CheckedListPlus<T>
checkPlus
(String name, CheckedListPlus<T> arg) protected static <T> T[]
(internal use only) bttodoprotected static <T> CheckedList<T>
checkStar
(String name, CheckedList<T> arg) protected static <T> T[]
protected static <T> T
checkStrict
(String name, T arg) void
encode
(boolean asAbstract, EncodingOutputStream out, X ext) abstract void
encode
(EncodingOutputStream out, X ext) Abstract fall-back method which MUST be overridden and always throws an Exception.protected static <E extends TypedExtension>
voidencodeOptional
(boolean asAbstract, TypedNode<E> node, EncodingOutputStream out, E ext) protected static <E extends TypedExtension>
voidencodePlus
(boolean asAbstract, CheckedListPlus<? extends TypedNode<E>> nodes, EncodingOutputStream out, E ext) protected static <E extends TypedExtension>
voidencodePlus
(boolean asAbstract, TypedNode<E>[] nodes, EncodingOutputStream out, E ext) protected static <E extends TypedExtension>
voidencodeStar
(boolean asAbstract, TypedNode<E>[] nodes, EncodingOutputStream out, E ext) protected static <E extends TypedExtension>
voidencodeStar
(boolean asAbstract, CheckedList<? extends TypedNode<E>> nodes, EncodingOutputStream out, E ext) protected static List<TypedEthereal>
final @Opt Location<XMLDocumentIdentifier>
Return the location in the original text document.protected static String
Gets the pc data content of a W3C DOM.final void
Set the location information.final void
setLocation
(@Opt Location<XMLDocumentIdentifier> location) Set the location information.protected final void
setLocation
(@Opt Location<XMLDocumentIdentifier> begin, @Opt Location<XMLDocumentIdentifier> end) Set the location information to an interval, if both limits are not null.
-
Constructor Details
-
TypedNode
protected TypedNode()
-
-
Method Details
-
getLocation
Return the location in the original text document.- Returns:
- (maybe null) the location, if known.
-
setLocation
Set the location information.- Parameters:
location
- (maybe null) the new location. Old location is overwritten, even wehn param is null.
-
setLocation
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. SeeLocation.region(Location,Location)
for details of error processing, etc.- Parameters:
begin
- begin of location regionend
- 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
-
asTrimmedString
Returns the contents of its argument as a trimmed string. The interfaceTypedElement.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
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
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
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 interfaceTypedElement.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
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
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
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
Returns the contents of its argument as a decimal encoded long value. The interfaceTypedElement.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
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
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
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
Returns the contents of its argument as a decimal encoded float value. The interfaceTypedElement.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
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
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
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
Returns the contents of its argument as a decimal encoded double value. The interfaceTypedElement.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
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
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
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
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 interfaceTypedElement.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
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
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
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
Returns the contents of its argument as a decimal encoded BigInteger value. The interfaceTypedElement.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
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
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
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
Returns the contents of its argument as a decimal encoded BigDecimal value. The interfaceTypedElement.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
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
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
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
Gets the pc data content of a W3C DOM. (IS NOT TDOM RELATED, aber HIER? FIXME ) -
extractEthereals
-
encode
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
- Throws:
IOException
-
checkStrict
-
checkStar
-
checkStar
-
checkPlus
(internal use only) bttodo -
checkPlus
-