\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.AntConstants;\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
\r
// notify registered args\r
for (SpringArg arg : sAwareArgs) {\r
- Object obj = arg.getBeanInstance();\r
+ Object obj = arg.getInstance();\r
\r
if (obj instanceof StructureAware) {\r
StructureAware<TreeSPath> sAwareT = (StructureAware<TreeSPath>) obj;\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
+ AntConstants.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
+ AntConstants.REF_PROJECT_PATH);\r
return projectPath.createChild(target.getName());\r
}\r
\r
\r
class StructureElementArg extends SpringArg {\r
public StructureElement getStructureElement() {\r
- return (StructureElement) getBeanInstance();\r
+ return (StructureElement) getInstance();\r
}\r
}
\ No newline at end of file