diff options
| author | Alex Clayton <alex.clayton@isode.com> | 2016-03-21 16:22:56 (GMT) |
|---|---|---|
| committer | Alex Clayton <alex.clayton@isode.com> | 2016-03-22 11:32:44 (GMT) |
| commit | 9b518dcdd98d694a4464895fce17a3c7a8caf569 (patch) | |
| tree | f585f40f6ac0c0d829015c68d6d8c8169a4fb252 | |
| parent | 0ec7a2d8ab803b0e2df2c616f61d2b69b042561f (diff) | |
| download | stroke-9b518dcdd98d694a4464895fce17a3c7a8caf569.zip stroke-9b518dcdd98d694a4464895fce17a3c7a8caf569.tar.bz2 | |
Tidy XEP-0141 code
As per swiften patch of the same name.
This change addresses some feedback the previous XEP-0141 commit.
Test-information: Unit tests stil pass.
Change-Id: I3a9f9ec93b56352418f8288371bbd6874e01310d
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,3 +1,3 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. @@ -23,3 +23,2 @@ public class FormPage { private String label_ = ""; - private String xmlns_ = ""; private Vector<FormText> textElements_ = new Vector<FormText>(); @@ -34,3 +33,3 @@ public class FormPage { public FormPage() { - this.xmlns_ = "http://jabber.org/protocol/xdata-layout"; + } @@ -53,9 +52,2 @@ public class FormPage { /** - * @return xmlns, Not Null. - */ - public String getXMLNS() { - return xmlns_; - } - - /** * @param textElement, Not Null. 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 @@ -40,3 +40,2 @@ public class FormParser extends GenericPayloadParser<Form> { private boolean parsingItem_ = false; - private boolean parseStarted_ = false; private boolean hasReportedRef_ = false; @@ -244,4 +243,4 @@ public class FormParser extends GenericPayloadParser<Form> { 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_); @@ -251,4 +250,4 @@ public class FormParser extends GenericPayloadParser<Form> { 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_); @@ -272,3 +271,3 @@ public class FormParser extends GenericPayloadParser<Form> { 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)); 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 @@ -155,3 +155,3 @@ public class FormSerializer extends GenericPayloadSerializer<Form> { XMLElement pageElement = new XMLElement("page"); - pageElement.setAttribute("xmlns", page.getXMLNS()); + pageElement.setAttribute("xmlns","http://jabber.org/protocol/xdata-layout"); if (!page.getLabel().isEmpty()) { |
Swift