public static Type detect ( final String payload ) { final Matcher m = ROOT_NAME . matcher ( payload ) ; if ( m . find ( ) && m . groupCount ( ) >= 1 ) { final String root = m . group ( 1 ) ; try { return Type . valueOf ( CaseFormat . LOWER_UNDERSCORE . to ( CaseFormat . UPPER_CAMEL , root ) ) ; } catch ( IllegalArgumentException e ) { log . warn ( "Enable to detect notification type, no type for {}" , root ) ; return null ; } } log . warn ( "Enable to detect notification type" ) ; return null ; }
Detect notification type based on the xml root name .