Example usage for org.w3c.dom Attr getUserData

List of usage examples for org.w3c.dom Attr getUserData

Introduction

In this page you can find the example usage for org.w3c.dom Attr getUserData.

Prototype

public Object getUserData(String key);

Source Link

Document

Retrieves the object associated to a key on a this node.

Usage

From source file:org.apache.axis2.jaxws.message.util.impl.XMLStreamReaderFromDOM.java

public String getAttributeType(int index) {
    String attrType = null;//from w w  w.  j  av  a2s .  c om
    Attr attr = (Attr) getAttributes().get(index);
    TypeInfo typeInfo = attr.getSchemaTypeInfo();
    if (typeInfo != null) {
        attrType = typeInfo.getTypeName();
    }

    if (attrType == null) {
        try {
            attrType = (String) attr.getUserData(SAAJConverter.OM_ATTRIBUTE_KEY);
            if (log.isDebugEnabled()) {
                log.debug("Retrieving attrType from UserData: " + attrType);
            }
        } catch (Exception e) {
            if (log.isDebugEnabled()) {
                log.debug("An error occured while getting attrType: " + e.getMessage());
            }
        }
    }

    return attrType;
}