public XmlStringBuilder optXmlLangAttribute(String lang) { if (!StringUtils.isNullOrEmpty(lang)) { xmllangAttribute(lang); } return this; }
public XmlStringBuilder halfOpenElement(String name) { assert (StringUtils.isNotEmpty(name)); sb.append('<').append(name); return this; }
public XmlStringBuilder escapeAttributeValue(String value) { assert value != null; sb.append(StringUtils.escapeForXmlAttributeApos(value)); return this; }
@Override public XmlStringBuilder toXML(String enclosingNamespace) { // Upcast to NamedElement since we don't want a xmlns attribute XmlStringBuilder xml = new XmlStringBuilder((NamedElement) this); xml.attribute("name", name); xml.rightAngleBracket(); xml.escape(value); xml.closeElement(this); return xml; } }
@Override public XmlStringBuilder toXML(String enclosingNamespace) { XmlStringBuilder xml = new XmlStringBuilder(this); xml.rightAngleBracket(); xml.optAppend(text); xml.closeElement(this); return xml; }
@Override public XmlStringBuilder toXML(String enclosingNamespace) { XmlStringBuilder xml = new XmlStringBuilder(this); xml.attribute("sid", sid); xml.closeEmptyElement(); return xml; }
public AuthMechanism(String mechanism, String authenticationText) { this.mechanism = Objects.requireNonNull(mechanism, "SASL mechanism shouldn't be null."); this.authenticationText = StringUtils.requireNotNullNorEmpty(authenticationText, "SASL authenticationText must not be null nor empty (RFC6120 6.4.2)"); }
public void appendTo(XmlStringBuilder xml) { if (nodeId == null) { return; } xml.attribute("nodeId", nodeId).optAttribute("sourceId", sourceId).optAttribute("cacheType", cacheType); }
/** * Notification that the root window is closing. Stop listening for received and * transmitted packets. * * @param evt the event that indicates that the root window is closing */ public void rootWindowClosing(WindowEvent evt) { // TODO: Remove debugger from connection. ((ObservableReader) reader).removeReaderListener(readerListener); ((ObservableWriter) writer).removeWriterListener(writerListener); }
public XmlStringBuilder closeElement(String name) { sb.append("</").append(name); rightAngleBracket(); return this; }
public static String hex(String string) { return hex(StringUtils.toUtf8Bytes(string)); }
public XmlStringBuilder escape(String text) { assert text != null; sb.append(StringUtils.escapeForXml(text)); return this; }
public static String hex(String string) { return hex(StringUtils.toUtf8Bytes(string)); }
/** * Escape <code>input</code> for XML. * * @param input the input to escape. * @return the XML escaped variant of <code>input</code>. * @since 4.2 */ public static CharSequence escapeForXmlAttribute(CharSequence input) { return escapeForXml(input, XmlEscapeMode.forAttribute); }
/** * Does nothing if value is null. * * @param name * @param value * @return the XmlStringBuilder */ public XmlStringBuilder attribute(String name, String value) { assert value != null; sb.append(' ').append(name).append("='"); escapeAttributeValue(value); sb.append('\''); return this; }
/** * Creates a content description.. */ private JingleContent(Creator creator, String disposition, String name, Senders senders, JingleContentDescription description, JingleContentTransport transport) { this.creator = Objects.requireNonNull(creator, "Jingle content creator must not be null"); this.disposition = disposition; this.name = StringUtils.requireNotNullNorEmpty(name, "Jingle content name must not be null nor empty"); this.senders = senders; this.description = description; this.transport = transport; }
/** * Default constructor. * * @param jid The JID of the stream host. * @param address The internet address of the stream host. * @param port port of the stream host. */ public StreamHost(final Jid jid, final String address, int port) { this.jid = Objects.requireNonNull(jid, "StreamHost JID must not be null"); this.address = StringUtils.requireNotNullNorEmpty(address, "StreamHost address must not be null"); this.port = port; }
/** * Constructs an affiliation. * * @param node The node the user is affiliated with. * @param affiliation the optional affiliation. * @param namespace the affiliation's namespace. */ public Affiliation(String node, Type affiliation, AffiliationNamespace namespace) { this.node = StringUtils.requireNotNullNorEmpty(node, "node must not be null nor empty"); this.affiliation = affiliation; this.jid = null; this.namespace = Objects.requireNonNull(namespace); }