in jelly-tags/dynabean/src/main/java/org/apache/commons/jelly/tags/dynabean/SetTag.java [58:104]
public void doTag(XMLOutput output) throws JellyTagException {
Object answer = null;
if ( value != null ) {
answer = value.evaluate(context);
}
else {
answer = getBodyText();
}
// Assume that if a var name and a property is given then
// var is the name of an object in the context
if (( var != null )
&& ( property != null)
&& ( target == null ))
{
// Get object from context
if ( scope != null ) {
target = context.getVariable(var, scope);
}
else {
target = context.getVariable(var);
}
if (target != null) {
var = null;
}
}
if ( var != null ) {
if ( scope != null ) {
context.setVariable(var, scope, answer);
}
else {
context.setVariable(var, answer);
}
}
else {
if ( target == null ) {
throw new JellyTagException( "Either a 'var' or a 'target' attribute must be defined for this tag" );
}
if ( property == null ) {
throw new JellyTagException( "You must define a 'property' attribute if you specify a 'target'" );
}
setPropertyValue( target, property, answer );
}
}