To learn the full XML syntax, check out the Bindings:
<object .../>
: see {@link ObjectBinding}<boolean .../>
, <true />
and <false/>
: see {@link BooleanBinding}<byte .../>
: see {@link ByteBinding}<char .../>
: see {@link CharBinding}<double .../>
: see {@link DoubleBinding}<float .../>
: see {@link FloatBinding}<int .../>
: see {@link IntBinding}<string .../>
: see {@link StringBinding}<map .../>
: see {@link MapBinding}<set .../>
: see {@link SetBinding}<list .../>
: see {@link ListBinding}<class .../>
: see {@link ClassBinding}<ref .../>
: see {@link RefBinding}<null .../>
: see {@link NullBinding}<environment .../>
: see {@link EnvironmentBinding}<environment-factory .../>
: see {@link EnvironmentFactoryBinding}<hibernate-persistence .../>
: see {@link HibernateSessionFactoryBinding}<persistence-session .../>
: see {@link PersistenceSessionBinding}The defaults bindings for the Wiring XML are divided in two categories:
Once a parser is created, bindings can be added, overwritten and removed to customize that parser instance.
An ArgDescriptor is defined by a <arg>
xml element.
This element can have an attribute "type", which specifies name of the argument's type.
This element contains one child element that defines a {@link Descriptor}. This descriptor specifies the value to give to the argument.
public class Hello { public static String sayHello(String name) { return "Hello " + name + " !"; } }The following Xml declaration will create an object 's' of class 'String' (see {@link ObjectDescriptor}). This object is created by invoking
Hello.sayHello
with the value world
as a parameter. <objects> <object name="s" class='Hello' method='sayHello'> <arg> <string value='world' /> </arg> </object> </objects>The created object 's' will be a String, containing "Hello world !".
The initialization method can be defined with the init
attribute. For more details on how initialization works, see section 'Initialization' of {@link WireContext}.
init
attribute can have these values: lazy
: for lazy creation and delayed initializationrequired
: for lazy creation and immediate initializationeager
: for eager creation and delayed initializationimmediate
: for eager creation and immediate initialization
|
|
|
|
|
|