summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/com')
-rw-r--r--src/com/isode/stroke/elements/FormPage.java12
-rw-r--r--src/com/isode/stroke/parser/payloadparsers/FormParser.java11
-rw-r--r--src/com/isode/stroke/serializer/payloadserializers/FormSerializer.java2
3 files changed, 8 insertions, 17 deletions
diff --git a/src/com/isode/stroke/elements/FormPage.java b/src/com/isode/stroke/elements/FormPage.java
index b23a6e2..ffb35a9 100644
--- a/src/com/isode/stroke/elements/FormPage.java
+++ b/src/com/isode/stroke/elements/FormPage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -21,7 +21,6 @@ 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>();
@@ -32,7 +31,7 @@ public class FormPage {
* Default Constructor.
*/
public FormPage() {
- this.xmlns_ = "http://jabber.org/protocol/xdata-layout";
+
}
/**
@@ -51,13 +50,6 @@ public class FormPage {
}
/**
- * @return xmlns, Not Null.
- */
- public String getXMLNS() {
- return xmlns_;
- }
-
- /**
* @param textElement, Not Null.
*/
public void addTextElement(FormText textElement) {
diff --git a/src/com/isode/stroke/parser/payloadparsers/FormParser.java b/src/com/isode/stroke/parser/payloadparsers/FormParser.java
index ab14a4e..bbb04c0 100644
--- a/src/com/isode/stroke/parser/payloadparsers/FormParser.java
+++ b/src/com/isode/stroke/parser/payloadparsers/FormParser.java
@@ -38,7 +38,6 @@ public class FormParser extends GenericPayloadParser<Form> {
private String currentText_ = "";
private String currentFieldRef_ = "";
private boolean parsingItem_ = false;
- private boolean parseStarted_ = false;
private boolean hasReportedRef_ = false;
private FormText currentTextElement_;
private FormReportedRef currentReportedRef_;
@@ -242,15 +241,15 @@ public class FormParser extends GenericPayloadParser<Form> {
else {
if (currentPages_.size() > 0) {
for (FormPage page : currentPages_) {
- for (String pRef : page.getFieldRefs()) {
- if (pRef.equals(currentField_.getName())) {
+ for (String pageRef : page.getFieldRefs()) {
+ if (pageRef.equals(currentField_.getName())) {
page.addField(currentField_);
}
}
}
for (FormSection section : currentSections_) {
- for (String sRef : section.getFieldRefs()) {
- if (sRef.equals(currentField_.getName())) {
+ for (String sectionRef : section.getFieldRefs()) {
+ if (sectionRef.equals(currentField_.getName())) {
section.addField(currentField_);
}
}
@@ -270,7 +269,7 @@ public class FormParser extends GenericPayloadParser<Form> {
sectionStack_.remove(sectionStack_.size()-1);
}
else if (sectionStack_.size() == 1) {
- // Add the remaining section on the stack to it's parent page
+ // Add the remaining section on the stack to its parent page
currentPage_.addChildSection(sectionStack_.get(sectionStack_.size()-1));
sectionStack_.remove(sectionStack_.size()-1);
}
diff --git a/src/com/isode/stroke/serializer/payloadserializers/FormSerializer.java b/src/com/isode/stroke/serializer/payloadserializers/FormSerializer.java
index 262ba3d..4cd80c9 100644
--- a/src/com/isode/stroke/serializer/payloadserializers/FormSerializer.java
+++ b/src/com/isode/stroke/serializer/payloadserializers/FormSerializer.java
@@ -153,7 +153,7 @@ public class FormSerializer extends GenericPayloadSerializer<Form> {
private XMLElement pageToXML(FormPage page) {
XMLElement pageElement = new XMLElement("page");
- pageElement.setAttribute("xmlns", page.getXMLNS());
+ pageElement.setAttribute("xmlns","http://jabber.org/protocol/xdata-layout");
if (!page.getLabel().isEmpty()) {
pageElement.setAttribute("label", page.getLabel());
}