summaryrefslogtreecommitdiffstats
blob: b23a6e2aa0387e4481fef7e3aefe511b04ec9b33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*
 * Copyright (c) 2015 Isode Limited.
 * All rights reserved.
 * See the COPYING file for more information.
 */
/*
 * Copyright (c) 2015 Tarun Gupta.
 * Licensed under the simplified BSD license.
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 */

package com.isode.stroke.elements;

import com.isode.stroke.base.NotNull;
import com.isode.stroke.elements.FormField;
import com.isode.stroke.elements.FormReportedRef;
import com.isode.stroke.elements.FormText;
import com.isode.stroke.elements.FormSection;
import java.util.Vector;

public class FormPage {

	private String label_ = "";
	private String xmlns_ = "";
	private Vector<FormText> textElements_ = new Vector<FormText>();
	private Vector<FormReportedRef> reportedRefs_ = new Vector<FormReportedRef>();
	private Vector<FormSection> childSections_ = new Vector<FormSection>();
	private Vector<FormField> fields_ = new Vector<FormField>();
	private Vector<String> fieldRefs_ = new Vector<String>();

	/**
	* Default Constructor.
	*/
	public FormPage() {
		this.xmlns_ = "http://jabber.org/protocol/xdata-layout";
	}

	/**
	* @param label, Not Null.
	*/
	public void setLabel(String label) {
		NotNull.exceptIfNull(label, "label");
		label_ = label;
	}

	/**
	* @return label, Not Null.
	*/
	public String getLabel() {
		return label_;
	}

	/**
	* @return xmlns, Not Null.
	*/
	public String getXMLNS() {
		return xmlns_;
	}

	/**
	* @param textElement, Not Null.
	*/
	public void addTextElement(FormText textElement) {
		NotNull.exceptIfNull(textElement, "textElement");
		textElements_.add(textElement);
	}

	/**
	* @return textElement, Not Null.
	*/
	public Vector<FormText> getTextElements() {
		return textElements_;
	}

	/**
	* @param reportedRef, Not Null.
	*/
	public void addReportedRef(FormReportedRef reportedRef) {
		NotNull.exceptIfNull(reportedRef, "reportedRef");
		reportedRefs_.add(reportedRef);
	}

	/**
	* @return reportedRef, Not Null.
	*/
	public Vector<FormReportedRef> getReportedRefs() {
		return reportedRefs_;
	}

	/**
	* @param childSection, Not Null.
	*/
	public void addChildSection(FormSection childSection) {
		NotNull.exceptIfNull(childSection, "childSection");
		childSections_.add(childSection);
	}

	/**
	* @return childSection, Not Null.
	*/
	public Vector<FormSection> getChildSections() {
		return childSections_;
	}

	/**
	* @param field, Not Null.
	*/
	public void addField(FormField field) {
		NotNull.exceptIfNull(field, "field");
		fields_.add(field);
	}

	/**
	* @return field, Not Null.
	*/
	public Vector<FormField> getFields() {
		return fields_;
	}

	/**
	* @param ref, Not Null.
	*/
	public void addFieldRef(String ref) {
		NotNull.exceptIfNull(ref, "ref");
		fieldRefs_.add(ref);
	}

	/**
	* @return ref, Not Null.
	*/
	public Vector<String> getFieldRefs() {
		return fieldRefs_;
	}
}