/* * Copyright (c) 2012-2014 Isode Limited, London, England. * All rights reserved. */ /* * Copyright (c) 2010 Remko Tronçon * All rights reserved. */ package com.isode.stroke.elements; import java.util.ArrayList; import java.util.List; import com.isode.stroke.jid.JID; /** * This class implements the field element of a form. * *

* From http://xmpp.org/extensions/xep-0050.html: Data validation is the * responsibility of the form-processing entity (commonly a server, service, or * bot) rather than the form-submitting entity (commonly a client controlled by * a human user). This helps to meet the requirement for keeping client * implementations simple. If the form-processing entity determines that the * data provided is not valid, it SHOULD return a "Not Acceptable" error, * optionally providing a textual explanation. */ public class FormField { public static final String FORM_FIELD_ATTRIBUTE_VAR = "var"; public static final String FORM_FIELD_ATTRIBUTE_LABEL = "label"; public static final String FORM_FIELD_ELEMENT_REQUIRED = "required"; public static final String FORM_FIELD_ELEMENT_DESC = "desc"; public static final String FORM_FIELD_ELEMENT_VALUE = "value"; public static final String FORM_FIELD_ATTRIBUTE_TYPE = "type"; public static final String FORM_FIELD_ELEMENT_OPTION = "option"; public static final String FORM_FIELD_ATTRIBUTE_OPTION_LABEL = "label"; public static final String FORM_FIELD_ELEMENT_OPTION_VALUE = "value"; private static final String ILLEGAL_ARG_EX_STR = "This API is not valid for getting a value of type "; private boolean required_; private List