Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

This is a draft document. It can be modified at any time by any committer. Comments on the draft should be made on the dev mailing list.


Grammar version 2 (http://ofbiz.apache.org/dtds/simple-methods-v2.xsdImage Added)

Attributes

Attribute Types

...

Section
Column
width20%
<set>
Column
Assigns a value to a field.
Code Block
xml
xml
<set field="foo" value="bar" />
<set field="baz" from-field="foo" />

Attributes

Name

Type

Requirements

Description

 

field

expression

optional

The name of the field to set (the l-value)

 

from-field

expression

optional

The name of a field to copy from (the r-value)

 

value

constant+expr

optional

A constant value

 

default-value

constant, constant+expr, expression

optional

A default constant value - used if from-field evaluates to null

 

type

constant

optional

The Java data type of field

Defaults to "String"

set-if-null

constant

optional

Controls if field can be set to null.

Defaults to "false"

set-if-empty

constant

optional

Controls if field can be set to an empty value. The meaning of "empty" depends on the Java data type.

Defaults to "true"


Info
titleProposed Changes
  • Currently, the field attribute is optional. Require the field attribute.
  • Currently, the from-field and value attributes are optional. Require one of the two attributes.
  • Add a new attribute: from-script. The attribute will be used exclusively for scriptlets that are currently found in other attributes.
  • Rename the from-field attribute to from. The attribute will be used exclusively for UEL expressions.
  • Change the behavior of the value attribute: The attribute will be used exclusively for string constants.
  • Rename the default-value attribute to default.
  • Remove the type attribute default.

...