XmlName class
XML entity name.
class XmlName extends Object with _XmlWritable {
final String _prefix;
final String _local;
XmlName._internal(this._prefix, this._local);
factory XmlName(String name) {
var index = name.indexOf(':');
if (index < 0) {
return new XmlName._internal(null, name);
} else {
return new XmlName._internal(
name.substring(0, index),
name.substring(index + 1, name.length));
}
}
String get local => _local;
String get prefix => _prefix;
String get qualified => toString();
void writeTo(StringBuffer buffer) {
if (prefix != null) {
buffer.write(prefix);
buffer.write(':');
}
buffer.write(local);
}
bool operator == (XmlName obj) {
return obj is XmlName && obj.local == local && obj.prefix == prefix;
}
}
Extends
Object__XmlWritable > XmlName
Constructors
Properties
Operators
bool operator ==(XmlName obj) #
The equality operator.
The default behavior for all Objects is to return true if and
only if this and other are the same object.
If a subclass overrides the equality operator it should override
the hashCode method as well to maintain consistency.
docs inherited from Object
bool operator == (XmlName obj) {
return obj is XmlName && obj.local == local && obj.prefix == prefix;
}
Methods
String toString() #
inherited from Object__XmlWritable
Answer a print string of the receiver.
String toString() {
var buffer = new StringBuffer();
writeTo(buffer);
return buffer.toString();
}
void writeTo(StringBuffer buffer) #
Writes the XML string of the receiver to a {@code buffer}.
docs inherited from Object__XmlWritable
void writeTo(StringBuffer buffer) {
if (prefix != null) {
buffer.write(prefix);
buffer.write(':');
}
buffer.write(local);
}