public static String detectSourceType ( Element element , String adapterClazz ) { TypeElement a = BaseProcessor . elementUtils . getTypeElement ( adapterClazz ) ; for ( Element i : BaseProcessor . elementUtils . getAllMembers ( a ) ) { if ( i . getKind ( ) == ElementKind . METHOD && "toJava" . equals ( i . getSimpleName ( ) . toString ( ) ) ) { ExecutableElement method = ( ExecutableElement ) i ; return TypeUtility . typeName ( method . getReturnType ( ) ) . toString ( ) ; } } AssertKripton . fail ( "In '%s', class '%s' can not be used as type adapter" , element , adapterClazz ) ; return null ; }
Detect source type .