Index: AbstractJDynFormField.java
===================================================================
--- AbstractJDynFormField.java	(revision 1404)
+++ AbstractJDynFormField.java	(revision 1405)
@@ -3,23 +3,22 @@
  *
  * Copyright (C) 2007-2013 gvSIG Association.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU 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 free software; you can redistribute it and/or modify it under
+ * the terms of the GNU 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 Public License for more details.
+ * 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 Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * For any additional information, do not hesitate to contact us
- * at info AT gvsig.com, or visit our website www.gvsig.com.
+ * For any additional information, do not hesitate to contact us at info AT
+ * gvsig.com, or visit our website www.gvsig.com.
  */
 package org.gvsig.tools.dynform.spi.dynformfield;
 
@@ -51,328 +50,344 @@
 import org.gvsig.tools.dynform.spi.DynFormSPIManager;
 import org.gvsig.tools.dynobject.DynField_v2;
 import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.dynobject.Tags;
 import org.gvsig.tools.service.Manager;
 import org.gvsig.tools.service.spi.ServiceManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @SuppressWarnings({"rawtypes", "unchecked"})
-public abstract class AbstractJDynFormField implements JDynFormField{
+public abstract class AbstractJDynFormField implements JDynFormField {
 
-	protected static final Logger logger = LoggerFactory
-			.getLogger(AbstractJDynFormField.class);
-	
-	private DynFormSPIManager manager = null;
-	private DynFormFieldDefinition definition = null;
-	private JLabel jlabel = null;
-	private JPanel jlabelpanel = null;
-	private Set listeners = null;
-	private JProblemIndicator problemIndicator = null;
+    protected static final Logger logger = LoggerFactory
+            .getLogger(AbstractJDynFormField.class);
 
-	protected DynObject parameters = null;
-	protected JComponent contents = null;
+    private DynFormSPIManager manager = null;
+    private DynFormFieldDefinition definition = null;
+    private JLabel jlabel = null;
+    private JPanel jlabelpanel = null;
+    private Set listeners = null;
+    private JProblemIndicator problemIndicator = null;
 
-	private boolean readOnly = false;
-	private List customActions;
-	protected boolean emptyToNull = false;
+    protected DynObject parameters = null;
+    protected JComponent contents = null;
+
+    private boolean readOnly = false;
+    private final List customActions;
+    protected boolean emptyToNull = false;
     private JDynForm form;
 
+    public AbstractJDynFormField(DynObject parameters,
+            ServiceManager serviceManager) {
+        this.parameters = parameters;
+        this.manager = (DynFormSPIManager) serviceManager;
+        this.definition = this.getDefinition();
+        this.listeners = new HashSet();
+        this.readOnly = this.definition.isReadOnly();
+        this.problemIndicator = this.manager.createProblemIndicator(this);
+        this.customActions = new ArrayList<>();
+        this.loadDefaultValuesFromTags(definition.getTags());
+    }
 
-	public AbstractJDynFormField(DynObject parameters,
-			ServiceManager serviceManager) {
-		this.parameters = parameters;
-		this.manager = (DynFormSPIManager) serviceManager;
-		this.definition = this.getDefinition();
-		this.listeners = new HashSet();
-		this.readOnly = this.definition.isReadOnly();
-		this.problemIndicator = this.manager.createProblemIndicator(this);
-		this.customActions = new ArrayList<Action>();
-	}
+    public void loadDefaultValuesFromTags(Tags tags) {
+        try {
+            this.readOnly = tags.getBoolean(DynFormSPIManager.TAG_DYNFORM_READONLY);
+        } catch (CoercionException ex) {
+        }
+        try {
+            this.emptyToNull = tags.getBoolean(DynFormSPIManager.TAG_DYNFORM_TRANSLATE_EMPTY_TO_NULL);
+        } catch (CoercionException ex) {
+        }
+    }
 
-	public abstract void initComponent();
-	public abstract Object getAssignedValue();
+    public abstract void initComponent();
 
-	public Object getParameterValue() {
-		return this.parameters.getDynValue(DynFormSPIManager.FIELD_VALUE);
-	}
+    public abstract Object getAssignedValue();
 
-	public JComponent asJComponent() {
-		if (this.contents == null) {
-			this.initComponent();
-			if(!this.customActions.isEmpty()){
-				addPopupComponents();
-			}
-			if( this.readOnly ) {
-				this.setReadOnly(readOnly);
-			}
-		}
-		return this.contents;
-	}
+    public Object getParameterValue() {
+        return this.parameters.getDynValue(DynFormSPIManager.FIELD_VALUE);
+    }
 
-	public String getName() {
-		return this.definition.getName();
-	}
+    @Override
+    public JComponent asJComponent() {
+        if (this.contents == null) {
+            this.initComponent();
+            if (!this.customActions.isEmpty()) {
+                addPopupComponents();
+            }
+            if (this.readOnly) {
+                this.setReadOnly(readOnly);
+            }
+        }
+        return this.contents;
+    }
 
-	public String getLabel() {
-		if(definition.getLabel() != null)
-			return definition.getLabel();
-		else
-			return this.getName();
-	}
+    public String getName() {
+        return this.definition.getName();
+    }
 
-	public JComponent getJLabel() {
-		if (this.jlabel == null) {
-                        if( getTagValueAsBoolean("dynform.label.empty", false) ) {
-                            this.jlabel = new JLabel("");
-                        } else {
-                            this.jlabel = new JLabel(this.getLabel());
-                        }
-			this.jlabel.setLabelFor(this.contents);
-			if( this.getDefinition().isMandatory() ) {
-				this.jlabel.setForeground(Color.red.darker());
-			}
-			this.jlabelpanel = new JPanel();
-			this.jlabelpanel.setLayout(new BorderLayout());
-			this.jlabelpanel.add(jlabel,BorderLayout.CENTER);
-			this.jlabelpanel.add(problemIndicator.asJComponent(), BorderLayout.LINE_END);
-		}
-		return this.jlabelpanel;
-	}
+    public String getLabel() {
+        if (definition.getLabel() != null) {
+            return definition.getLabel();
+        } else {
+            return this.getName();
+        }
+    }
 
-	public DynFormFieldDefinition getDefinition() {
-		return (DynFormFieldDefinition) this.parameters
-				.getDynValue(DynFormSPIManager.FIELD_FIELDDEFINITION);
-	}
+    public JComponent getJLabel() {
+        if (this.jlabel == null) {
+            if (getTagValueAsBoolean(DynFormSPIManager.TAG_DYNFORM_LABEL_EMPTY, false)) {
+                this.jlabel = new JLabel("");
+            } else {
+                this.jlabel = new JLabel(this.getLabel());
+            }
+            this.jlabel.setLabelFor(this.contents);
+            if (this.getDefinition().isMandatory()) {
+                this.jlabel.setForeground(Color.red.darker());
+            }
+            this.jlabelpanel = new JPanel();
+            this.jlabelpanel.setLayout(new BorderLayout());
+            this.jlabelpanel.add(jlabel, BorderLayout.CENTER);
+            this.jlabelpanel.add(problemIndicator.asJComponent(), BorderLayout.LINE_END);
+        }
+        return this.jlabelpanel;
+    }
 
-	public Manager getManager() {
-		return this.manager;
-	}
-	
-	public DynFormSPIManager getServiceManager(){
-		return this.manager;
-	}
+    public DynFormFieldDefinition getDefinition() {
+        return (DynFormFieldDefinition) this.parameters
+                .getDynValue(DynFormSPIManager.FIELD_FIELDDEFINITION);
+    }
 
-	public void addListener(JDynFormFieldListener listener) {
-		this.listeners.add(listener);
-	}
+    public Manager getManager() {
+        return this.manager;
+    }
 
-	public void removeListener(JDynFormFieldListener listener) {
-		this.listeners.remove(listener);
-	}
-	
-	protected void fireFieldChangedEvent() {
-		Iterator it = this.listeners.iterator();
-		while (it.hasNext()) {
-			JDynFormFieldListener listener = (JDynFormFieldListener) it.next();
-			try {
-				listener.fieldChanged(this);
-			} catch (Exception ex) {
-				logger.info("Error calling listener " + listener.toString()
-						+ "(" + listener.getClass().getName() + ") from "
-						+ this.toString() + "(" + this.getClass().getName()
-						+ ").", ex);
-			}
-		}
-	}
+    public DynFormSPIManager getServiceManager() {
+        return this.manager;
+    }
 
-	protected void fireFieldEnterEvent() {
-		Iterator it = this.listeners.iterator();
-		while (it.hasNext()) {
-			JDynFormFieldListener listener = (JDynFormFieldListener) it.next();
-			try {
-				listener.fieldEnter(this);
-			} catch (Exception ex) {
-				logger.info("Error calling listener " + listener.toString()
-						+ "(" + listener.getClass().getName() + ") from "
-						+ this.toString() + "(" + this.getClass().getName()
-						+ ").", ex);
-			}
-		}
-	}
+    public void addListener(JDynFormFieldListener listener) {
+        this.listeners.add(listener);
+    }
 
-	protected void fireFieldExitEvent() {
-		Iterator it = this.listeners.iterator();
-		while (it.hasNext()) {
-			JDynFormFieldListener listener = (JDynFormFieldListener) it.next();
-			try {
-				listener.fieldExit(this);
-			} catch (Exception ex) {
-				logger.info("Error calling listener " + listener.toString()
-						+ "(" + listener.getClass().getName() + ") from "
-						+ this.toString() + "(" + this.getClass().getName()
-						+ ").", ex);
-			}
-		}
-	}
-	
-	public void fireMessageEvent(String message) {
-		Iterator it = this.listeners.iterator();
-		while (it.hasNext()) {
-			JDynFormFieldListener listener = (JDynFormFieldListener) it.next();
-			try {
-				listener.message(this, message);
-			} catch (Exception ex) {
-				logger.info("Error calling listener " + listener.toString()
-						+ "(" + listener.getClass().getName() + ") from "
-						+ this.toString() + "(" + this.getClass().getName()
-						+ ").", ex);
-			}
-		}
-	}
+    public void removeListener(JDynFormFieldListener listener) {
+        this.listeners.remove(listener);
+    }
 
-	public boolean isReadOnly() {
-		return this.readOnly ;
-	}
-	
-	public void setReadOnly(boolean readonly) {
+    protected void fireFieldChangedEvent() {
+        Iterator it = this.listeners.iterator();
+        while (it.hasNext()) {
+            JDynFormFieldListener listener = (JDynFormFieldListener) it.next();
+            try {
+                listener.fieldChanged(this);
+            } catch (Exception ex) {
+                logger.info("Error calling listener " + listener.toString()
+                        + "(" + listener.getClass().getName() + ") from "
+                        + this.toString() + "(" + this.getClass().getName()
+                        + ").", ex);
+            }
+        }
+    }
+
+    protected void fireFieldEnterEvent() {
+        Iterator it = this.listeners.iterator();
+        while (it.hasNext()) {
+            JDynFormFieldListener listener = (JDynFormFieldListener) it.next();
+            try {
+                listener.fieldEnter(this);
+            } catch (Exception ex) {
+                logger.info("Error calling listener " + listener.toString()
+                        + "(" + listener.getClass().getName() + ") from "
+                        + this.toString() + "(" + this.getClass().getName()
+                        + ").", ex);
+            }
+        }
+    }
+
+    protected void fireFieldExitEvent() {
+        Iterator it = this.listeners.iterator();
+        while (it.hasNext()) {
+            JDynFormFieldListener listener = (JDynFormFieldListener) it.next();
+            try {
+                listener.fieldExit(this);
+            } catch (Exception ex) {
+                logger.info("Error calling listener " + listener.toString()
+                        + "(" + listener.getClass().getName() + ") from "
+                        + this.toString() + "(" + this.getClass().getName()
+                        + ").", ex);
+            }
+        }
+    }
+
+    public void fireMessageEvent(String message) {
+        Iterator it = this.listeners.iterator();
+        while (it.hasNext()) {
+            JDynFormFieldListener listener = (JDynFormFieldListener) it.next();
+            try {
+                listener.message(this, message);
+            } catch (Exception ex) {
+                logger.info("Error calling listener " + listener.toString()
+                        + "(" + listener.getClass().getName() + ") from "
+                        + this.toString() + "(" + this.getClass().getName()
+                        + ").", ex);
+            }
+        }
+    }
+
+    public boolean isReadOnly() {
+        return this.readOnly;
+    }
+
+    public void setReadOnly(boolean readonly) {
 		// FIXME: Implememtacion por defecto, sobreescribirla en las subclases
-		// segun convenga para cada componente.
-		JTextComponent x = null;
-				
-		this.readOnly = readonly;
-		if(jlabel != null){
-			this.jlabel.setEnabled(!readonly);
-		}
-		if( this.contents != null ) {
-			if( this.contents instanceof JTextComponent ) {
-				x = (JTextComponent) this.contents;
-				x.setEditable(!readonly);
-			} else if( this.contents instanceof JScrollPane ) {
-				try {
-					JViewport port = ((JScrollPane)this.contents).getViewport();
-					x = (JTextComponent)  port.getView();
-					x.setEditable(!readonly);
-				} catch(Exception ex) {
-					this.contents.setEnabled(!readOnly);
-				}
-			} else {
-				this.contents.setEnabled(!readOnly);
-			}
-		}
-	}
+        // segun convenga para cada componente.
+        JTextComponent x = null;
 
-	public JProblemIndicator problemIndicator() {
-		return this.problemIndicator;
-	}
+        this.readOnly = readonly;
+        if (jlabel != null) {
+            this.jlabel.setEnabled(!readonly);
+        }
+        if (this.contents != null) {
+            if (this.contents instanceof JTextComponent) {
+                x = (JTextComponent) this.contents;
+                x.setEditable(!readonly);
+            } else if (this.contents instanceof JScrollPane) {
+                try {
+                    JViewport port = ((JScrollPane) this.contents).getViewport();
+                    x = (JTextComponent) port.getView();
+                    x.setEditable(!readonly);
+                } catch (Exception ex) {
+                    this.contents.setEnabled(!readOnly);
+                }
+            } else {
+                this.contents.setEnabled(!readOnly);
+            }
+        }
+    }
 
-	public class IllegalFieldValue extends RuntimeException {
-		
-		/**
-		 * 
-		 */
-		private static final long serialVersionUID = -4409236610055983438L;
+    public JProblemIndicator problemIndicator() {
+        return this.problemIndicator;
+    }
 
-		public IllegalFieldValue(JDynFormField field, String message) {
-			super("The value of field '"+field.getLabel()+"' is not valid. " + message);
-		}
-	}
-	
-	public String toString() {
-		return super.toString() + "{" + this.getName() + "}";
-	}
-	
-	public boolean isModified() {
-		boolean modified = false;
-		try {
-			if( !this.isReadOnly() ) {
-				Object value = this.getValue();
-				if( value == null ) {
-					if( value != this.getAssignedValue() ) {
-						modified = true;
-					}
-				} else {
-					if( ! value.equals(this.getAssignedValue()) ) {
-						modified = true;
-					}
-				}
-			}
-		} catch(IllegalFieldValue ex) {
-			// Si es incorrecto el valor del campo decimos a capom que esta modificado.
-			modified = true;
-		}
-		return modified;
-	}
-	
-	private void addPopupComponents(){
-		Iterator it = this.customActions.iterator();
-		while(it.hasNext()){
-			Object obj = it.next();
-			if(obj!=null){
-				Action act = (Action) obj;
-				if(contents instanceof SupportPopupMenu) {
-					DynFormFieldAction sact = new DynFormFieldAction(this, act);
-					((SupportPopupMenu) this.contents).addActionToPopupMenu(
-						sact.getName(), 
-						sact);
-				}
-			}else{
-				if(contents instanceof SupportPopupMenu) {
-					((SupportPopupMenu) this.contents).addSeparatorToPopupMenu();
-				}	
-			}
-			
-		}
-	}
+    public class IllegalFieldValue extends RuntimeException {
 
-	public void addActionToPopupMenu(String name, Action action) {
-		if(contents != null){
-			if(contents instanceof SupportPopupMenu ) {
-				DynFormFieldAction sact = new DynFormFieldAction(this,action);
-				((SupportPopupMenu) this.contents).addActionToPopupMenu(
-						sact.getName(), 
-						sact);
-			}
-		}else{
-			this.customActions.add(action);
-		}
-	}
+        /**
+         *
+         */
+        private static final long serialVersionUID = -4409236610055983438L;
 
-	public void addSeparatorToPopupMenu() {
-		if(contents != null){
-			if( contents instanceof SupportPopupMenu ) {
-				((SupportPopupMenu) this.contents).addSeparatorToPopupMenu();
-			}
-		}else{
-			this.customActions.add(null);
-		}
-	}
-	
-	public void setTranslateEmptyToNull(boolean emptyToNull) {
-	  this.emptyToNull = emptyToNull;
-	}
-	
-	public boolean translateEmptyToNull() {
-	  return this.emptyToNull;
-	}
+        public IllegalFieldValue(JDynFormField field, String message) {
+            super("The value of field '" + field.getLabel() + "' is not valid. " + message);
+        }
+    }
 
+    public String toString() {
+        return super.toString() + "{" + this.getName() + "}";
+    }
+
+    public boolean isModified() {
+        boolean modified = false;
+        try {
+            if (!this.isReadOnly()) {
+                Object value = this.getValue();
+                if (value == null) {
+                    if (value != this.getAssignedValue()) {
+                        modified = true;
+                    }
+                } else {
+                    if (!value.equals(this.getAssignedValue())) {
+                        modified = true;
+                    }
+                }
+            }
+        } catch (IllegalFieldValue ex) {
+            // Si es incorrecto el valor del campo decimos a capom que esta modificado.
+            modified = true;
+        }
+        return modified;
+    }
+
+    private void addPopupComponents() {
+        Iterator it = this.customActions.iterator();
+        while (it.hasNext()) {
+            Object obj = it.next();
+            if (obj != null) {
+                Action act = (Action) obj;
+                if (contents instanceof SupportPopupMenu) {
+                    DynFormFieldAction sact = new DynFormFieldAction(this, act);
+                    ((SupportPopupMenu) this.contents).addActionToPopupMenu(
+                            sact.getName(),
+                            sact);
+                }
+            } else {
+                if (contents instanceof SupportPopupMenu) {
+                    ((SupportPopupMenu) this.contents).addSeparatorToPopupMenu();
+                }
+            }
+
+        }
+    }
+
+    public void addActionToPopupMenu(String name, Action action) {
+        if (contents != null) {
+            if (contents instanceof SupportPopupMenu) {
+                DynFormFieldAction sact = new DynFormFieldAction(this, action);
+                ((SupportPopupMenu) this.contents).addActionToPopupMenu(
+                        sact.getName(),
+                        sact);
+            }
+        } else {
+            this.customActions.add(action);
+        }
+    }
+
+    public void addSeparatorToPopupMenu() {
+        if (contents != null) {
+            if (contents instanceof SupportPopupMenu) {
+                ((SupportPopupMenu) this.contents).addSeparatorToPopupMenu();
+            }
+        } else {
+            this.customActions.add(null);
+        }
+    }
+
+    public void setTranslateEmptyToNull(boolean emptyToNull) {
+        this.emptyToNull = emptyToNull;
+    }
+
+    public boolean translateEmptyToNull() {
+        return this.emptyToNull;
+    }
+
+    @SuppressWarnings("UnnecessaryReturnStatement")
     public void clear() {
-        if( this.contents == null ) {
+        if (this.contents == null) {
             return;
         }
-        if( this.contents instanceof JTextField ) {
+        if (this.contents instanceof JTextField) {
             Object value = this.getDefinition().getDefaultValue();
-            if( value != null ) {
+            if (value != null) {
                 value = value.toString();
             } else {
                 value = "";
             }
-            ((JTextField)this.contents).setText((String)value);
+            ((JTextField) this.contents).setText((String) value);
             return;
         }
-        if( this.contents instanceof JSpinner ) {
+        if (this.contents instanceof JSpinner) {
             Object value = this.getDefinition().getDefaultValue();
-            if( value != null ) {
+            if (value != null) {
                 value = value.toString();
             }
-            ((JSpinner)this.contents).setValue(value);
+            ((JSpinner) this.contents).setValue(value);
             return;
         }
-        if( this.contents instanceof JList ) {
-            ((JList)this.contents).setSelectedIndex(-1);
+        if (this.contents instanceof JList) {
+            ((JList) this.contents).setSelectedIndex(-1);
             return;
         }
-        if( this.contents instanceof JComboBox ) {
-            ((JComboBox)this.contents).setSelectedIndex(-1);
+        if (this.contents instanceof JComboBox) {
+            ((JComboBox) this.contents).setSelectedIndex(-1);
             return;
         }
     }
@@ -380,21 +395,28 @@
     public void setForm(JDynForm form) {
         this.form = form;
     }
-    
+
+    @Override
     public JDynForm getForm() {
         return this.form;
     }
 
+    @Override
+    public void fetch(DynObject container) {
+        Object value = this.getValue();
+        container.setDynValue(this.getName(), value);
+    }
+
     protected int getTagValueAsInt(String tagname, int defaultVaue) {
         return getTagValueAsInt(tagname, null, defaultVaue);
     }
 
     protected int getTagValueAsInt(String tagname1, String tagname2, int defaultVaue) {
-        DynField_v2 fielddef = (DynField_v2)this.getDefinition();                
+        DynField_v2 fielddef = (DynField_v2) this.getDefinition();
         String tagname = null;
-        if( fielddef.getTags().has(tagname1) ) {
+        if (fielddef.getTags().has(tagname1)) {
             tagname = tagname1;
-        } else if( fielddef.getTags().has(tagname2) ) {
+        } else if (fielddef.getTags().has(tagname2)) {
             tagname = tagname2;
         } else {
             return defaultVaue;
@@ -403,21 +425,21 @@
             int value = fielddef.getTags().getInt(tagname);
             return value;
         } catch (CoercionException ex) {
-            logger.warn("Can't parse tag '"+tagname+"' as int for field '"+fielddef.getName()+"'.",ex);
+            logger.warn("Can't parse tag '" + tagname + "' as int for field '" + fielddef.getName() + "'.", ex);
         }
         return defaultVaue;
     }
-    
+
     protected boolean getTagValueAsBoolean(String tagname, boolean defaultVaue) {
         return getTagValueAsBoolean(tagname, null, defaultVaue);
     }
-    
+
     protected boolean getTagValueAsBoolean(String tagname1, String tagname2, boolean defaultVaue) {
-        DynField_v2 fielddef = (DynField_v2)this.getDefinition();                
+        DynField_v2 fielddef = (DynField_v2) this.getDefinition();
         String tagname = null;
-        if( fielddef.getTags().has(tagname1) ) {
+        if (fielddef.getTags().has(tagname1)) {
             tagname = tagname1;
-        } else if( fielddef.getTags().has(tagname2) ) {
+        } else if (fielddef.getTags().has(tagname2)) {
             tagname = tagname2;
         } else {
             return defaultVaue;
@@ -426,32 +448,32 @@
             boolean value = fielddef.getTags().getBoolean(tagname);
             return value;
         } catch (CoercionException ex) {
-            logger.warn("Can't parse tag '"+tagname+"' as boolean for field '"+fielddef.getName()+"'.",ex);
+            logger.warn("Can't parse tag '" + tagname + "' as boolean for field '" + fielddef.getName() + "'.", ex);
         }
         return defaultVaue;
     }
-    
+
     protected String getTagValueAsString(String tagname, String defaultVaue) {
         return getTagValueAsString(tagname, null, defaultVaue);
     }
-    
+
     protected String getTagValueAsString(String tagname1, String tagname2, String defaultVaue) {
-        DynField_v2 fielddef = (DynField_v2)this.getDefinition();                
+        DynField_v2 fielddef = (DynField_v2) this.getDefinition();
         String tagname = null;
-        if( fielddef.getTags().has(tagname1) ) {
+        if (fielddef.getTags().has(tagname1)) {
             tagname = tagname1;
-        } else if( fielddef.getTags().has(tagname2) ) {
+        } else if (fielddef.getTags().has(tagname2)) {
             tagname = tagname2;
         } else {
             return defaultVaue;
         }
         try {
-            String value = (String) fielddef.getTags().get(tagname,DataTypes.STRING);
+            String value = (String) fielddef.getTags().get(tagname, DataTypes.STRING);
             return value;
         } catch (CoercionException ex) {
-            logger.warn("Can't parse tag '"+tagname+"' as string for field '"+fielddef.getName()+"'.",ex);
+            logger.warn("Can't parse tag '" + tagname + "' as string for field '" + fielddef.getName() + "'.", ex);
         }
         return defaultVaue;
     }
-    
+
 }
