public interface JavaTemplatesTagValues extends EugeneTagValues
| Modifier and Type | Field and Description |
|---|---|
static String |
TAG_BEAN_SUPER_CLASS
Tag value to use a super class for generated bean.
|
static String |
TAG_NO_PCS
Tag value to set if do not want any pcs (says PropertyChangeSupport in a generated bean).
|
TAG_CONSTANT_PREFIX, TAG_DO_NOT_GENERATE_BOOLEAN_GET_METHODS, TAG_DOCUMENTATION, TAG_I18N_PREFIX, TAG_VERSIONstatic final String TAG_NO_PCS
static final String TAG_BEAN_SUPER_CLASS
TAG_NO_PCS on classifier or model,
then your class must provide evrything for it.
More over, if you use some collections in your bean you must also define
two method named getChild(Collection list, int index) and
getChild(List list, int index)
See new code to know minimum stuff to add in your class for this purpose.
public abstract class AbstractBean implements Serializable {
private static final long serialVersionUID = 1L;
protected final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
public void addPropertyChangeListener(PropertyChangeListener listener) {
pcs.addPropertyChangeListener(listener);
}
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
pcs.addPropertyChangeListener(propertyName, listener);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
pcs.removePropertyChangeListener(listener);
}
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
pcs.removePropertyChangeListener(propertyName, listener);
}
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
pcs.firePropertyChange(propertyName, oldValue, newValue);
}
protected void firePropertyChange(String propertyName, Object newValue) {
firePropertyChange(propertyName, null, newValue);
}
protected T getChild(Collection list, int index) {
return CollectionUtil.getOrNull(list, index);
}
protected T getChild(List list, int index) {
return CollectionUtil.getOrNull(list, index);
}
}
You can globaly use it on the complete model or to a specific classifier.Copyright © 2012-2013 CodeLutin. All Rights Reserved.