Apache Struts 2 Documentation > Home > Guides > Core Developers Guide > Annotations > Element Annotation
Added by Rainer Hermanns, last edited by Don Brown on Nov 14, 2006  (view change)

Sets the Element for type conversion.

Usage

The Element annotation must be applied at field level.

Parameters

Parameter Required Default Description
value no java.lang.Object.class The element property value.

Examples

// The key property for User objects within the users collection is the <code>userName</code> attribute.
@Element( value = com.acme.User )
private Map<Long, User> userMap;

@Element( value = com.acme.User )
public List<User> userList;