While I absolutely agree with Thomas, I'd suggest using a text generator
template like FTL, Ruby or even String#format will do as well :) Below is a
FTL piece.
> package ${class.package.name};
>
> import org.apache.wicket.markup.html.basic.Label;
> import org.apache.wicket.markup.html.panel.Panel;
> import org.apache.wicket.model.IModel;
>
> public class ${class.simpleName}DisplayPanel extends Panel {
> private static final long serialVersionUID = 1L;
> public ${class.simpleName}DisplayPanel(String id,
> IModel<${class.simpleName}> model) {
> super(id, model);
> <#foreach field in class.declaredFields>
> <#if !modifier.isFinal(field.modifiers) &&
> !modifier.isStatic(field.modifiers)>
> <#assign generate = true>
> <#foreach annotation in field.declaredAnnotations>
> <#assign atype = annotation.annotationType().simpleName>
> <#if atype == "ManyToOne" || atype == "OneToMany" || atype ==
> "Version"
> || atype == "Id">
> <#assign generate = false>
> </#if>
> </#foreach>
> <#if generate>
> add(new Label("${field.name}"));
> </#if>
> </#if>
> </#foreach> }
> }
>
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/java-pojo-Bean-to-generate-html-textfield-dropdown-radio-buttons-tp4650368p4650387.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]