AbstractCommonFieldValueBaseExpressionImpl.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.generic_project.expression.impl;

  21. import java.util.ArrayList;
  22. import java.util.List;

  23. import org.openspcoop2.generic_project.beans.IField;
  24. import org.openspcoop2.generic_project.exception.ExpressionException;
  25. import org.openspcoop2.generic_project.exception.ExpressionNotImplementedException;
  26. import org.openspcoop2.generic_project.expression.impl.formatter.IObjectFormatter;

  27. /**
  28.  * AbstractCommonBaseExpressionImpl
  29.  *
  30.  * @author Poli Andrea (apoli@link.it)
  31.  * @author $Author$
  32.  * @version $Rev$, $Date$
  33.  */
  34. public abstract class AbstractCommonFieldValueBaseExpressionImpl extends AbstractCommonFieldBaseExpressionImpl {

  35.     protected String value;
  36.    
  37.     protected AbstractCommonFieldValueBaseExpressionImpl(IObjectFormatter objectFormatter,IField field,String value){
  38.         super(objectFormatter, field);
  39.         this.value = value;
  40.     }
  41.    
  42.     public String getValue() {
  43.         return this.value;
  44.     }

  45.     public void setValue(String value) {
  46.         this.value = value;
  47.     }
  48.    
  49.     @Override
  50.     public List<Object> getFieldValues(IField field) throws ExpressionNotImplementedException, ExpressionException{
  51.         List<Object> lista = null;
  52.         if(this.field==null){
  53.             return lista;
  54.         }
  55.         if(this.field.equals(field)){
  56.             lista = new ArrayList<>();
  57.             lista.add(this.value);
  58.             return lista;
  59.         }
  60.         return lista;
  61.     }
  62.    
  63. }