ItemModel.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */
  20. package org.openspcoop2.core.mvc.properties.model;

  21. import org.openspcoop2.core.mvc.properties.Item;

  22. import org.openspcoop2.generic_project.beans.AbstractModel;
  23. import org.openspcoop2.generic_project.beans.IField;
  24. import org.openspcoop2.generic_project.beans.Field;
  25. import org.openspcoop2.generic_project.beans.ComplexField;


  26. /**    
  27.  * Model Item
  28.  *
  29.  * @author Poli Andrea (poli@link.it)
  30.  * @author $Author$
  31.  * @version $Rev$, $Date$
  32.  */
  33. public class ItemModel extends AbstractModel<Item> {

  34.     public ItemModel(){
  35.    
  36.         super();
  37.    
  38.         this.CONDITIONS = new org.openspcoop2.core.mvc.properties.model.ConditionsModel(new Field("conditions",org.openspcoop2.core.mvc.properties.Conditions.class,"item",Item.class));
  39.         this.VALUES = new org.openspcoop2.core.mvc.properties.model.ItemValuesModel(new Field("values",org.openspcoop2.core.mvc.properties.ItemValues.class,"item",Item.class));
  40.         this.PROPERTY = new org.openspcoop2.core.mvc.properties.model.PropertyModel(new Field("property",org.openspcoop2.core.mvc.properties.Property.class,"item",Item.class));
  41.         this.TYPE = new Field("type",java.lang.String.class,"item",Item.class);
  42.         this.NAME = new Field("name",java.lang.String.class,"item",Item.class);
  43.         this.LABEL = new Field("label",java.lang.String.class,"item",Item.class);
  44.         this.NOTE = new Field("note",java.lang.String.class,"item",Item.class);
  45.         this.REQUIRED = new Field("required",boolean.class,"item",Item.class);
  46.         this.RELOAD_ON_CHANGE = new Field("reloadOnChange",boolean.class,"item",Item.class);
  47.         this.DEFAULT = new Field("default",java.lang.String.class,"item",Item.class);
  48.         this.DEFAULT_SELECTED = new Field("defaultSelected",boolean.class,"item",Item.class);
  49.         this.VALUE = new Field("value",java.lang.String.class,"item",Item.class);
  50.         this.MIN = new Field("min",java.lang.Integer.class,"item",Item.class);
  51.         this.MAX = new Field("max",java.lang.Integer.class,"item",Item.class);
  52.         this.VALIDATION = new Field("validation",java.lang.String.class,"item",Item.class);
  53.    
  54.     }
  55.    
  56.     public ItemModel(IField father){
  57.    
  58.         super(father);
  59.    
  60.         this.CONDITIONS = new org.openspcoop2.core.mvc.properties.model.ConditionsModel(new ComplexField(father,"conditions",org.openspcoop2.core.mvc.properties.Conditions.class,"item",Item.class));
  61.         this.VALUES = new org.openspcoop2.core.mvc.properties.model.ItemValuesModel(new ComplexField(father,"values",org.openspcoop2.core.mvc.properties.ItemValues.class,"item",Item.class));
  62.         this.PROPERTY = new org.openspcoop2.core.mvc.properties.model.PropertyModel(new ComplexField(father,"property",org.openspcoop2.core.mvc.properties.Property.class,"item",Item.class));
  63.         this.TYPE = new ComplexField(father,"type",java.lang.String.class,"item",Item.class);
  64.         this.NAME = new ComplexField(father,"name",java.lang.String.class,"item",Item.class);
  65.         this.LABEL = new ComplexField(father,"label",java.lang.String.class,"item",Item.class);
  66.         this.NOTE = new ComplexField(father,"note",java.lang.String.class,"item",Item.class);
  67.         this.REQUIRED = new ComplexField(father,"required",boolean.class,"item",Item.class);
  68.         this.RELOAD_ON_CHANGE = new ComplexField(father,"reloadOnChange",boolean.class,"item",Item.class);
  69.         this.DEFAULT = new ComplexField(father,"default",java.lang.String.class,"item",Item.class);
  70.         this.DEFAULT_SELECTED = new ComplexField(father,"defaultSelected",boolean.class,"item",Item.class);
  71.         this.VALUE = new ComplexField(father,"value",java.lang.String.class,"item",Item.class);
  72.         this.MIN = new ComplexField(father,"min",java.lang.Integer.class,"item",Item.class);
  73.         this.MAX = new ComplexField(father,"max",java.lang.Integer.class,"item",Item.class);
  74.         this.VALIDATION = new ComplexField(father,"validation",java.lang.String.class,"item",Item.class);
  75.    
  76.     }
  77.    
  78.    

  79.     public org.openspcoop2.core.mvc.properties.model.ConditionsModel CONDITIONS = null;
  80.      
  81.     public org.openspcoop2.core.mvc.properties.model.ItemValuesModel VALUES = null;
  82.      
  83.     public org.openspcoop2.core.mvc.properties.model.PropertyModel PROPERTY = null;
  84.      
  85.     public IField TYPE = null;
  86.      
  87.     public IField NAME = null;
  88.      
  89.     public IField LABEL = null;
  90.      
  91.     public IField NOTE = null;
  92.      
  93.     public IField REQUIRED = null;
  94.      
  95.     public IField RELOAD_ON_CHANGE = null;
  96.      
  97.     public IField DEFAULT = null;
  98.      
  99.     public IField DEFAULT_SELECTED = null;
  100.      
  101.     public IField VALUE = null;
  102.      
  103.     public IField MIN = null;
  104.      
  105.     public IField MAX = null;
  106.      
  107.     public IField VALIDATION = null;
  108.      

  109.     @Override
  110.     public Class<Item> getModeledClass(){
  111.         return Item.class;
  112.     }
  113.    
  114.     @Override
  115.     public String toString(){
  116.         if(this.getModeledClass()!=null){
  117.             return this.getModeledClass().getName();
  118.         }else{
  119.             return "N.D.";
  120.         }
  121.     }

  122. }