Index: lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelPropertyImpl.java diff -u lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelPropertyImpl.java:1.2 lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelPropertyImpl.java:1.3 --- lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelPropertyImpl.java:1.2 Wed Aug 11 16:27:42 2004 +++ lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelPropertyImpl.java Wed Sep 8 15:46:20 2004 @@ -23,15 +23,16 @@ * * @author Benjamin Poussin * Copyright Code Lutin -* @version $Revision: 1.2 $ +* @version $Revision: 1.3 $ * -* Mise a jour: $Date: 2004/08/11 16:27:42 $ +* Mise a jour: $Date: 2004/09/08 15:46:20 $ * par : $Author: mazelier $ */ package org.codelutin.generator.models.ui.impl; import org.codelutin.generator.models.ui.UIModelProperty; +import org.codelutin.generator.GeneratorException; public class UIModelPropertyImpl implements UIModelProperty{ // UIModelPropertyImpl @@ -63,8 +64,11 @@ * @return the value of this property. */ public Object getValue() { - int i = (arguments.getArguments().size())-1; - return arguments.getArguments().get(i); + int i = arguments.getArguments().size()-1; + if(i>=0){ + return arguments.getArguments().get(i); + } + return null; } /** @@ -92,7 +96,11 @@ * @return the value of this property. */ public int getIntValue() { - return ((Integer)getValue()).intValue(); + Object object = getValue(); + if(object!=null){ + return ((Integer)object).intValue(); + } + throw new GeneratorException("La propriete "+ name +" n'a pas de valeur" ); } /** @@ -100,7 +108,11 @@ * @return the value of this property. */ public boolean getBooleanValue() { - return ((Boolean)getValue()).booleanValue(); + Object object = getValue(); + if(object!=null){ + return ((Boolean)object).booleanValue(); + } + throw new GeneratorException("La propriete "+ name +" n'a pas de valeur" ); } /** @@ -108,7 +120,11 @@ * @return the value of this property. */ public char getCharValue() { - return ((Character)getValue()).charValue(); + Object object = getValue(); + if(object!=null){ + return ((Character)object).charValue(); + } + throw new GeneratorException("La propriete "+ name +" n'a pas de valeur" ); } /** @@ -116,7 +132,11 @@ * @return the value of this property. */ public String getStringValue() { - return getValue().toString(); + Object object = getValue(); + if(object!=null){ + return getValue().toString(); + } + throw new GeneratorException("La propriete "+ name +" n'a pas de valeur" ); } /** @@ -124,7 +144,11 @@ * @return the value of this property. */ public byte getByteValue() { - return ((Byte)getValue()).byteValue(); + Object object = getValue(); + if(object!=null){ + return ((Byte)object).byteValue(); + } + throw new GeneratorException("La propriete "+ name +" n'a pas de valeur" ); } /** @@ -132,7 +156,11 @@ * @return the value of this property. */ public long getLongValue() { - return ((Long)getValue()).longValue(); + Object object = getValue(); + if(object!=null){ + return ((Long)object).longValue(); + } + throw new GeneratorException("La propriete "+ name +" n'a pas de valeur" ); } /** @@ -140,7 +168,11 @@ * @return the value of this property. */ public short getShortValue() { - return ((Short)getValue()).shortValue(); + Object object = getValue(); + if(object!=null){ + return ((Short)object).shortValue(); + } + throw new GeneratorException("La propriete "+ name +" n'a pas de valeur" ); } /** @@ -148,7 +180,11 @@ * @return the value of this property. */ public float getFloatValue() { - return ((Float)getValue()).floatValue(); + Object object = getValue(); + if(object!=null){ + return ((Float)object).floatValue(); + } + throw new GeneratorException("La propriete "+ name +" n'a pas de valeur" ); } /** @@ -156,7 +192,11 @@ * @return the value of this property. */ public double getDoubleValue() { - return ((Double)getValue()).doubleValue(); + Object object = getValue(); + if(object!=null){ + return ((Double)object).doubleValue(); + } + throw new GeneratorException("La propriete "+ name +" n'a pas de valeur" ); } /**