org.ow2.bonita.pvm.internal.wire.binding
Class PropertyBinding
java.lang.Object
org.ow2.bonita.pvm.internal.util.TagBinding
org.ow2.bonita.pvm.internal.wire.binding.WireBinding
org.ow2.bonita.pvm.internal.wire.binding.WireOperationBinding
org.ow2.bonita.pvm.internal.wire.binding.PropertyBinding
- All Implemented Interfaces:
- Binding
public class PropertyBinding
- extends WireOperationBinding
This Binding
specifies PropertyOperation
(for property
injection).
A property injection is defined by a <property>
xml element.
This element must have a attribute "name" or a attribute "setter".
- the "name" attribute specifies the name of the property to inject. For a
property
foo
, a setter method named setFoo
should
exist.
- the "setter" attribute specifies the name of the setter method to use to
inject the property.
If both attributes are present, the setter method is used.
This element should contain a child element that defines a Descriptor
. This descriptor will be used to create the object that will be assigned to
the field
Example
Consider the following class:
public class Foo {
String bar;
public void setBar(String bar) {
this.bar = bar;
}
}
The following Xml declaration will create an object 'o' of class 'Foo' (see
ObjectDescriptor
), and
the value hello
will be assigned to o.bar
by
calling the setBar
method.
<objects>
<object name='o' class='Foo'>
<property name='bar'>
<string value='hello' />
</property>
</object>
</objects>
- Author:
- Tom Baeyens, Guillaume Porcher (documentation)
- See Also:
ObjectBinding
,
WireParser
Method Summary |
java.lang.Object |
parse(org.w3c.dom.Element element,
Parse parse,
Parser parser)
translates the given element into a domain model java object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PropertyBinding
public PropertyBinding()
parse
public java.lang.Object parse(org.w3c.dom.Element element,
Parse parse,
Parser parser)
- Description copied from interface:
Binding
- translates the given element into a domain model java object. Use the parse
to report problems.
- Returns:
- the domain model java object.
- See Also:
Parser
Copyright © 2009 OW2 Consortium. All Rights Reserved.