public class ElementIndex extends Object
DTD.Dtd
an index from element names into
DTD.Element
s.
Generates an error in case of doubly used element names.Modifier and Type | Field and Description |
---|---|
protected Map<String,DTD.Element> |
name2element |
protected Map<String,Integer> |
name2elementindex |
protected DTD.Dtd |
source |
Constructor and Description |
---|
ElementIndex() |
Modifier and Type | Method and Description |
---|---|
Set<String> |
allElementNames()
Returns all names(/"tags") used for
DTD.Element s in the dtd. |
Collection<DTD.Element> |
allElements()
Returns all
DTD.Element objects in the dtd. |
DTD.Element |
getElement(String name)
Return the
DTD.Element object for a given element name ("tag"). |
int |
getIndex(String name)
Returns an integer index for a given element name ("tag").
|
DTD.Dtd |
getSource()
Returns the
DTD.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.
|
protected Map<String,DTD.Element> name2element
protected DTD.Dtd source
public void update(MessageReceiver<? super SimpleMessage<XMLDocumentIdentifier>> msg, DTD.Dtd dtd)
IllegalStateException
- if called more than once.public int getIndex(String name)
IllegalStateException
- in case update(MessageReceiver,DTD.Dtd)
has not been called before.public DTD.Element getElement(String name)
DTD.Element
object for a given element name ("tag").IllegalStateException
- in case update(MessageReceiver,DTD.Dtd)
has not been called before.public Collection<DTD.Element> allElements()
DTD.Element
objects in the dtd.IllegalStateException
- in case update(MessageReceiver,DTD.Dtd)
has not been called before.public Set<String> allElementNames()
DTD.Element
s in the dtd.IllegalStateException
- in case update(MessageReceiver,DTD.Dtd)
has not been called before.see also the complete user documentation .