private StreamNegotiator getNegotiator(final FormField field) throws NoAcceptableTransferMechanisms { String variable; boolean isByteStream = false; boolean isIBB = false; for (FormField.Option option : field.getOptions()) { variable = option.getValue(); if (variable.equals(Bytestream.NAMESPACE) && !IBB_ONLY) { isByteStream = true; } else if (variable.equals(DataPacketExtension.NAMESPACE)) { isIBB = true; } } if (!isByteStream && !isIBB) { throw new FileTransferException.NoAcceptableTransferMechanisms(); } if (isByteStream && isIBB) { return new FaultTolerantNegotiator(connection(), byteStreamTransferManager, inbandTransferManager); } else if (isByteStream) { return byteStreamTransferManager; } else { return inbandTransferManager; } }
@Override public XmlStringBuilder toXML(String enclosingNamespace) { XmlStringBuilder buf = new XmlStringBuilder(this); // Add attributes buf.optAttribute("label", getLabel()); buf.optAttribute("var", getVariable()); buf.optAttribute("type", getType()); buf.rightAngleBracket(); // Add elements buf.optElement("desc", getDescription()); buf.condEmptyElement(isRequired(), "required"); // Loop through all the values and append them to the string buffer for (CharSequence value : getValues()) { buf.element("value", value); } // Loop through all the values and append them to the string buffer for (Option option : getOptions()) { buf.append(option.toXML(null)); } buf.optElement(validateElement); buf.closeElement(this); return buf; }
type.equals(FormField.Type.jid_multi)) { StringBuilder buf = new StringBuilder(); for ( FormField.Option option : field.getOptions() ) { buf.append(option); for ( final FormField.Option option : field.getOptions() ) { box.addItem(option);
for ( final FormField.Option option : field.getOptions() ) { String value = option.getValue(); box.addItem(value); CheckBoxList checkBoxList = new CheckBoxList(); final List<CharSequence> values = field.getValues(); for ( final Option option : field.getOptions() ) { String optionLabel = option.getLabel(); String optionValue = option.getValue();