Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.nuiton.eugene.java;
  
  /*
   * #%L
   * EUGene :: Java templates
   * $Id: JavaTemplatesTagValues.java 1204 2012-11-13 10:29:53Z tchemit $
   * $HeadURL: http://svn.nuiton.org/svn/eugene/tags/eugene-2.6.1/eugene-java-templates/src/main/java/org/nuiton/eugene/java/JavaTemplatesTagValues.java $
   * %%
   * Copyright (C) 2012 CodeLutin
  * %%
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as 
  * published by the Free Software Foundation, either version 3 of the 
  * License, or (at your option) any later version.
  * 
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Lesser Public License for more details.
  * 
  * You should have received a copy of the GNU General Lesser Public 
  * License along with this program.  If not, see
  * <http://www.gnu.org/licenses/lgpl-3.0.html>.
  * #L%
  */
 
Defines all tag values managed by Java templates.

Author(s):
tchemit <chemit@codelutin.com>
Since:
2.5.6
 
 public interface JavaTemplatesTagValues extends EugeneTagValues {

    
Tag value to set if do not want any pcs (says PropertyChangeSupport in a generated bean).

You can globaly use it on the complete model or to a specific classifier.

Since:
2.5.6
See also:
JavaTemplatesGeneratorUtil.getNoPCSTagValue(ObjectModel, ObjectModelClassifier)
 
             target = {ObjectModel.classObjectModelClassifier.class},
             documentation = "To specify to not generate any propertyChange " +
                             "code for a class or any class of a model")
     String TAG_NO_PCS = "noPCS";

    
Tag value to use a super class for generated bean.

If the bean needs Property change support (says you do not add the 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> T getChild(Collection<T> list, int index) {
         return CollectionUtil.getOrNull(list, index);
     }

     protected <T> T getChild(List<T> list, int index) {
         return CollectionUtil.getOrNull(list, index);
     }
 }
 

You can globaly use it on the complete model or to a specific classifier.

Since:
2.5.6
See also:
JavaTemplatesGeneratorUtil.getBeanSuperClassTagValue(ObjectModel, ObjectModelClassifier)
            target = {ObjectModel.classObjectModelClassifier.class},
            documentation = "To specify a super-class to used on generated bean " +
                            "for a class or any class of a model")
    String TAG_BEAN_SUPER_CLASS = "beanSuperClass";
New to GrepCode? Check out our FAQ X