properties

Description

Creates java properties that can be accessed within Oddjob as text or passed into other components that require java Properties.

There are six ways to set properties:

Although combinations are possible, the order of things isn't guaranteed so results could be unpredictable.

In Oddjob the property name is divided up into a tree of properties, so morning.snack.fruit = apple is a node called morning that has a snack property which is another node that has a fruit property with a value apple.

If the export property is set to true the property tree is exported to Oddjobs underlying property pool so the root property node acts like a component with an id. In the above example an id of 'morning'.

The prefix property will be prefixed to properties provided with via input, values or properties (not environment or system as they provide their own prefix)

Properties

NameDescriptionRequired
name A name, can be any text. No.
export Export properties to the underlying Bean Registry. No.
input An input source for Properties. No.
fromXml Is the input in XML format. No, Defaults to false.
set The. No.
properties Extra properties. No.

Elements

values

Required: No, Defaults to false.

Is the input in XML format.

Example

 <oddjob>
  <job>
   <sequential>
    <jobs>
     <properties id="props" export="true" prefix="messages">
      <values>
       <property name="english.greeting" value="Hello"/>
      </values>
     </properties>
     <echo text="${props.all.messages.english.greeting} is exported as ${messages.english.greeting}" />
    </jobs>
   </sequential>
  </job>
 </oddjob>
 


(c) Rob Gordon 2005 - 2009