import org.apache.commons.logging.Log;\r
import org.apache.commons.logging.LogFactory;\r
\r
-/** Default implementation of a <code>StructureRegistry</code>.*/\r
+/** Default implementation of a <code>StructureRegistry</code>. */\r
public class DefaultSRegistry implements StructureRegistry {\r
private static Log log = LogFactory.getLog(DefaultSRegistry.class);\r
\r
return new Vector<StructureElement>(elements);\r
}\r
\r
- public void register(StructureElement element) {\r
+ public List<StructurePath> listPaths() {\r
+ return new Vector<StructurePath>(paths);\r
+ }\r
+\r
+ public void register(StructurePath path, StructureElement element) {\r
StructureElement treeSElement = element;\r
elements.add(treeSElement);\r
- paths.add( treeSElement.getPath());\r
- log.debug("Registered " + treeSElement.getPath() + " (desc: "\r
- + treeSElement.getDescription() + " position: "\r
+ paths.add(path);\r
+ log.debug("Registered " + path + " (desc: '"\r
+ + treeSElement.getDescription() + "', position: "\r
+ elements.size() + ")");\r
}\r
\r
- public void register(StructureAware structureAware) {\r
- register(structureAware.getElement());\r
- structureAware.onRegister(this);\r
- }\r
-\r
public StructureElement getElement(StructurePath path) {\r
int index = paths.indexOf(path);\r
if (index >= 0) {\r