Java Utililty Methods XML QName Create

List of utility methods to do XML QName Create

Description

The list of methods to do XML QName Create are organized into topic(s).

Method

QNameconvertJavaTypeToQName(Type type)
convert Java Type To Q Name
if (type instanceof Class) {
    Class<?> valueType = (Class<?>) type;
    String packageName = valueType.getPackage().getName();
    String className = valueType.getSimpleName();
    QName typeQName = new QName("urn:qi4j:type:value:" + packageName, className);
    return typeQName;
} else if (type instanceof ParameterizedType) {
    return convertJavaTypeToQName(((ParameterizedType) type).getRawType());
...
SetconvertStringsToQNames(List expandedQNames)
convert Strings To Q Names
Set<QName> dropElements = Collections.emptySet();
if (expandedQNames != null) {
    dropElements = new LinkedHashSet<QName>(expandedQNames.size());
    for (String val : expandedQNames) {
        dropElements.add(convertStringToQName(val));
return dropElements;
...
QNameconvertStringToQName(String expandedQName)
convert String To Q Name
return convertStringToQName(expandedQName, "");
QNamecreateQName(Node node)
create Q Name
return new QName(node.getNamespaceURI(), node.getLocalName());
QNamecreateQName(String localPart)
create Q Name
return new QName(localPart);
QNamecreateQName(String namespaceUri, String localPart, String prefix)
Creates a new QName with the given parameters.
if (qNameHasPrefix) {
    return new QName(namespaceUri, localPart, prefix);
} else {
    return new QName(namespaceUri, localPart);
QNamecreateQName(String qnameString)
Create QName.
QName qname = null;
int index = qnameString.lastIndexOf(":");
if (index != -1) {
    qname = new QName(qnameString.substring(0, index), qnameString.substring(index + 1));
else {
    qname = new QName(qnameString);
return qname;
QNamecreateQName(String qualifiedName, Node node)
Creates a QName object based on the qualified name and using the Node as a base to lookup the namespace for the prefix
if (qualifiedName == null) {
    return null;
int index = qualifiedName.indexOf(":");
if (index == -1) {
    return new QName(qualifiedName);
String prefix = qualifiedName.substring(0, index);
...
QNamecreateQNameWithCustomNamespace(String key)
create Q Name With Custom Namespace
return new QName(CUSTOM_NAMESPACE_URI, key, CUSTOM_NAMESPACE_PREFIX);
QNamegetEmptyQName()
get Empty Q Name
return EMPTY_QNAME;