Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

@Retention(CLASS) @Target({METHOD})

public @interface Bean

A method of a Configuration class whose return value is a bean.

Its parameters are injected like a constructor’s, and may carry Qualifier or Value. A static @Bean method is called without constructing the configuration class.

Methods

public abstract String value() default ""The bean’s name.
public abstract String initMethod() default ""A no-argument method of the returned object the build calls once it is constructed and injected.
public abstract String destroyMethod() default ""A no-argument method of the returned object the build calls when the server stops.

Method details

value

public abstract String value() default ""
The bean’s name. Empty means the method’s name, which is Spring’s rule.

initMethod

public abstract String initMethod() default ""
A no-argument method of the returned object the build calls once it is constructed and injected. Empty for none.

destroyMethod

public abstract String destroyMethod() default ""
A no-argument method of the returned object the build calls when the server stops. Empty for none.