\r
import org.apache.tools.ant.BuildException;\r
import org.apache.tools.ant.Target;\r
-\r
-import org.argeo.slc.ant.SlcAntException;\r
-import org.argeo.slc.ant.SlcProjectHelper;\r
-import org.argeo.slc.ant.spring.SpringArg;\r
+import org.argeo.slc.ant.SlcAntConstants;\r
import org.argeo.slc.ant.spring.AbstractSpringTask;\r
+import org.argeo.slc.ant.spring.SpringArg;\r
+import org.argeo.slc.core.SlcException;\r
import org.argeo.slc.core.structure.SimpleSElement;\r
import org.argeo.slc.core.structure.StructureAware;\r
import org.argeo.slc.core.structure.StructureElement;\r
/** Actions to be executed by the implementor. */\r
protected abstract void executeActions(String mode);\r
\r
+ public <T> T getBean(String beanName) {\r
+ return (T) getContext().getBean(beanName);\r
+ }\r
+\r
/** Create a reference to an external structure element. */\r
public StructureElementArg createStructureElement() {\r
if (structureElementArg != null)\r
- throw new SlcAntException("Arg already set.");\r
+ throw new SlcException("Arg already set.");\r
structureElementArg = new StructureElementArg();\r
return structureElementArg;\r
}\r
/** Gets the underlying structure registry. */\r
protected StructureRegistry<TreeSPath> getRegistry() {\r
return (StructureRegistry<TreeSPath>) getProject().getReference(\r
- SlcProjectHelper.REF_STRUCTURE_REGISTRY);\r
+ SlcAntConstants.REF_STRUCTURE_REGISTRY);\r
}\r
\r
/** Creates the treeSPath for a given Ant target. */\r
protected static TreeSPath createTargetPath(Target target) {\r
TreeSPath projectPath = (TreeSPath) target.getProject().getReference(\r
- SlcProjectHelper.REF_PROJECT_PATH);\r
+ SlcAntConstants.REF_PROJECT_PATH);\r
return projectPath.createChild(target.getName());\r
}\r
\r