public static String getName ( Object obj ) { try { return obj . getClass ( ) . getAnnotation ( XmlRootElement . class ) . name ( ) ; } catch ( NullPointerException e ) { return obj . getClass ( ) . getAnnotation ( XmlType . class ) . name ( ) ; } }
Return the name from the JAXB model object .