import org.argeo.slc.core.structure.tree.TreeSPath;\r
\r
/** Ant task that can be registered within a structure. */\r
-public abstract class SAwareTask extends AbstractSpringTask implements\r
- StructureElement {\r
+public abstract class SAwareTask extends AbstractSpringTask {\r
private String path;\r
private TreeSPath treeSPath;\r
private final List<AbstractSpringArg> sAwareArgs = new Vector<AbstractSpringArg>();\r
\r
treeSPath = taskPath;\r
} else {\r
- treeSPath = TreeSPath.parseToCreatePath(path);\r
+ treeSPath = new TreeSPath(path);\r
}\r
\r
- if (structureElementArg != null)\r
- getRegistry().register(treeSPath,\r
- structureElementArg.getStructureElement());\r
- else\r
- getRegistry().register(treeSPath, this);\r
+ if (getRegistry().getElement(treeSPath) == null) {\r
+ // No structure element registered.\r
+ if (structureElementArg != null) {\r
+ getRegistry().register(treeSPath,\r
+ structureElementArg.getStructureElement());\r
+ } else {\r
+ if (getDescription() != null) {\r
+ getRegistry().register(treeSPath,\r
+ new SimpleSElement(getDescription()));\r
+ }\r
+ }\r
+ }\r
\r
// notify registered args\r
for (AbstractSpringArg arg : sAwareArgs) {\r