Reference.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.message.soap.reference;

  21. import org.apache.commons.lang.StringEscapeUtils;

  22. /**
  23.  * Classe che rappresenta un elemento
  24.  *
  25.  * @author Lorenzo Nardi (nardi@link.it)
  26.  * @author $Author$
  27.  * @version $Rev$, $Date$
  28.  *
  29.  */

  30. public class Reference {
  31.    
  32.     public static final String REFERENCE_ATTACH = "Attach";
  33.     public static final String REFERENCE_CONTENT = "Content";
  34.     public static final String REFERENCE_ELEMENT = "Element";
  35.    
  36.     protected String reference;
  37.     protected int type;
  38.    

  39.     public Reference(int type, String reference) {
  40.         // Le reference possono essere escaped in xml se contengono caratteri speciali
  41.         this.reference = StringEscapeUtils.unescapeXml(reference);
  42.         this.type = type;
  43.     }
  44.    
  45.     public String getReference(){
  46.         return this.reference;
  47.     }
  48.    
  49.     public int getType(){
  50.         return this.type;
  51.     }
  52. }