Adds an element to the ID and name maps, if necessary. @param element the element to be added to the ID and name maps @param recurse indicates if children must be added too
(final DomElement element, final boolean recurse)
| 1850 | * @param recurse indicates if children must be added too |
| 1851 | */ |
| 1852 | void addMappedElement(final DomElement element, final boolean recurse) { |
| 1853 | // Index is built lazily; skip while not built. ensureMappedElementsBuilt() |
| 1854 | // walks the tree once and populates everything on first read. |
| 1855 | if (!mappedElementsBuilt_) { |
| 1856 | return; |
| 1857 | } |
| 1858 | if (isAncestorOf(element)) { |
| 1859 | addElement(element, recurse); |
| 1860 | } |
| 1861 | } |
| 1862 | |
| 1863 | private void ensureMappedElementsBuilt() { |
| 1864 | if (mappedElementsBuilt_) { |
no test coverage detected