View Javadoc
1   /*
2    * Copyright (c) 2002-2022, City of Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.plugins.forms.service.json;
35  
36  import java.util.ArrayList;
37  import java.util.List;
38  
39  import fr.paris.lutece.plugins.forms.business.Control;
40  import fr.paris.lutece.plugins.forms.business.ControlMapping;
41  import fr.paris.lutece.plugins.forms.business.Form;
42  import fr.paris.lutece.plugins.forms.business.FormDisplay;
43  import fr.paris.lutece.plugins.forms.business.FormMessage;
44  import fr.paris.lutece.plugins.forms.business.Group;
45  import fr.paris.lutece.plugins.forms.business.Question;
46  import fr.paris.lutece.plugins.forms.business.Step;
47  import fr.paris.lutece.plugins.forms.business.Transition;
48  import fr.paris.lutece.plugins.forms.business.export.FormExportConfig;
49  
50  public class FormJsonData
51  {
52  
53      private Form _form;
54      private FormMessage _formMessage;
55      private List<Step> _stepList;
56      private List<Group> _groupList;
57      private List<Question> _questionList;
58      private List<Transition> _transitionList;
59      private List<FormDisplay> _formDisplayList;
60      private List<Control> _controlList;
61      private List<ControlMapping> _controlMappingList;
62      private List<FormExportConfig> _formExportConfigList;
63  
64      /**
65       * @return the form
66       */
67      public Form getForm( )
68      {
69          return _form;
70      }
71  
72      /**
73       * @param form
74       *            the form to set
75       */
76      public void setForm( Form form )
77      {
78          _form = form;
79      }
80  
81      /**
82       * @return the stepList
83       */
84      public List<Step> getStepList( )
85      {
86          return new ArrayList<>( _stepList );
87      }
88  
89      /**
90       * @param stepList
91       *            the stepList to set
92       */
93      public void setStepList( List<Step> stepList )
94      {
95          _stepList = new ArrayList<>( stepList );
96      }
97  
98      /**
99       * @return the questionList
100      */
101     public List<Question> getQuestionList( )
102     {
103         return new ArrayList<>( _questionList );
104     }
105 
106     /**
107      * @param questionList
108      *            the questionList to set
109      */
110     public void setQuestionList( List<Question> questionList )
111     {
112         _questionList = new ArrayList<>( questionList );
113     }
114 
115     /**
116      * @return the transitionList
117      */
118     public List<Transition> getTransitionList( )
119     {
120         return new ArrayList<>( _transitionList );
121     }
122 
123     /**
124      * @param transitionList
125      *            the transitionList to set
126      */
127     public void setTransitionList( List<Transition> transitionList )
128     {
129         _transitionList = new ArrayList<>( transitionList );
130     }
131 
132     /**
133      * @return the formMessage
134      */
135     public FormMessage getFormMessage( )
136     {
137         return _formMessage;
138     }
139 
140     /**
141      * @param formMessage
142      *            the formMessage to set
143      */
144     public void setFormMessage( FormMessage formMessage )
145     {
146         _formMessage = formMessage;
147     }
148 
149     /**
150      * @return the formDisplayList
151      */
152     public List<FormDisplay> getFormDisplayList( )
153     {
154         return new ArrayList<>( _formDisplayList );
155     }
156 
157     /**
158      * @param formDisplayList
159      *            the formDisplayList to set
160      */
161     public void setFormDisplayList( List<FormDisplay> formDisplayList )
162     {
163         _formDisplayList = new ArrayList<>( formDisplayList );
164     }
165 
166     /**
167      * @return the groupList
168      */
169     public List<Group> getGroupList( )
170     {
171         return new ArrayList<>( _groupList );
172     }
173 
174     /**
175      * @param groupList
176      *            the groupList to set
177      */
178     public void setGroupList( List<Group> groupList )
179     {
180         _groupList = new ArrayList<>( groupList );
181     }
182 
183     /**
184      * @return the controlList
185      */
186     public List<Control> getControlList( )
187     {
188         return new ArrayList<>( _controlList );
189     }
190 
191     /**
192      * @param controlList
193      *            the controlQuestionList to set
194      */
195     public void setControlList( List<Control> controlList )
196     {
197         _controlList = new ArrayList<>( controlList );
198     }
199 
200     /**
201      * @return the controlMappingList
202      */
203     public List<ControlMapping> getControlMappingList( )
204     {
205         return new ArrayList<>( _controlMappingList );
206     }
207 
208     /**
209      * @param controlMappingList
210      *            the controlMappingList to set
211      */
212     public void setControlMappingList( List<ControlMapping> controlMappingList )
213     {
214         _controlMappingList = new ArrayList<>( controlMappingList );
215     }
216 
217     /**
218      * @return the formExportConfigList
219      */
220     public List<FormExportConfig> getFormExportConfigList( )
221     {
222         return new ArrayList<>( _formExportConfigList );
223     }
224 
225     /**
226      * @param formExportConfigList
227      *            the formExportConfigList to set
228      */
229     public void setFormExportConfigList( List<FormExportConfig> formExportConfigList )
230     {
231         _formExportConfigList = new ArrayList<>( formExportConfigList );
232     }
233 
234 }