]>
git.argeo.org Git - gpl/argeo-slc.git/blob - spring/OverrideArg.java
1 package org
.argeo
.slc
.ant
.spring
;
3 import org
.apache
.tools
.ant
.BuildException
;
5 /** Ant type allowing to override bean properties. */
6 public class OverrideArg
extends AbstractSpringArg
{
10 /** The nbame of the property to override. */
11 public String
getName() {
15 public void setName(String name
) {
19 /** Both value and bean cannot be set. */
20 public void setValue(String value
) {
21 if (getBean() != null) {
22 throw new BuildException(
23 "Cannot set both 'bean' and 'value' attributes.");
29 public void setBean(String bean
) {
31 throw new BuildException(
32 "Cannot set both 'bean' and 'value' attributes.");
38 * The related object: the value if a value had been set or an instance of
41 public Object
getObject() {
44 } else if (getBean() != null) {
45 return getBeanInstance();
47 throw new BuildException("Value or bean not set.");