underneath.
| Method from org.dom4j.xpp.ProxyXmlStartTag Detail: |
public void addAttribute(String namespaceURI,
String localName,
String rawName,
String value) throws XmlPullParserException {
QName qname = QName.get(rawName, namespaceURI);
element.addAttribute(qname, value);
}
parameters modeled after SAX2 attribute approach |
public void addAttribute(String namespaceURI,
String localName,
String rawName,
String value,
boolean isNamespaceDeclaration) throws XmlPullParserException {
if (isNamespaceDeclaration) {
String prefix = "";
int idx = rawName.indexOf(':");
if (idx > 0) {
prefix = rawName.substring(0, idx);
}
element.addNamespace(prefix, namespaceURI);
} else {
QName qname = QName.get(rawName, namespaceURI);
element.addAttribute(qname, value);
}
}
|
public void ensureAttributesCapacity(int minCapacity) throws XmlPullParserException {
if (element instanceof AbstractElement) {
AbstractElement elementImpl = (AbstractElement) element;
elementImpl.ensureAttributesCapacity(minCapacity);
}
}
|
public int getAttributeCount() {
return (element != null) ? element.attributeCount() : 0;
}
|
public String getAttributeLocalName(int index) {
if (element != null) {
Attribute attribute = element.attribute(index);
if (attribute != null) {
return attribute.getName();
}
}
return null;
}
|
public String getAttributeNamespaceUri(int index) {
if (element != null) {
Attribute attribute = element.attribute(index);
if (attribute != null) {
return attribute.getNamespaceURI();
}
}
return null;
}
|
public String getAttributePrefix(int index) {
if (element != null) {
Attribute attribute = element.attribute(index);
if (attribute != null) {
String prefix = attribute.getNamespacePrefix();
if ((prefix != null) && (prefix.length() > 0)) {
return prefix;
}
}
}
return null;
}
|
public String getAttributeRawName(int index) {
if (element != null) {
Attribute attribute = element.attribute(index);
if (attribute != null) {
return attribute.getQualifiedName();
}
}
return null;
}
|
public String getAttributeValue(int index) {
if (element != null) {
Attribute attribute = element.attribute(index);
if (attribute != null) {
return attribute.getValue();
}
}
return null;
}
|
public String getAttributeValueFromName(String namespaceURI,
String localName) {
if (element != null) {
for (Iterator iter = element.attributeIterator(); iter.hasNext();) {
Attribute attribute = (Attribute) iter.next();
if (namespaceURI.equals(attribute.getNamespaceURI())
&& localName.equals(attribute.getName())) {
return attribute.getValue();
}
}
}
return null;
}
|
public String getAttributeValueFromRawName(String rawName) {
if (element != null) {
for (Iterator iter = element.attributeIterator(); iter.hasNext();) {
Attribute attribute = (Attribute) iter.next();
if (rawName.equals(attribute.getQualifiedName())) {
return attribute.getValue();
}
}
}
return null;
}
|
public DocumentFactory getDocumentFactory() {
return factory;
}
|
public Element getElement() {
return element;
}
|
public String getLocalName() {
return element.getName();
}
|
public String getNamespaceUri() {
return element.getNamespaceURI();
}
|
public String getPrefix() {
return element.getNamespacePrefix();
}
|
public String getRawName() {
return element.getQualifiedName();
}
|
public boolean isAttributeNamespaceDeclaration(int index) {
if (element != null) {
Attribute attribute = element.attribute(index);
if (attribute != null) {
return "xmlns".equals(attribute.getNamespacePrefix());
}
}
return false;
}
|
public void modifyTag(String namespaceURI,
String lName,
String rawName) {
this.element = factory.createElement(rawName, namespaceURI);
}
|
public boolean removeAttributeByName(String namespaceURI,
String localName) throws XmlPullParserException {
if (element != null) {
QName qname = QName.get(localName, namespaceURI);
Attribute attribute = element.attribute(qname);
return element.remove(attribute);
}
return false;
}
|
public boolean removeAttributeByRawName(String rawName) throws XmlPullParserException {
if (element != null) {
Attribute attribute = null;
Iterator it = element.attributeIterator();
while (it.hasNext()) {
Attribute current = (Attribute) it.next();
if (current.getQualifiedName().equals(rawName)) {
attribute = current;
break;
}
}
return element.remove(attribute);
}
return false;
}
|
public void removeAttributes() throws XmlPullParserException {
if (element != null) {
element.setAttributes(new ArrayList());
// ##### FIXME
// adding this method would be nice...
// element.clearAttributes();
}
}
|
public void removeAtttributes() throws XmlPullParserException {
removeAttributes();
} Deprecated! Use - #removeAttributes() instead.
|
public void resetStartTag() {
this.element = null;
}
|
public void resetTag() {
this.element = null;
}
|
public void setDocumentFactory(DocumentFactory documentFactory) {
this.factory = documentFactory;
}
|