Class XmlTypeUtils
java.lang.Object
org.jvnet.basicjaxb.xml.bind.model.util.XmlTypeUtils
Utility methods to introspect on the
XmlType annotation.-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetNamespace(Package targetPackage) Get the XML namespace from given package.static StringGet the XML namespace prefix for the given package and namespace.static QNamegetTypeName(Class<?> targetClass) Get theQNamefor the given target class.static booleanisJAXBElement(Object value) Is the given object an instance ofJAXBElement.static booleanisXmlRootElement(Class<?> targetClass) Is the given target class bound to anXmlRootElement.static booleanisXmlRootElement(Object value) Is the given object bound to anXmlRootElement.
-
Method Details
-
isJAXBElement
Is the given object an instance ofJAXBElement.- Parameters:
value- The object to inspect.- Returns:
- True when the object is an instance of
JAXBElement; otherwise, false.
-
isXmlRootElement
Is the given object bound to anXmlRootElement.- Parameters:
value- The object to inspect.- Returns:
- True when the object is bound to an
XmlRootElement; otherwise, false.
-
isXmlRootElement
Is the given target class bound to anXmlRootElement.- Parameters:
targetClass- The class to inspect.- Returns:
- True when the target class is bound to an
XmlRootElement; otherwise, false.
-
getTypeName
Get theQNamefor the given target class.Introspect on the
XmlTypeannotation when present or use a default identifier suitable for variables to determine the local part.Introspect on the
XmlTypeannotation when present or use a default namespace from the package containing the target class. -
getPrefix
Get the XML namespace prefix for the given package and namespace.- Parameters:
targetPackage- The target package to extract the XML namespace.namespaceURI- The XML namespace used to select the prefix.- Returns:
- The XML namespace prefix or null.
-
getNamespace
Get the XML namespace from given package.- Parameters:
targetPackage- The target package to extract the XML namespace.- Returns:
- The XML namespace or an empty string.
-