net.contextfw.web.application.component.Element Maven / Gradle / Ivy
package net.contextfw.web.application.component;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Denotes that a class property or return value of a method is to be added as child element
* into DOM-tree during build phase.
*
*
* If property or return value is null then element is not added to the tree.
*
*/
@Target( { FIELD, METHOD })
@Retention(RUNTIME)
public @interface Element {
/**
* The name of the element.
*
*
* Defaults to the property or method name
*
*/
String name() default "";
/**
* Defines if this element should be built in to DOM-tree during component creation
*/
boolean onCreate() default true;
/**
* Defines if this element should be built in to DOM-tree during component update
*/
boolean onUpdate() default true;
/**
* Defines if class property containing Component should be automatically registered
* to rendering tree.
*
*
* If class property contains Component after it has been injected by Guice and
* this property is true it is automatically registered to rendering tree. In normal
* situations this is the wanted behavior. If property is null then it is ignored.
*
*
*
* Note! This is effective only when instance is initialized by Guice and the instance of the
* containing class extends Component.
*
*/
boolean autoRegister() default true;
/**
* Defines if the child element should be wrapped with a DOM-element containing the name of the property
* or method.
*
*
* If explicit name is given it overrides the actual name.
*
* @return
*/
boolean wrap() default true;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy