Index: lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelArgumentsImpl.java diff -u /dev/null lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelArgumentsImpl.java:1.1 --- /dev/null Tue Aug 10 17:00:53 2004 +++ lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelArgumentsImpl.java Tue Aug 10 17:00:48 2004 @@ -0,0 +1,81 @@ +/* *##% +* Copyright (C) 2002, 2003 Code Lutin +* +* 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 2 +* 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. +* +* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*##%*/ + +/* * +* UIModelArgumentsImpl.java +* +* Created: Aug 9, 2004 +* +* @author Benjamin Poussin +* Copyright Code Lutin +* @version $Revision: 1.1 $ +* +* Mise a jour: $Date: 2004/08/10 17:00:48 $ +* par : $Author: mazelier $ +*/ + +package org.codelutin.generator.models.ui.impl; + +import org.codelutin.generator.models.ui.UIModelArguments; +import java.util.ArrayList; +import java.util.Iterator; + + +public class UIModelArgumentsImpl implements UIModelArguments{ // UIModelArgumentsImpl + + protected ArrayList arguments = new ArrayList(); + + /** + * Changes the arguments list. + * @param arguments - a new arguments list. + */ + public void setArguments(ArrayList arguments) { + this.arguments = arguments; + } + + /** + * Returns a arguments list. + * @return a arguments list. + */ + public ArrayList getArguments() { + return arguments; + } + + /** + * Add an argument to the arguments list + * @param arg - object argument + */ + public void addArgument(Object arg){ + arguments.add(arg); + } + + /** + * @return a string representation of the object + */ + public String toString(){ + String argString = "["; + for(Iterator i = arguments.iterator(); i.hasNext();){ + Object arg = i.next(); + argString = argString + ", " + arg.toString(); + } + argString = argString + "]"; + return argString; + } + +} // UIModelArgumentsImpl + Index: lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelChildImpl.java diff -u /dev/null lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelChildImpl.java:1.1 --- /dev/null Tue Aug 10 17:00:53 2004 +++ lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelChildImpl.java Tue Aug 10 17:00:48 2004 @@ -0,0 +1,94 @@ +/* *##% +* Copyright (C) 2002, 2003 Code Lutin +* +* 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 2 +* 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. +* +* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*##%*/ + +/* * +* UIModelChildImpl.java +* +* Created: Aug 9, 2004 +* +* @author Benjamin Poussin +* Copyright Code Lutin +* @version $Revision: 1.1 $ +* +* Mise a jour: $Date: 2004/08/10 17:00:48 $ +* par : $Author: mazelier $ +*/ + +package org.codelutin.generator.models.ui.impl; + +import org.codelutin.generator.models.ui.UIModelChild; +import org.codelutin.generator.models.ui.UIModelObject; +import org.codelutin.generator.models.ui.UIModelConstraint; + +public class UIModelChildImpl implements UIModelChild{ // UIModelChildImpl + + protected UIModelObject object = null; + protected UIModelConstraint constraint = null; + + /** + * Changes the UIModelObject for this child. + * @see UIModelObject + * + * @param object - a new UIModelObject + */ + public void setObject(UIModelObject object) { + this.object = object; + } + + /** + * Changes the UIModelConstraint for this child. + * @see UIModelConstraint + * + * @param constraint - a new UIModelConstraint + */ + public void setConstraint(UIModelConstraint constraint) { + this.constraint = constraint; + } + + /** + * Returns a UIModelObject for this child. + * @see UIModelObject + * + * @return a UIModelObject for this child. + */ + public UIModelObject getObject() { + return object; + } + + /** + * Returns a UIModelConstraint for this child. + * @see UIModelConstraint + * + * @return a UIModelConstraint for this child. + */ + public UIModelConstraint getConstraint() { + return constraint; + } + + /** + * @return a string representation of the object + */ + public String toString(){ + String childString = "[ child : "; + childString = childString + object.toString() + ", \n"; + childString = childString + "constraint : " + constraint.toString() + "]"; + return childString; + } + +} // UIModelChildImpl + Index: lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelConstraintImpl.java diff -u /dev/null lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelConstraintImpl.java:1.1 --- /dev/null Tue Aug 10 17:00:53 2004 +++ lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelConstraintImpl.java Tue Aug 10 17:00:48 2004 @@ -0,0 +1,80 @@ +/* *##% +* Copyright (C) 2002, 2003 Code Lutin +* +* 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 2 +* 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. +* +* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*##%*/ + +/* * +* UIModelConstraintImpl.java +* +* Created: Aug 9, 2004 +* +* @author Benjamin Poussin +* Copyright Code Lutin +* @version $Revision: 1.1 $ +* +* Mise a jour: $Date: 2004/08/10 17:00:48 $ +* par : $Author: mazelier $ +*/ + +package org.codelutin.generator.models.ui.impl; + +import org.codelutin.generator.models.ui.UIModelConstraint; + +public class UIModelConstraintImpl implements UIModelConstraint{ // UIModelConstraintImpl + + protected Object value = null; + + /** + * Changes the value of this constraint. + * the value can be an instance of UIModelObject + * or String or null + * @param value - the new value of this constraint. + */ + public void setValue(Object value) { + this.value = value; + } + + /** + * Returns the value of this constraint. + * the value returned can be an instance of UIModelObject + * or String or null + * @return the value of this constraint. + */ + public Object getValue() { + return value; + } + + /** + * Returns the value of this constraint + * if the type is String else returnnull + * + * @return the value of this constraint. + */ + public String getStringValue() { + if (value instanceof String) + return (String) value; + return null; + } + + /** + * @return a string representation of the object + */ + public String toString(){ + return value.toString(); + } + +} // UIModelConstraintImpl + Index: lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelEventImpl.java diff -u /dev/null lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelEventImpl.java:1.1 --- /dev/null Tue Aug 10 17:00:53 2004 +++ lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelEventImpl.java Tue Aug 10 17:00:48 2004 @@ -0,0 +1,137 @@ +/* *##% +* Copyright (C) 2002, 2003 Code Lutin +* +* 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 2 +* 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. +* +* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*##%*/ + +/* * +* UIModelEventImpl.java +* +* Created: Aug 9, 2004 +* +* @author Benjamin Poussin +* Copyright Code Lutin +* @version $Revision: 1.1 $ +* +* Mise a jour: $Date: 2004/08/10 17:00:48 $ +* par : $Author: mazelier $ +*/ + +package org.codelutin.generator.models.ui.impl; + +import org.codelutin.generator.models.ui.UIModelEvent; + +public class UIModelEventImpl implements UIModelEvent{ // UIModelEventImpl + + protected String addMethod = null; + protected String source = null; + protected String action = null; + protected String handler = null; + protected String argument = null; + + /** + * Changes the addListenerMethod of this event + * @param addMethod - the new addListenerMethod + */ + public void setAddMethod(String addMethod) { + this.addMethod = addMethod; + } + + /** + * Changes the listenerInterface of this event + * @param source - the new listenerInterface + */ + public void setSource(String source) { + this.source = source; + } + + /** + * Changes the listenerMethodName of this event + * @param action - the new listenerMethodName + */ + public void setAction(String action) { + this.action = action; + } + + /** + * Changes the handler of this event + * @param handler - the new handler + */ + public void setHandler(String handler) { + this.handler = handler; + } + + /** + * Changes the eventPropertyName of this event + * @param argument - the new eventPropertyName + */ + public void setArgument(String argument) { + this.argument = argument; + } + + /** + * Returns the addListenerMethod of this event + * @return addListenerMethod + */ + public String getAddMethod() { + return addMethod; + } + + /** + * Returns the listenerInterface of this event + * @return listenerInterface + */ + public String getSource() { + return source; + } + + /** + * Returns the listenerMethodName of this event + * @return listenerMethodName + */ + public String getAction() { + return action; + } + + /** + * Returns the handler of this event + * @return handler + */ + public String getHandler() { + return handler; + } + + /** + * Returns the eventPropertyName of this event + * @return eventPropertyName + */ + public String getArgument() { + return argument; + } + + /** + * @return a string representation of the object + */ + public String toString(){ + String eventString = "[ addMethod : " + addMethod + ", \n"; + eventString = eventString + "source " + source + ", \n"; + eventString = eventString + "action " + action + ", \n"; + eventString = eventString + "handler " + handler + ", \n"; + eventString = eventString + "argument : " + argument + " ]"; + return eventString; + } + +} // UIModelEventImpl + Index: lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelImpl.java diff -u /dev/null lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelImpl.java:1.1 --- /dev/null Tue Aug 10 17:00:53 2004 +++ lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelImpl.java Tue Aug 10 17:00:48 2004 @@ -0,0 +1,137 @@ +// UIModelImpl +/* *##% +* Copyright (C) 2002, 2003 Code Lutin +* +* 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 2 +* 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. +* +* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*##%*/ + +/* * +* UIModelImpl.java +* +* Created: Aug 6, 2004 +* +* @author Benjamin Poussin +* Copyright Code Lutin +* @version $Revision: 1.1 $ +* +* Mise a jour: $Date: 2004/08/10 17:00:48 $ +* par : $Author: mazelier $ +*/ + +package org.codelutin.generator.models.ui.impl; + +import org.codelutin.generator.models.ui.UIModel; +import org.codelutin.generator.models.ui.UIModelObject; +import java.util.Collection; + +public class UIModelImpl implements UIModel{ // UIModelImpl + + protected String version = null; + protected String packageName = null; + protected UIModelObject root = null; + protected Collection objects = null; + + /** + * Changes the version of this model + * @param version - version of this model + */ + public void setVersion(String version) { + this.version = version; + } + + /** + * Changes the package of this model + * @param packageName - package name + */ + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + /** + * Changes the object root defined in this model. + * @see UIModelObject + * @param root - object root + */ + public void setRoot(UIModelObject root) { + this.root = root; + } + + /** + * Changes all objects defined in this model. + * @param objects - all objects defined + */ + public void setObjects(Collection objects) { + this.objects = objects; + } + + /** + * Returns the version of this model. + * + * @return the version of this model. + */ + public String getVersion() { + return version; + } + + /** + * Returns the package of this model. + * + * @return the package of this model. + */ + public String getPackage() { + return packageName; + } + + /** + * Returns the object root defined in this ui model. + * @see UIModelObject + * + * @return the object root defined in this ui model. + */ + public UIModelObject getRoot() { + return root; + } + + /** + * Returns all objects defined in this ui model. + * @see UIModelObject + * + * @return a Collection containing all UIModelObjects for this ui model. + */ + public Collection getObjects() { + return objects; + } + + /** + * Method used to add objects in this model + * @see UIModelObject + * + */ + public void addObject(UIModelObject object){ + objects.add(object); + } + + /** + * @return a string representation of the object + */ + public String toString(){ + String modelString = "[ version : " + version + ", \n"; + modelString = modelString + "package " + packageName + ", \n"; + modelString = modelString + "root : " + root.toString() + " ]"; + return modelString; + } + +} // UIModelImpl + Index: lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelObjectImpl.java diff -u /dev/null lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelObjectImpl.java:1.1 --- /dev/null Tue Aug 10 17:00:53 2004 +++ lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelObjectImpl.java Tue Aug 10 17:00:48 2004 @@ -0,0 +1,305 @@ +/* *##% +* Copyright (C) 2002, 2003 Code Lutin +* +* 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 2 +* 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. +* +* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*##%*/ + +/* * +* UIModelObjectImpl.java +* +* Created: Aug 9, 2004 +* +* @author Benjamin Poussin +* Copyright Code Lutin +* @version $Revision: 1.1 $ +* +* Mise a jour: $Date: 2004/08/10 17:00:48 $ +* par : $Author: mazelier $ +*/ + +package org.codelutin.generator.models.ui.impl; + +import org.codelutin.generator.models.ui.*; +import java.util.Collection; +import java.util.Iterator; +import java.util.ArrayList; + +public class UIModelObjectImpl implements UIModelObject{ // UIModelObjectImpl + + // model et parent semblent inutiles dans cette implantation mais obligatoire pour l'heritage + protected UIModel model = null; + protected UIModelObject parent = null; + + protected String type = null; + + protected UIModelConstraint constraint = null; + + protected UIModelArguments arguments = null; + protected ArrayList properties = new ArrayList(); + protected ArrayList events = new ArrayList(); + protected ArrayList children = new ArrayList(); + + /** + * Changes the model of this object. + * @see UIModel + * + * @param model - the new model of this object. + */ + public void setModel(UIModel model) { + this.model = model; + } + + /** + * Changes the type of this object. + * + * @param type - the new type of this object. + */ + public void setType(String type) { + this.type = type; + } + + /** + * Changes the parent of this object. + * Returns null if this object is root + * @param parent - the parent of this object. + */ + public void setParent(UIModelObject parent){ + this.parent = parent; + } + + /** + * Changes the constraint of this object + * @see UIModelConstraint + * + * @param constraint - the new constraint of this object. + */ + public void setConstraint(UIModelConstraint constraint) { + this.constraint = constraint; + } + + /** + * Changes all arguments defined on this object. + * This collection can contain UIModelObject or a primitive type + * + * @param arguments - a Collection containing all arguments for this object. + */ + public void setArguments(UIModelArguments arguments) { + this.arguments = arguments; + } + + /** + * Changes all properties defined on this object. + * @see UIModelProperty + * + * @param properties - a Collection containing all UIModelProperty for this object. + */ + public void setProperties(ArrayList properties) { + this.properties = properties; + } + + /** + * Changes all events defined on this object. + * @see UIModelEvent + * + * @param events - a Collection containing all UIModelEvents for this object. + */ + public void setEvents(ArrayList events) { + this.events = events; + } + + /** + * Changes all children defined on this object. + * @see UIModelChild + * + * @param children - a Collection containing all UIModelChildren for this object. + */ + public void setChildren(ArrayList children) { + this.children = children; + } + + /** + * Returns the uimodel of this object. + * @see UIModel + * @deprecated + * @return the uimodel of this object. + */ + public UIModel getModel() { + return model; + } + + /** + * Returns the type of this object. + * + * @return the type of this object. + */ + public String getType() { + return type; + } + + /** + * Returns the value of the property "name" of this object + * + * @return the name of this object. + */ + public String getName() { + UIModelProperty propName = getProperty("name"); + if(propName!=null){ + return getProperty("name").getStringValue(); + }else{ + return null; + } + + } + + /** + * Returns the parent of this object. + * Returns null if this object is root + * @deprecated + * @return the parent of this object. + */ + public UIModelObject getParent() { + return parent; + } + + /** + * Returns the constraint of this object + * @see UIModelConstraint + * + * @return the constraint of this object. + */ + public UIModelConstraint getConstraint() { + return constraint; + } + + /** + * Returns all arguments defined on this object. + * This collection can contain UIModelObject or a primitive type + * + * @return a Collection containing all arguments for this object. + */ + public Collection getArguments() { + return arguments.getArguments(); + } + + /** + * Returns all properties defined on this object. + * @see UIModelProperty + * + * @return a Collection containing all UIModelProperty for this object. + */ + public Collection getProperties() { + return properties; + } + + /** + * Returns all events defined on this object. + * @see UIModelEvent + * + * @return a Collection containing all UIModelEvents for this object. + */ + public Collection getEvents() { + return events; + } + + /** + * Returns all children defined on this object. + * @see UIModelChild + * + * @return a Collection containing all UIModelChildren for this object. + */ + public Collection getChildren() { + return children; + } + + /** + * Returns the property defined on this object. + * @see UIModelProperty + * @param String the name of the property which must be returned + * @return a UIModelProperty for this object with the . + */ + public UIModelProperty getProperty(String name){ + Iterator i = properties.iterator(); + UIModelPropertyImpl prop = null; + boolean find = false; + while (i.hasNext() && find==false){ + prop = (UIModelPropertyImpl)i.next(); + if(name.equals(prop.getName())){ + find=true; + } + } + return prop; + } + + /** + * Add a UIModelProperty to the properties list + * @see UIModelProperty + * @param prop - a new UIModelProperty + */ + public void addProperty(UIModelProperty prop){ + properties.add(prop); + } + + /** + * Add a UIModelEvent to the events list + * @see UIModelEvent + * @param event - a new UIModelEvent + */ + public void addEvent(UIModelEvent event){ + events.add(event); + } + + /** + * Add a UIModelChild to the children list + * @see UIModelChild + * @param child - a new UIModelChild + */ + public void addChild(UIModelChild child){ + children.add(child); + } + + + /** + * @return a string representation of the object + */ + public String toString(){ + String objectString = "[ type : " + type + ", \n"; + objectString = objectString + "[ name : " + getName() + ", \n"; + + objectString = objectString + "[ arguments : " + arguments.toString() + ", \n"; + + objectString = objectString + "[ properties : " + "\n"; + for(Iterator i = properties.iterator(); i.hasNext();){ + Object prop = i.next(); + objectString = objectString + ", \n" + prop.toString(); + } + + objectString = objectString + "[ events : " + "\n"; + for(Iterator i = events.iterator(); i.hasNext();){ + Object event = i.next(); + objectString = objectString + ", \n" + event.toString(); + } + + objectString = objectString + "[ children : " + "\n"; + for(Iterator i = children.iterator(); i.hasNext();){ + Object child = i.next(); + objectString = objectString + ", \n" + child.toString(); + } + + objectString = objectString + "]"; + return objectString; + } + +} // UIModelObjectImpl + Index: lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelPropertyImpl.java diff -u /dev/null lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelPropertyImpl.java:1.1 --- /dev/null Tue Aug 10 17:00:53 2004 +++ lutingenerator/src/java/org/codelutin/generator/models/ui/impl/UIModelPropertyImpl.java Tue Aug 10 17:00:48 2004 @@ -0,0 +1,190 @@ +/* *##% +* Copyright (C) 2002, 2003 Code Lutin +* +* 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 2 +* 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. +* +* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*##%*/ + +/* * +* UIModelPropertyImpl.java +* +* Created: Aug 9, 2004 +* +* @author Benjamin Poussin +* Copyright Code Lutin +* @version $Revision: 1.1 $ +* +* Mise a jour: $Date: 2004/08/10 17:00:48 $ +* par : $Author: mazelier $ +*/ + +package org.codelutin.generator.models.ui.impl; + +import org.codelutin.generator.models.ui.UIModelProperty; + +public class UIModelPropertyImpl implements UIModelProperty{ // UIModelPropertyImpl + + protected String name; + protected UIModelArgumentsImpl arguments; + + /** + * Returns the name of this property. + * + * @return the name of this property. + */ + public String getName() { + return name; + } + + /** + * Returns the UIModelArgumentsImpl of this property. + * UIModelArgumentsImpl contains the arguments list + * @return UIModelArgumentsImpl + */ + public UIModelArgumentsImpl getArguments() { + return arguments; + } + + /** + * Returns the value of this property. + * the value returned can be an instance of UIModelObject + * or String or Integer or Boolean or Character + * @return the value of this property. + */ + public Object getValue() { + int i = (arguments.getArguments().size())-1; + return arguments.getArguments().get(i); + } + + /** + * Returns the index of this property if it's indexed property + * + * @return the index of this property. + */ + public int getIndex() throws Exception{ + if (isIndexed()) { + return ((Integer)arguments.getArguments().get(0)).intValue(); + } + throw new Exception("Impossible d'obtenir l'index d'une propriete non indexee"); + } + + /** + * Returns true if the property is indexed + * @return true if the property is indexed + */ + public boolean isIndexed() { + return arguments.getArguments().size() >= 2; + } + + /** + * Returns the value of this property if the type is int + * @return the value of this property. + */ + public int getIntValue() { + return ((Integer)getValue()).intValue(); + } + + /** + * Returns the value of this property if the type is boolean + * @return the value of this property. + */ + public boolean getBooleanValue() { + return ((Boolean)getValue()).booleanValue(); + } + + /** + * Returns the value of this property if the type is char + * @return the value of this property. + */ + public char getCharValue() { + return ((Character)getValue()).charValue(); + } + + /** + * Returns the value of this property if the type is String + * @return the value of this property. + */ + public String getStringValue() { + return getValue().toString(); + } + + /** + * Returns the value of this property if the type is byte + * @return the value of this property. + */ + public byte getByteValue() { + return ((Byte)getValue()).byteValue(); + } + + /** + * Returns the value of this property if the type is long + * @return the value of this property. + */ + public long getLongValue() { + return ((Long)getValue()).longValue(); + } + + /** + * Returns the value of this property if the type is short + * @return the value of this property. + */ + public short getShortValue() { + return ((Short)getValue()).shortValue(); + } + + /** + * Returns the value of this property if the type is float + * @return the value of this property. + */ + public float getFloatValue() { + return ((Float)getValue()).floatValue(); + } + + /** + * Returns the value of this property if the type is double + * @return the value of this property. + */ + public double getDoubleValue() { + return ((Double)getValue()).doubleValue(); + } + + /** + * Changes the name of this property. + * + * @param name - the new name of this property. + */ + public void setName(String name) { + this.name = name; + } + + /** + * Changes the UIModelArgumentsImpl of this property. + * UIModelArgumentsImpl contains the arguments list + * @param arguments - the new UIModelArgumentsImpl of this property. + */ + public void setArguments(UIModelArgumentsImpl arguments) { + this.arguments = arguments; + } + + /** + * @return a string representation of the object + */ + public String toString(){ + String propertyString = "[ name : " + getName() + ", \n"; + propertyString = propertyString + "[ arguments : " + arguments.toString() + " ]"; + return propertyString; + } + +} // UIModelPropertyImpl +