Package eu.bandm.tools.dtd
Class ElementIndex
java.lang.Object
eu.bandm.tools.dtd.ElementIndex
Maintains for one given
DTD.Dtd
an index from element names into
DTD.Element
s.
Generates an error in case of doubly used element names.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns all names(/"tags") used forDTD.Element
s in the dtd.Returns allDTD.Element
objects in the dtd.getElement
(String name) Return theDTD.Element
object for a given element name ("tag").int
Returns an integer index for a given element name ("tag").Returns theDTD.Dtd
which this object reflects.void
update
(MessageReceiver<? super SimpleMessage<XMLDocumentIdentifier>> msg, DTD.Dtd dtd) Must be called exactly once to initialize maps with a certain dtd.
-
Field Details
-
name2element
-
name2elementindex
-
source
-
-
Constructor Details
-
ElementIndex
public ElementIndex()
-
-
Method Details
-
update
Must be called exactly once to initialize maps with a certain dtd. Sends to the message channel error messages in case of duplicate usage of element names.- Throws:
IllegalStateException
- if called more than once.
-
getIndex
Returns an integer index for a given element name ("tag"). The indexes correspond to the sequential order in the original dtd.- Throws:
IllegalStateException
- in caseupdate(MessageReceiver,DTD.Dtd)
has not been called before.
-
getElement
Return theDTD.Element
object for a given element name ("tag").- Throws:
IllegalStateException
- in caseupdate(MessageReceiver,DTD.Dtd)
has not been called before.
-
allElements
Returns allDTD.Element
objects in the dtd.- Throws:
IllegalStateException
- in caseupdate(MessageReceiver,DTD.Dtd)
has not been called before.
-
allElementNames
Returns all names(/"tags") used forDTD.Element
s in the dtd.- Throws:
IllegalStateException
- in caseupdate(MessageReceiver,DTD.Dtd)
has not been called before.
-
getSource
Returns theDTD.Dtd
which this object reflects.
-