View Javadoc
1   /*
2    * Copyright (c) 2002-2025, 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.ControlGroup;
41  import fr.paris.lutece.plugins.forms.business.ControlMapping;
42  import fr.paris.lutece.plugins.forms.business.Form;
43  import fr.paris.lutece.plugins.forms.business.FormDisplay;
44  import fr.paris.lutece.plugins.forms.business.FormMessage;
45  import fr.paris.lutece.plugins.forms.business.Group;
46  import fr.paris.lutece.plugins.forms.business.Question;
47  import fr.paris.lutece.plugins.forms.business.Step;
48  import fr.paris.lutece.plugins.forms.business.Transition;
49  import fr.paris.lutece.plugins.forms.business.export.FormExportConfig;
50  
51  public class FormJsonData
52  {
53  
54      private Form _form;
55      private FormMessage _formMessage;
56      private List<Step> _stepList;
57      private List<Group> _groupList;
58      private List<Question> _questionList;
59      private List<Transition> _transitionList;
60      private List<FormDisplay> _formDisplayList;
61      private List<Control> _controlList;
62      private List<ControlGroup> _controlGroupList;
63      private List<ControlMapping> _controlMappingList;
64      private List<FormExportConfig> _formExportConfigList;
65  
66      /**
67       * @return the form
68       */
69      public Form getForm( )
70      {
71          return _form;
72      }
73  
74      /**
75       * @param form
76       *            the form to set
77       */
78      public void setForm( Form form )
79      {
80          _form = form;
81      }
82  
83      /**
84       * @return the stepList
85       */
86      public List<Step> getStepList( )
87      {
88          return new ArrayList<>( _stepList );
89      }
90  
91      /**
92       * @param stepList
93       *            the stepList to set
94       */
95      public void setStepList( List<Step> stepList )
96      {
97          _stepList = new ArrayList<>( stepList );
98      }
99  
100     /**
101      * @return the questionList
102      */
103     public List<Question> getQuestionList( )
104     {
105         return new ArrayList<>( _questionList );
106     }
107 
108     /**
109      * @param questionList
110      *            the questionList to set
111      */
112     public void setQuestionList( List<Question> questionList )
113     {
114         _questionList = new ArrayList<>( questionList );
115     }
116 
117     /**
118      * @return the transitionList
119      */
120     public List<Transition> getTransitionList( )
121     {
122         return new ArrayList<>( _transitionList );
123     }
124 
125     /**
126      * @param transitionList
127      *            the transitionList to set
128      */
129     public void setTransitionList( List<Transition> transitionList )
130     {
131         _transitionList = new ArrayList<>( transitionList );
132     }
133 
134     /**
135      * @return the formMessage
136      */
137     public FormMessage getFormMessage( )
138     {
139         return _formMessage;
140     }
141 
142     /**
143      * @param formMessage
144      *            the formMessage to set
145      */
146     public void setFormMessage( FormMessage formMessage )
147     {
148         _formMessage = formMessage;
149     }
150 
151     /**
152      * @return the formDisplayList
153      */
154     public List<FormDisplay> getFormDisplayList( )
155     {
156         return new ArrayList<>( _formDisplayList );
157     }
158 
159     /**
160      * @param formDisplayList
161      *            the formDisplayList to set
162      */
163     public void setFormDisplayList( List<FormDisplay> formDisplayList )
164     {
165         _formDisplayList = new ArrayList<>( formDisplayList );
166     }
167 
168     /**
169      * @return the groupList
170      */
171     public List<Group> getGroupList( )
172     {
173         return new ArrayList<>( _groupList );
174     }
175 
176     /**
177      * @param groupList
178      *            the groupList to set
179      */
180     public void setGroupList( List<Group> groupList )
181     {
182         _groupList = new ArrayList<>( groupList );
183     }
184 
185     /**
186      * @return the controlList
187      */
188     public List<Control> getControlList( )
189     {
190         return new ArrayList<>( _controlList );
191     }
192 
193     /**
194      * @param controlList
195      *            the controlQuestionList to set
196      */
197     public void setControlList( List<Control> controlList )
198     {
199         _controlList = new ArrayList<>( controlList );
200     }
201 
202     /**
203      * @return the controlGroupList
204      */
205     public List<ControlGroup> getControlGroupList( )
206     {
207         return new ArrayList<>( _controlGroupList );
208     }
209 
210     /**
211      * @param controlGroupList
212      *            the controlGroupList to set
213      */
214     public void setControlGroupList( List<ControlGroup> controlGroupList )
215     {
216         _controlGroupList = new ArrayList<>( controlGroupList );
217     }
218 
219     /**
220      * @return the controlMappingList
221      */
222     public List<ControlMapping> getControlMappingList( )
223     {
224         return new ArrayList<>( _controlMappingList );
225     }
226 
227     /**
228      * @param controlMappingList
229      *            the controlMappingList to set
230      */
231     public void setControlMappingList( List<ControlMapping> controlMappingList )
232     {
233         _controlMappingList = new ArrayList<>( controlMappingList );
234     }
235 
236     /**
237      * @return the formExportConfigList
238      */
239     public List<FormExportConfig> getFormExportConfigList( )
240     {
241         return new ArrayList<>( _formExportConfigList );
242     }
243 
244     /**
245      * @param formExportConfigList
246      *            the formExportConfigList to set
247      */
248     public void setFormExportConfigList( List<FormExportConfig> formExportConfigList )
249     {
250         _formExportConfigList = new ArrayList<>( formExportConfigList );
251     }
252 
253 }