Class JAXBUtil


  • public final class JAXBUtil
    extends Object
    Author:
    lazyman
    • Constructor Detail

      • JAXBUtil

        public JAXBUtil()
    • Method Detail

      • getSchemaNamespace

        public static String getSchemaNamespace​(Package pkg)
      • getTypeLocalName

        public static <T> String getTypeLocalName​(Class<T> type)
      • getTypeQName

        public static <T> QName getTypeQName​(Class<T> type)
      • isElement

        public static boolean isElement​(Object element)
      • getElementQName

        public static QName getElementQName​(Object element)
      • getElementLocalName

        public static String getElementLocalName​(Object element)
      • getTextContentDump

        public static String getTextContentDump​(Object element)
        Returns short description of element content for diagnostics use (logs, dumps). Works with DOM and JAXB elements.
        Parameters:
        element - DOM or JAXB element
        Returns:
        short description of element content
      • getDocument

        public static Document getDocument​(Object element)
        Parameters:
        element -
        Returns:
      • findElement

        public static Object findElement​(List<Object> elements,
                                         QName elementName)
        Looks for an element with specified name. Considers both DOM and JAXB elements. Assumes single element instance in the list.
        Parameters:
        elements -
        elementName -
      • listChildElements

        public static List<Object> listChildElements​(Object parentElement)
        Parameters:
        parentElement -
        Returns:
      • findClassForType

        public static <T> Class<T> findClassForType​(QName typeName,
                                                    Package pkg)
      • compareElementList

        public static boolean compareElementList​(List<Object> aList,
                                                 List<Object> bList,
                                                 boolean considerNamespacePrefixes)