/** * Returns the field of the form whose variable matches the specified variable. * The fields of type FIXED will never be returned since they do not specify a * variable. * * @param variable the variable to look for in the form fields. * @return the field of the form whose variable matches the specified variable. */ public FormField getField(String variable) { if (variable == null || variable.equals("")) { throw new IllegalArgumentException("Variable must not be null or blank."); } // Look for the field whose variable matches the requested variable FormField field; for (Iterator<FormField> it=getFields();it.hasNext();) { field = it.next(); if (variable.equals(field.getVariable())) { return field; } } return null; }
/** * Returns the field of the form whose variable matches the specified variable. * The fields of type FIXED will never be returned since they do not specify a * variable. * * @param variable the variable to look for in the form fields. * @return the field of the form whose variable matches the specified variable. */ public FormField getField(String variable) { if (variable == null || variable.equals("")) { throw new IllegalArgumentException("Variable must not be null or blank."); } // Look for the field whose variable matches the requested variable FormField field; for (Iterator<FormField> it=getFields();it.hasNext();) { field = it.next(); if (variable.equals(field.getVariable())) { return field; } } return null; }
/** * Returns the field of the form whose variable matches the specified variable. * The fields of type FIXED will never be returned since they do not specify a * variable. * * @param variable the variable to look for in the form fields. * @return the field of the form whose variable matches the specified variable. */ public FormField getField(String variable) { if (variable == null || variable.equals("")) { throw new IllegalArgumentException("Variable must not be null or blank."); } // Look for the field whose variable matches the requested variable FormField field; for (Iterator it=getFields();it.hasNext();) { field = (FormField)it.next(); if (variable.equals(field.getVariable())) { return field; } } return null; }
/** * Returns the field of the form whose variable matches the specified variable. * The fields of type FIXED will never be returned since they do not specify a * variable. * * @param variable the variable to look for in the form fields. * @return the field of the form whose variable matches the specified variable. */ public FormField getField(String variable) { if (variable == null || variable.equals("")) { throw new IllegalArgumentException("Variable must not be null or blank."); } // Look for the field whose variable matches the requested variable FormField field; for (Iterator<FormField> it=getFields();it.hasNext();) { field = it.next(); if (variable.equals(field.getVariable())) { return field; } } return null; }
private String getItemsToSearch() { StringBuilder buf = new StringBuilder(); if (form == null) { form = Form.getFormFrom(this); } if (form == null) { return ""; } Iterator<FormField> fields = form.getFields(); while (fields.hasNext()) { FormField field = fields.next(); String name = field.getVariable(); String value = getSingleValue(field); if (value.trim().length() > 0) { buf.append("<").append(name).append(">").append(value).append("</").append(name).append(">"); } } return buf.toString(); }
private String getItemsToSearch() { StringBuffer buf = new StringBuffer(); if (form == null) { form = Form.getFormFrom(this); } if (form == null) { return ""; } Iterator fields = form.getFields(); while (fields.hasNext()) { FormField field = (FormField) fields.next(); String name = field.getVariable(); String value = getSingleValue(field); if (value.trim().length() > 0) { buf.append("<").append(name).append(">").append(value).append("</").append(name).append(">"); } } return buf.toString(); }
private String getItemsToSearch() { StringBuilder buf = new StringBuilder(); if (form == null) { form = Form.getFormFrom(this); } if (form == null) { return ""; } Iterator<FormField> fields = form.getFields(); while (fields.hasNext()) { FormField field = fields.next(); String name = field.getVariable(); String value = getSingleValue(field); if (value.trim().length() > 0) { buf.append("<").append(name).append(">").append(value).append("</").append(name).append(">"); } } return buf.toString(); }
private String getItemsToSearch() { StringBuilder buf = new StringBuilder(); if (form == null) { form = Form.getFormFrom(this); } if (form == null) { return ""; } Iterator<FormField> fields = form.getFields(); while (fields.hasNext()) { FormField field = fields.next(); String name = field.getVariable(); String value = getSingleValue(field); if (value.trim().length() > 0) { buf.append("<").append(name).append(">").append(value).append("</").append(name).append(">"); } } return buf.toString(); }
/** * Returns a DataForm that serves to send this Form to the server. If the form is of type * submit, it may contain fields with no value. These fields will be removed since they only * exist to assist the user while editing/completing the form in a UI. * * @return the wrapped DataForm. */ public DataForm getDataFormToSend() { if (isSubmitType()) { // Create a new DataForm that contains only the answered fields DataForm dataFormToSend = new DataForm(getType()); for(Iterator it=getFields();it.hasNext();) { FormField field = (FormField)it.next(); if (field.getValues().hasNext()) { dataFormToSend.addField(field); } } return dataFormToSend; } return dataForm; }
/** * Returns a DataForm that serves to send this Form to the server. If the form is of type * submit, it may contain fields with no value. These fields will be removed since they only * exist to assist the user while editing/completing the form in a UI. * * @return the wrapped DataForm. */ public DataForm getDataFormToSend() { if (isSubmitType()) { // Create a new DataForm that contains only the answered fields DataForm dataFormToSend = new DataForm(getType()); for(Iterator<FormField> it=getFields();it.hasNext();) { FormField field = it.next(); if (field.getValues().hasNext()) { dataFormToSend.addField(field); } } return dataFormToSend; } return dataForm; }
/** * Returns a DataForm that serves to send this Form to the server. If the form is of type * submit, it may contain fields with no value. These fields will be removed since they only * exist to assist the user while editing/completing the form in a UI. * * @return the wrapped DataForm. */ public DataForm getDataFormToSend() { if (isSubmitType()) { // Create a new DataForm that contains only the answered fields DataForm dataFormToSend = new DataForm(getType()); for(Iterator<FormField> it=getFields();it.hasNext();) { FormField field = it.next(); if (field.getValues().hasNext()) { dataFormToSend.addField(field); } } return dataFormToSend; } return dataForm; }
/** * Returns a DataForm that serves to send this Form to the server. If the form is of type * submit, it may contain fields with no value. These fields will be removed since they only * exist to assist the user while editing/completing the form in a UI. * * @return the wrapped DataForm. */ public DataForm getDataFormToSend() { if (isSubmitType()) { // Create a new DataForm that contains only the answered fields DataForm dataFormToSend = new DataForm(getType()); for(Iterator<FormField> it=getFields();it.hasNext();) { FormField field = it.next(); if (field.getValues().hasNext()) { dataFormToSend.addField(field); } } return dataFormToSend; } return dataForm; }
for (Iterator<FormField> fields=getFields(); fields.hasNext();) { FormField field = fields.next();
for (Iterator<FormField> fields=getFields(); fields.hasNext();) { FormField field = fields.next();
for (Iterator<FormField> fields=getFields(); fields.hasNext();) { FormField field = fields.next();
for (Iterator fields=getFields(); fields.hasNext();) { FormField field = (FormField)fields.next();