@User public abstract class TypedDocument<E extends TypedElement<E,X>,X extends TypedExtension> extends TypedNode<X>
Document
"
will be generated in each tdom model.
Then for every element declaration (e.g. "EL") which is declared as
"public
" by a PI in the underlying DTD, a subclass of this class
is generated called "Document_EL
".
This class will provide the factory methods for converting sources into
complete document instances and other global methods. Since these rely on the
generated classes, they cannot be found here, but only in the generated code.
They will look aprox. like ...
Document_EL (Element_EL) {..} // = bottom-up explicit constructor Document_EL ((Reminder: "SAXEventStream
,TypedExtension
) {..} // = for parsing a complete document from the sax input Document_EL (org.w3c.dom.Document, Extension) {..} // = for converting one complete DOM model into a tdom model ElementDictionary<Element> createDictionary() {..} // = for linking all id and idref attributes
Element
" is the name of the generated class serving as
common base class of all element classes.)TypedNode.ParseListener<E extends TypedElement<?,?>>
Modifier and Type | Field and Description |
---|---|
protected E |
root |
static String |
STRING_ETHEREAL_SEPARATOR |
Modifier | Constructor and Description |
---|---|
protected |
TypedDocument(TypedDTD dtd) |
Modifier and Type | Method and Description |
---|---|
ElementDictionary<E,X> |
createDictionary()
Create a dictionary which maps all Elements with id fields to the id values,
and vice versa.
|
protected abstract E |
decode(DecodingInputStream in,
X ext) |
void |
decode(InputStream in,
X ext) |
void |
decodeEthereals(DecodingInputStream s)
Must be called explicitly by the user, after he/she has created the document object.
|
void |
encode(EncodingOutputStream out,
X ext)
Abstract fall-back method which MUST be overridden and always throws an Exception.
|
void |
encode(OutputStream out,
X ext) |
protected void |
encodeEthereals(EncodingOutputStream s)
Writes out the comments and pis.
|
void |
end(ContentHandler contentHandler,
LexicalHandler lexicalHandler)
Send the closing sax events to the two drains.
|
TypedDTD |
getDTD()
Returns the global DTD information compiled into this tdom model.
|
TypedEtherealContainer |
getEtherealContainer()
Gives access to the Comments and PIs after the opening tag and before the close tag.
|
TypedElement<E,X> |
getRootUntyped()
Returns the root element as an instance of TypedElement, so this method
works for different tdom models.
|
protected int |
getTagIndex() |
void |
start(ContentHandler contentHandler,
LexicalHandler lexicalHandler)
Send the opening sax events to the two drains.
|
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
protected E extends TypedElement<E,X> root
public static final String STRING_ETHEREAL_SEPARATOR
protected TypedDocument(TypedDTD dtd)
@User public final TypedDTD getDTD()
@User public TypedEtherealContainer getEtherealContainer()
protected int getTagIndex()
@User public TypedElement<E,X> getRootUntyped()
public void encode(OutputStream out, X ext) throws IOException
IOException
public void encode(EncodingOutputStream out, X ext) throws IOException
TypedNode
encode
in class TypedNode<X extends TypedExtension>
IOException
public final void decode(InputStream in, X ext) throws IOException, TdomContentException, TdomAttributeException
protected abstract E decode(DecodingInputStream in, X ext) throws IOException, TdomContentException, TdomAttributeException
@User public void start(ContentHandler contentHandler, LexicalHandler lexicalHandler) throws SAXException
ContentHandler.startDocument()
event, followed
by the leading comments from getEtherealContainer()
.SAXException
@User public void end(ContentHandler contentHandler, LexicalHandler lexicalHandler) throws SAXException
getEtherealContainer()
,
followed by ContentHandler.endDocument()
.SAXException
@User public ElementDictionary<E,X> createDictionary()
Identifiable
.
The data are collected using ElementDictionary.addIfIdentifiable(TypedElement)
.
See there for the exception conditions.HomonymousIdException
- see ElementDictionary
protected void encodeEthereals(EncodingOutputStream s)
public void decodeEthereals(DecodingInputStream s)
see also the complete user documentation .