Example usage for javax.xml.soap Name getPrefix

List of usage examples for javax.xml.soap Name getPrefix

Introduction

In this page you can find the example usage for javax.xml.soap Name getPrefix.

Prototype

String getPrefix();

Source Link

Document

Returns the prefix that was specified when this Name object was initialized.

Usage

From source file:org.springframework.ws.soap.saaj.support.SaajUtils.java

/**
 * Converts a <code>javax.xml.soap.Name</code> to a <code>javax.xml.namespace.QName</code>.
 *
 * @param name the <code>Name</code> to convert
 * @return the converted <code>QName</code>
 *///from ww  w .  ja  va2s .co  m
public static QName toQName(Name name) {
    if (StringUtils.hasLength(name.getURI()) && StringUtils.hasLength(name.getPrefix())) {
        return QNameUtils.createQName(name.getURI(), name.getLocalName(), name.getPrefix());
    } else if (StringUtils.hasLength(name.getURI())) {
        return new QName(name.getURI(), name.getLocalName());
    } else {
        return new QName(name.getLocalName());
    }
}