Java Utililty Methods XML QName

List of utility methods to do XML QName

Description

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

Method

booleanhasAnnotatedQname(Object obj)
has Annotated Qname
return (obj.getClass().getAnnotation(XmlType.class) != null);
booleanhasChildElement(QName qName, Element element)
has Child Element
List<Element> elements = getChildElements(qName, element);
return !elements.isEmpty();
booleanhasGmlNamespace(QName qname)
has Gml Namespace
return qname.getNamespaceURI().startsWith(GML_BASE_NAMESPACE);
booleanhasQName(final Node e, final QName name)
has Q Name
return new QName(e.getNamespaceURI(), e.getLocalName()).equals(name);
booleanhasQName(Node node, QName qname)
Determines if a node has a particular qualified name.
return qname.getNamespaceURI().equals(node.getNamespaceURI())
        && qname.getLocalPart().equals(node.getLocalName());
booleanisElementName(Element element, QName name)
is Element Name
return name.equals(getQNameWithoutPrefix(element));
booleanisEndElement(final XMLEvent event, final QName name)
Ueberprueft, ob es ein End-Event mit dem uebergebenen Namen ist.
return event.isEndElement() && event.asEndElement().getName().equals(name);
booleanisEventStartOrEndElementWithMatchingName(XMLEvent event, QName elementName)
is Event Start Or End Element With Matching Name
if (event == null)
    throw new IllegalArgumentException("Event may not be null.");
QName eventElementName = null;
if (event.isStartElement())
    eventElementName = event.asStartElement().getName();
else if (event.isEndElement())
    eventElementName = event.asEndElement().getName();
else
...
booleanisJAXBElement(Class declaredType, QName name, Class scope, Object value)
is JAXB Element
if (value == null) {
    return false;
} else if (value instanceof JAXBElement) {
    final JAXBElement<?> element = (JAXBElement<?>) value;
    return element.getName().equals(name) && declaredType.isAssignableFrom(element.getDeclaredType());
} else {
    return false;
booleanisPrimitiveIdlType(QName idlType)
is Primitive Idl Type
return IDL_TO_SCHEMA_TYPES.get(idlType) != null;