The <property> Element

Purpose

The <property> element declares or sets a property value of a validator. The usage differs depending on the context:

  • In the <validators> section, where validators are declared, you have to declare all properties, which you intend to use in the <forms> section. This is done by adding a <property> element for every bean property of the underlying Java class, which shall be made available. If the value attribute is added, it acts as a default value, which may or may not be overridden when the validator is used. However, if the final attribute is set to true, the property value must not be overridden.
  • In the <forms> section, where validators are used, you may override the value of one or more of the declared non-final properties of the validator by adding a <property> element. In this case both, the name and value, attributes are required.

A string property value will be automatically converted to the formal property type using de.odysseus.calyxo.base.util.ParseUtils. This will work for all primitive types, their wrapper classes and java.util.Date, provided the string value is given in standard notation. Finally, if the property type is javax.servlet.jsp.el.Expression, the string will be wrapped with "${" and "}" and parsed into an Expression (the expression may use functions declared in the validator's configuration file). For other property types, the property value must be an instance of that type.

Attributes

NameTypeDescription
name NMTOKEN Required - The name of the property.
value CDATA Dynamic - The value of the property. This attribute is required when overriding a validator property in a <match>, <convert> or <check> element.
final true|false States, if a validator property is final and must not be overridden. The default is false. Allowed only inside a <matcher>, <converter> or <checker> element.

Body

The <property> element has no body.

Related elements

<matcher>, <converter>, <checker>, <match>, <convert>, <check>