@Documented @Target(value=CONSTRUCTOR) @Retention(value=RUNTIME) @Inherited public @interface BeanConstructor
This annotation can be used in the case of beans with properties whose values can only be set by passing them in
through a constructor on the class.
Since method parameter names are lost during compilation, this annotation essentially redefines them so that they are available at runtime.
The definition of a read-only bean is a bean with properties with only getters, like shown below...
This annotation can only be applied to constructors and can only be applied to one constructor per class.
When present, bean instantiation is delayed until the call to
Until then, bean property values are stored in a local cache until
getBean() is called.
Because of this additional caching step, parsing into read-only beans tends to be slower and use more memory than
parsing into beans with writable properties.
Attempting to call
BeanMap.put(String,Object) on a read-only property after calling
will result in a
BeanRuntimeException being thrown.
Multiple calls to
BeanMap.getBean() will return the same bean instance.
Beans can be defined with a combination of read-only and read-write properties.
Copyright © 2017 Apache. All rights reserved.