All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nuiton.eugene.models.object.xml.ObjectModelParameterImpl Maven / Gradle / Ivy

/*
 * #%L
 * EUGene :: EUGene
 * 
 * $Id: ObjectModelParameterImpl.java 1014 2010-11-28 20:13:58Z tchemit $
 * $HeadURL: http://svn.nuiton.org/svn/eugene/tags/eugene-2.3.3/eugene/src/main/java/org/nuiton/eugene/models/object/xml/ObjectModelParameterImpl.java $
 * %%
 * Copyright (C) 2004 - 2010 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
 * .
 * #L%
 */

package org.nuiton.eugene.models.object.xml;

import org.nuiton.eugene.models.object.ObjectModelParameter;

/**
 * ObjectModelParameterImpl.
 * 
 * Created: 14 janv. 2004
 * 
 * @author Cédric Pineau  Copyright Code Lutin
 * 
 * @version $Revision: 1014 $
 * 
 * Last update : $Date: 2010-11-28 21:13:58 +0100 (dim, 28 nov 2010) $ by : */
public class ObjectModelParameterImpl extends ObjectModelElementImpl implements
        ObjectModelParameter {

    protected String type;
    protected int minMultiplicity = 1;
    protected int maxMultiplicity = 1;
//    protected String ordering = "unspecified";

    /**
     * FIXME tchemit 2010-11-28 Why the default value is true ?
     */
    protected boolean unique  = true;
    protected boolean ordered;
    protected String defaultValue;

    public static final String PROPERTY_ORDERED = "ordered";

    public ObjectModelParameterImpl() {
    }

    public void setType(String type) {
        this.type = type;
    }
    
    public void setMinMultiplicity(int minMultiplicity) {
        this.minMultiplicity = minMultiplicity;
    }

    public void setMaxMultiplicity(int maxMultiplicity) {
        this.maxMultiplicity = maxMultiplicity;
    }

    /**
     *
     * @param ordering
     */
    public void setOrdering(String ordering) {
        setOrdered(PROPERTY_ORDERED.equals(ordering));
//        this.ordering = ordering;
    }

    public void setUnique(boolean unique) {
        this.unique = unique;
    }

    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }

    @Override
    public String getType() {
        return type;
    }

    @Override
    public String getDefaultValue() {
        return defaultValue;
    }

    @Override
    public int getMinMultiplicity() {
        return minMultiplicity;
    }

    @Override
    public int getMaxMultiplicity() {
        return maxMultiplicity;
    }

    @Override
    public boolean isOrdered() {
        return ordered;
//        return "ordered".equals(ordering);
    }

    public void setOrdered(boolean ordered) {
        this.ordered = ordered;
    }

    @Override
    public boolean isUnique() {
        return unique;
    }

    @Override
    public String toString() {
        return getType() + " " + getName() + "<<" + getStereotypes()
                + ">> tagvalue: " + getTagValues();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy