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.Elements.
Generates an error in case of doubly used element names.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns all names(/"tags") used forDTD.Elements in the dtd.Returns allDTD.Elementobjects in the dtd.getElement(String name) Return theDTD.Elementobject for a given element name ("tag").intReturns an integer index for a given element name ("tag").Returns theDTD.Dtdwhich this object reflects.voidupdate(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.Elementobject for a given element name ("tag").- Throws:
IllegalStateException- in caseupdate(MessageReceiver,DTD.Dtd)has not been called before.
-
allElements
Returns allDTD.Elementobjects in the dtd.- Throws:
IllegalStateException- in caseupdate(MessageReceiver,DTD.Dtd)has not been called before.
-
allElementNames
Returns all names(/"tags") used forDTD.Elements in the dtd.- Throws:
IllegalStateException- in caseupdate(MessageReceiver,DTD.Dtd)has not been called before.
-
getSource
Returns theDTD.Dtdwhich this object reflects.
-