org.apache.commons.jelly.tags.core

## Class SetPropertiesTag

- java.lang.Object
- - org.apache.commons.jelly.TagSupport
  - - org.apache.commons.jelly.DynaTagSupport
    - - org.apache.commons.jelly.MapTagSupport
      - - org.apache.commons.jelly.tags.core.SetPropertiesTag

All Implemented Interfaces:
  DynaTag, Tag

    public class SetPropertiesTag
    extends MapTagSupport

A tag which sets the bean properties on the given bean. So if you used it as follows, for example using the <j:new> tag.

     <j:new className="com.acme.Person" var="person"/>
     <j:setProperties object="${person}" name="James" location="${loc}"/>

Then it would set the name and location properties on the bean denoted by the expression ${person}.

This tag can also be nested inside a bean tag such as the <useBean> tag or a JellySwing tag to set one or more properties, maybe inside some conditional logic.

Version:
  $Revision: 155420 $
Author:
  James Strachan

### Field Summary

### Fields inherited from class org.apache.commons.jelly.TagSupport

`body, context, parent`

### Constructor Summary

Constructors
Constructor and Description
`SetPropertiesTag()`

### Method Summary

Methods
`void` `doTag(XMLOutput output)` Evaluates this tag after all the tags properties have been initialized.
`protected void` `setBeanProperties(java.lang.Object bean, java.util.Map attributes)` Sets the properties on the bean.

### Methods inherited from class org.apache.commons.jelly.MapTagSupport

`createAttributes, getAttributes, setAttribute`

### Methods inherited from class org.apache.commons.jelly.DynaTagSupport

`getAttributeType`

### Methods inherited from class org.apache.commons.jelly.TagSupport

`findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.commons.jelly.Tag

`getBody, getContext, getParent, invokeBody, setBody, setContext, setParent`

### Constructor Detail

#### SetPropertiesTag

    public SetPropertiesTag()

### Method Detail

#### doTag

    public void doTag(XMLOutput output)
               throws MissingAttributeException,
                      JellyTagException

Description copied from interface: `Tag`
Evaluates this tag after all the tags properties have been initialized.

Throws:
  `MissingAttributeException`
  `JellyTagException`

#### setBeanProperties

    protected void setBeanProperties(java.lang.Object bean,
                         java.util.Map attributes)
                              throws JellyTagException

Sets the properties on the bean. Derived tags could implement some custom type conversion etc.

Throws:
  `JellyTagException`