Package eu.bandm.tools.tdom.runtime
Class TypedElement<E extends TypedElement<E,X>,X extends TypedExtension>
java.lang.Object
eu.bandm.tools.tdom.runtime.TypedNode<X>
eu.bandm.tools.tdom.runtime.TypedSubstantial<X>
eu.bandm.tools.tdom.runtime.TypedElement<E,X>
- All Implemented Interfaces:
Locatable<XMLDocumentIdentifier>
,TypedContent
public abstract class TypedElement<E extends TypedElement<E,X>,X extends TypedExtension>
extends TypedSubstantial<X>
implements TypedContent, Locatable<XMLDocumentIdentifier>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
TypedElement.MixedContent<E extends TypedElement<E,
X>, X extends TypedExtension> Base class for all generated classes which model "mixed contents" or "unmixed contents".static interface
Implemented by all Element types which include PCDATA and other elements.static class
TypedElement.MixedContentFactory<C extends TypedElement.MixedContent<E,
X>, E extends TypedElement<E, X>, X extends TypedExtension, Y extends Exception> static interface
Implemented by all Element types which include PCDATA.static class
TypedElement.UnmixedContent<E extends TypedElement<E,
X>, X extends TypedExtension> Content class in case that only PCData is contained, can be reused between models and instances.Nested classes/interfaces inherited from class eu.bandm.tools.tdom.runtime.TypedNode
TypedNode.ParseListener<E extends TypedElement<?,
?>> Nested classes/interfaces inherited from interface eu.bandm.tools.tdom.runtime.TypedContent
TypedContent.DecodingConstructor<C extends TypedContent,
X extends TypedExtension, Y extends Exception>, TypedContent.ParsingConstructor<C extends TypedContent, E extends TypedElement<E, X>, X extends TypedExtension, Y extends Exception> -
Field Summary
Modifier and TypeFieldDescriptionstatic final Function<TypedElement,
String> static final Function<TypedElement.MixedContentContainer,
String> protected final NamespaceName
-
Constructor Summary
ModifierConstructorDescriptionprotected
TypedElement
(NamespaceName name) protected
TypedElement
(String name) Deprecated.protected
TypedElement
(Element domElement) -
Method Summary
Modifier and TypeMethodDescriptionabstract void
__dumpElementSnapshot
(List<TypedSubstantial<X>> list) protected TypedAttribute[]
protected static @Opt NamespaceName
protected static <C extends TypedElement.MixedContent<E,
X>, E extends TypedElement<E, X>, X extends TypedExtension, Y extends Exception>
C[]decodeMixed
(TypedElement.MixedContentFactory<C, E, X, Y> factory, DecodingInputStream in, X ext, Class<? extends C> contentClass, int max) static <C extends TypedContent,
E extends TypedExtension, Y extends Exception>
CdecodeOptional
(TypedContent.DecodingConstructor<C, E, Y> constructor, DecodingInputStream in, E ext) static <C extends TypedContent,
E extends TypedExtension, Y extends Exception>
C[]decodePlus
(TypedContent.DecodingConstructor<? extends C, E, Y> constructor, DecodingInputStream in, E ext, Class<C> contentClass) static <C extends TypedContent,
E extends TypedExtension, Y extends Exception>
CheckedListPlus<C>decodePlusList
(TypedContent.DecodingConstructor<? extends C, E, Y> constructor, DecodingInputStream in, E ext, Class<C> contentClass) static <C extends TypedContent,
E extends TypedExtension, Y extends Exception>
C[]decodeStar
(TypedContent.DecodingConstructor<? extends C, E, Y> constructor, DecodingInputStream in, E ext, Class<C> contentClass) static <C extends TypedContent,
E extends TypedExtension, Y extends Exception>
CheckedList<C>decodeStarList
(TypedContent.DecodingConstructor<? extends C, E, Y> constructor, DecodingInputStream in, E ext, Class<C> contentClass) final void
encode
(boolean asAbstract, EncodingOutputStream out, X ext) protected static <E extends TypedExtension>
voidencodeMixed
(EncodingOutputStream out, E ext, int count, Iterator<? extends TypedElement.MixedContent<?, E>> i) void
end
(ContentHandler contentHandler, LexicalHandler lexicalHandler) protected static void
ensureSize
(List<?> list, int size) protected static Element
extractElement
(ContentMapping content) CallgetAttrsSnapshot(boolean)
in validating mode.getAttrsSnapshot
(boolean validating) abstract String
Collect and concatenate all PCData, directly or indirectly contained in this model component (mostly: an Element).Gives access to the Comments and PIs after the opening tag and before the close tag.final String
Return the local part of the namespace name from this element's tag definition.final NamespaceName
getName()
Return the NamespaceName.final String
Return the URI part of the namespace name from this element's tag definition.protected static String
abstract int
final String
Return the name as it was written in the original dtd.protected void
initAttrs
(@Opt Location<XMLDocumentIdentifier> from, @Opt Location<XMLDocumentIdentifier> to, Attributes attrs) Will be called by generated code.protected void
initAttrs
(Attributes attrs) Will be overridden by generated code which picks attribute values.protected void
initAttrsSafe
(@Opt Location<XMLDocumentIdentifier> from, @Opt Location<XMLDocumentIdentifier> to, Attributes attrs) Will be called by generated code if notTdomAttributeSyntaxException
can arise when parsing the attributes.static void
matchEndElement
(SAXEventStream in, NamespaceName name) static void
matchEndElement
(SAXEventStream in, String tag) static Attributes
matchStartElement
(SAXEventStream in, NamespaceName name) static Attributes
matchStartElement
(SAXEventStream in, String tag) protected static <E extends TypedElement<E,
X>, X extends TypedExtension, Y extends Exception>
TypedContentparseAbstract
(TypedDTD dtd, X ext, TypedNode.ParseListener<E> listener, Map<? super String, ? extends TypedContent.ParsingConstructor<?, E, X, Y>> subclassTable, Element elem) protected static <C extends TypedContent>
CparseAndClose
(C content, SAXEventStream in, boolean explicit, String tagName) protected static <C extends TypedContent>
CparseAndClose
(C content, SAXEventStream in, String tagName) Backwards compatibility definition.protected static <E extends TypedElement<E,
X>, X extends TypedExtension, Y extends Exception>
TypedElement.MixedContent[]parseMixed
(TypedElement.MixedContentFactory<?, E, X, Y> factory, SAXEventStream in, X ext, TypedNode.ParseListener<E> listener, TypedElement.MixedContent... array) protected static <C extends TypedElement.MixedContent<E,
X>, E extends TypedElement<E, X>, X extends TypedExtension, Y extends Exception>
voidparseMixed
(TypedElement.MixedContentFactory<C, E, X, Y> factory, X ext, TypedNode.ParseListener<E> listener, Element domElement, List<? super C> l) static <C extends TypedContent,
E extends TypedElement<E, X>, X extends TypedExtension, Y extends Exception>
CparseOptional
(TypedContent.ParsingConstructor<C, E, X, Y> constructor, ContentMapping content, X ext, TypedNode.ParseListener<E> listener) static <C extends TypedContent,
E extends TypedElement<E, X>, X extends TypedExtension, Y extends Exception>
C[]parsePlus
(TypedContent.ParsingConstructor<? extends C, E, X, Y> constructor, ContentMapping content, X ext, TypedNode.ParseListener<E> listener, Class<C> contentClass) DOCME ML ist das nur für w3cDom ??? und OHNE attribute ??? DANN nur TdomContentException !!static <C extends TypedContent,
E extends TypedElement<E, X>, X extends TypedExtension, Y extends Exception>
CheckedListPlus<C>parsePlusList
(TypedContent.ParsingConstructor<? extends C, E, X, Y> constructor, ContentMapping content, X ext, TypedNode.ParseListener<E> listener, Class<C> contentClass) static <C extends TypedContent,
E extends TypedElement<E, X>, X extends TypedExtension, Y extends Exception>
C[]parseStar
(TypedContent.ParsingConstructor<? extends C, E, X, Y> constructor, ContentMapping content, X ext, TypedNode.ParseListener<E> listener, Class<C> contentClass) static <C extends TypedContent,
E extends TypedElement<E, X>, X extends TypedExtension, Y extends Exception>
CheckedList<C>parseStarList
(TypedContent.ParsingConstructor<? extends C, E, X, Y> constructor, ContentMapping content, X ext, TypedNode.ParseListener<E> listener, Class<C> contentClass) protected static void
semiparseEmpty
(TypedSubstantial<?>... content) protected static <C extends TypedElement.MixedContent<E,
X>, E extends TypedElement<E, X>, X extends TypedExtension>
voidsemiparseMixed
(TypedElement.MixedContentFactory<C, E, X, ?> factory, TypedSubstantial[] nodes, List<? super C> l) protected static <A> void
setResizing
(List<? super A> list, int index, A elem) void
start
(ContentHandler contentHandler, LexicalHandler lexicalHandler, Attributes attributes) static NamespaceName
w3c_getNamespaceName
(Node node) Methods inherited from class eu.bandm.tools.tdom.runtime.TypedSubstantial
dumpFollowingEthereals, dumpPrecedingEthereals, getFollowingEthereals, getPrecedingEthereals, readFollowingEthereals, readPrecedingEthereals
Methods inherited from class eu.bandm.tools.tdom.runtime.TypedNode
asBigDecimal, asBigDecimal, asBigDecimal, asBigDecimal, asBigInteger, asBigInteger, asBigInteger, asBigInteger, asBoolean, asBoolean, asDouble, asDouble, asDouble, asDouble, asFloat, asFloat, asFloat, asFloat, asHexInt, asHexInt, asHexInt, asHexInt, asInt, asInt, asInt, asInt, asLong, asLong, asLong, asLong, asTrimmedString, asTrimmedString, asTrimmedString, asTrimmedString, checkPlus, checkPlus, checkStar, checkStar, checkStrict, encode, encodeOptional, encodePlus, encodePlus, encodeStar, encodeStar, extractEthereals, getLocation, getPCData, setLocation, setLocation, setLocation
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.bandm.tools.location.Locatable
getLocation
-
Field Details
-
name
-
getFlatPCData
-
getDeepPCData
-
-
Constructor Details
-
TypedElement
Deprecated. -
TypedElement
-
TypedElement
-
-
Method Details
-
getEtherealContainer
Gives access to the Comments and PIs after the opening tag and before the close tag.- Returns:
- (never null) access to the Comments and PIs after the opening tag and before the close tag.
-
initAttrs
Will be overridden by generated code which picks attribute values. This default code simply does nothing, e.g. ignores the Attributes object and is sufficient for all Elements which do not carry Attributes.- Throws:
TdomAttributeSyntaxException
-
initAttrs
protected void initAttrs(@Opt @Opt Location<XMLDocumentIdentifier> from, @Opt @Opt Location<XMLDocumentIdentifier> to, Attributes attrs) throws TdomAttributeSyntaxException Will be called by generated code. Sets the location of the Element before invoking the generated code, which steps through the different Attributes. This is necessary for error messaging.- Throws:
TdomAttributeSyntaxException
-
initAttrsSafe
protected void initAttrsSafe(@Opt @Opt Location<XMLDocumentIdentifier> from, @Opt @Opt Location<XMLDocumentIdentifier> to, Attributes attrs) Will be called by generated code if notTdomAttributeSyntaxException
can arise when parsing the attributes. Sets the location of the Element before invoking the generated code, which steps through the different Attributes. This is necessary for error messaging. -
getTagName
Return the name as it was written in the original dtd. If the generation was NOT in namespace mode, then this name is a simple arbitrary identifier. The tdom application has been in namespace mode if ProcessingInstructions like "<? tdom xmlns:X='Y' ?>
" have been present in the DTD source. Then there must be at most one(1) colon character ":
" in the name, and it must be preceded by a prefix which appears in such a namespace declaration. -
getNamespaceURI
Return the URI part of the namespace name from this element's tag definition. If not in namespace mode (seegetTagName()
), it will be the empty string. See the documentation ofNamespaceName
for the different cases.- Returns:
- (never null) the URI string of the namespace definition.
-
getLocalName
Return the local part of the namespace name from this element's tag definition. If not in namespace mode, this will be identic withgetTagName()
. Otherwise it is the part after the colon.- Returns:
- (never null) the local string of the
NamespaceName
, in either mode.
-
getName
Return the NamespaceName. This class models names in both modes, namespace mode or non-namespace mode.- Returns:
- (never null) the NamspaceName, in either mode.
-
getTagIndex
public abstract int getTagIndex() -
extractElement
-
parseOptional
public static <C extends TypedContent,E extends TypedElement<E, C parseOptionalX>, X extends TypedExtension, Y extends Exception> (TypedContent.ParsingConstructor<C, E, throws TdomContentException, YX, Y> constructor, ContentMapping content, X ext, TypedNode.ParseListener<E> listener) - Throws:
TdomContentException
Y extends Exception
-
parseStar
public static <C extends TypedContent,E extends TypedElement<E, C[] parseStarX>, X extends TypedExtension, Y extends Exception> (TypedContent.ParsingConstructor<? extends C, E, throws TdomContentException, YX, Y> constructor, ContentMapping content, X ext, TypedNode.ParseListener<E> listener, Class<C> contentClass) - Throws:
TdomContentException
Y extends Exception
-
parseStarList
public static <C extends TypedContent,E extends TypedElement<E, CheckedList<C> parseStarListX>, X extends TypedExtension, Y extends Exception> (TypedContent.ParsingConstructor<? extends C, E, throws TdomContentException, YX, Y> constructor, ContentMapping content, X ext, TypedNode.ParseListener<E> listener, Class<C> contentClass) - Throws:
TdomContentException
Y extends Exception
-
parsePlus
public static <C extends TypedContent,E extends TypedElement<E, C[] parsePlusX>, X extends TypedExtension, Y extends Exception> (TypedContent.ParsingConstructor<? extends C, E, throws TdomContentException, YX, Y> constructor, ContentMapping content, X ext, TypedNode.ParseListener<E> listener, Class<C> contentClass) DOCME ML ist das nur für w3cDom ??? und OHNE attribute ??? DANN nur TdomContentException !!- Throws:
TdomContentException
Y extends Exception
-
parsePlusList
public static <C extends TypedContent,E extends TypedElement<E, CheckedListPlus<C> parsePlusListX>, X extends TypedExtension, Y extends Exception> (TypedContent.ParsingConstructor<? extends C, E, throws TdomContentException, YX, Y> constructor, ContentMapping content, X ext, TypedNode.ParseListener<E> listener, Class<C> contentClass) - Throws:
TdomContentException
Y extends Exception
-
encode
- Overrides:
encode
in classTypedNode<X extends TypedExtension>
- Throws:
IOException
-
decodeOptional
public static <C extends TypedContent,E extends TypedExtension, C decodeOptionalY extends Exception> (TypedContent.DecodingConstructor<C, E, throws IOException, TdomContentException, YY> constructor, DecodingInputStream in, E ext) - Throws:
IOException
TdomContentException
Y extends Exception
-
decodeStar
public static <C extends TypedContent,E extends TypedExtension, C[] decodeStarY extends Exception> (TypedContent.DecodingConstructor<? extends C, E, throws IOException, Y, TdomContentExceptionY> constructor, DecodingInputStream in, E ext, Class<C> contentClass) - Throws:
IOException
Y extends Exception
TdomContentException
-
decodePlus
public static <C extends TypedContent,E extends TypedExtension, C[] decodePlusY extends Exception> (TypedContent.DecodingConstructor<? extends C, E, throws IOException, Y, TdomContentExceptionY> constructor, DecodingInputStream in, E ext, Class<C> contentClass) - Throws:
IOException
Y extends Exception
TdomContentException
-
decodePlusList
public static <C extends TypedContent,E extends TypedExtension, CheckedListPlus<C> decodePlusListY extends Exception> (TypedContent.DecodingConstructor<? extends C, E, throws IOException, Y, TdomContentExceptionY> constructor, DecodingInputStream in, E ext, Class<C> contentClass) - Throws:
IOException
Y extends Exception
TdomContentException
-
decodeStarList
public static <C extends TypedContent,E extends TypedExtension, CheckedList<C> decodeStarListY extends Exception> (TypedContent.DecodingConstructor<? extends C, E, throws IOException, Y, TdomContentExceptionY> constructor, DecodingInputStream in, E ext, Class<C> contentClass) - Throws:
IOException
Y extends Exception
TdomContentException
-
w3c_getNamespaceName
-
parseAbstract
protected static <E extends TypedElement<E,X>, TypedContent parseAbstractX extends TypedExtension, Y extends Exception> (TypedDTD dtd, X ext, TypedNode.ParseListener<E> listener, Map<? super String, ? extends TypedContent.ParsingConstructor<?, throws TdomContentException, YE, X, Y>> subclassTable, Element elem) - Throws:
TdomContentException
Y extends Exception
-
parseAndClose
protected static <C extends TypedContent> C parseAndClose(C content, SAXEventStream in, String tagName) throws TdomXmlException Backwards compatibility definition.- Throws:
TdomXmlException
-
parseAndClose
protected static <C extends TypedContent> C parseAndClose(C content, SAXEventStream in, boolean explicit, String tagName) throws TdomXmlException - Throws:
TdomXmlException
-
matchStartElement
public static Attributes matchStartElement(SAXEventStream in, String tag) throws TdomContentException - Throws:
TdomContentException
-
matchStartElement
public static Attributes matchStartElement(SAXEventStream in, NamespaceName name) throws TdomContentException - Throws:
TdomContentException
-
matchEndElement
- Throws:
TdomXmlException
-
matchEndElement
- Throws:
TdomXmlException
-
parseMixed
protected static <C extends TypedElement.MixedContent<E,X>, void parseMixedE extends TypedElement<E, X>, X extends TypedExtension, Y extends Exception> (TypedElement.MixedContentFactory<C, E, throws TdomContentException, YX, Y> factory, X ext, TypedNode.ParseListener<E> listener, Element domElement, List<? super C> l) - Throws:
TdomContentException
Y extends Exception
-
semiparseMixed
protected static <C extends TypedElement.MixedContent<E,X>, void semiparseMixedE extends TypedElement<E, X>, X extends TypedExtension> (TypedElement.MixedContentFactory<C, E, throws TdomContentExceptionX, ?> factory, TypedSubstantial[] nodes, List<? super C> l) - Throws:
TdomContentException
-
encodeMixed
protected static <E extends TypedExtension> void encodeMixed(EncodingOutputStream out, E ext, int count, Iterator<? extends TypedElement.MixedContent<?, E>> i) throws IOException- Throws:
IOException
-
decodeMixed
protected static <C extends TypedElement.MixedContent<E,X>, C[] decodeMixedE extends TypedElement<E, X>, X extends TypedExtension, Y extends Exception> (TypedElement.MixedContentFactory<C, E, throws IOException, TdomContentException, YX, Y> factory, DecodingInputStream in, X ext, Class<? extends C> contentClass, int max) - Throws:
IOException
TdomContentException
Y extends Exception
-
parseMixed
protected static <E extends TypedElement<E,X>, TypedElement.MixedContent[] parseMixedX extends TypedExtension, Y extends Exception> (TypedElement.MixedContentFactory<?, E, throws Y, TdomContentException, TdomXmlExceptionX, Y> factory, SAXEventStream in, X ext, TypedNode.ParseListener<E> listener, TypedElement.MixedContent... array) - Throws:
Y extends Exception
TdomContentException
TdomXmlException
-
getPCData
-
getDeepPCData
Description copied from class:TypedSubstantial
Collect and concatenate all PCData, directly or indirectly contained in this model component (mostly: an Element).- Specified by:
getDeepPCData
in classTypedSubstantial<X extends TypedExtension>
-
getAttrsSnapshot
CallgetAttrsSnapshot(boolean)
in validating mode. -
getAttrsSnapshot
- Parameters:
validating
- If set to false, Attributes with no explicit value set by the user (i.e. only the default value) will not be contained in the snapshot.
-
__getAllAttrs
-
__dumpElementSnapshot
-
getElemsSnapshot
-
ensureSize
-
setResizing
-
classifyForException
-
semiparseEmpty
- Throws:
TdomContentException
-
start
public void start(ContentHandler contentHandler, LexicalHandler lexicalHandler, Attributes attributes) throws SAXException - Throws:
SAXException
-
end
- Throws:
SAXException
-