public int compare(FormField f1, FormField f2) { return f1.getVariable().compareTo(f2.getVariable()); } });
private FormField getStreamMethodField(DataForm form) { FormField field = null; for (Iterator<FormField> it = form.getFields(); it.hasNext();) { field = it.next(); if (field.getVariable().equals(STREAM_DATA_FIELD_NAME)) { break; } field = null; } return field; }
private FormField getStreamMethodField(DataForm form) { FormField field = null; for (Iterator<FormField> it = form.getFields(); it.hasNext();) { field = it.next(); if (field.getVariable().equals(STREAM_DATA_FIELD_NAME)) { break; } field = null; } return field; }
private FormField getStreamMethodField(DataForm form) { FormField field = null; for (Iterator it = form.getFields(); it.hasNext();) { field = (FormField) it.next(); if (field.getVariable().equals(STREAM_DATA_FIELD_NAME)) { break; } field = null; } return field; }
private FormField getStreamMethodField(DataForm form) { FormField field = null; for (Iterator<FormField> it = form.getFields(); it.hasNext();) { field = it.next(); if (field.getVariable().equals(STREAM_DATA_FIELD_NAME)) { break; } field = null; } return field; }
/** * 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; }
/** * 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 true if this DataForm has at least one FORM_TYPE field which is * hidden. This method is used for sanity checks. * * @return */ public boolean hasHiddenFromTypeField() { boolean found = false; for (FormField f : fields) { if (f.getVariable().equals("FORM_TYPE") && f.getType() != null && f.getType().equals("hidden")) found = true; } return found; }
/** * 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(); }
result.append(formField.getVariable()); result.append(':');
result.append(formField.getVariable()); result.append(':');
result.append(formField.getVariable()); result.append(':');
/** * * @param info * @return true if the packet extensions is ill-formed */ protected static boolean verifyPacketExtensions(DiscoverInfo info) { List<FormField> foundFormTypes = new LinkedList<FormField>(); for (Iterator<PacketExtension> i = info.getExtensions().iterator(); i.hasNext();) { PacketExtension pe = i.next(); if (pe.getNamespace().equals(Form.NAMESPACE)) { DataForm df = (DataForm) pe; for (Iterator<FormField> it = df.getFields(); it.hasNext();) { FormField f = it.next(); if (f.getVariable().equals("FORM_TYPE")) { for (FormField fft : foundFormTypes) { if (f.equals(fft)) return true; } foundFormTypes.add(f); } } } } return false; }
buf.append(" label=\"").append(getLabel()).append("\""); if (getVariable() != null) { buf.append(" var=\"").append(getVariable()).append("\"");
buf.append(" label=\"").append(getLabel()).append("\""); if (getVariable() != null) { buf.append(" var=\"").append(getVariable()).append("\"");