public static Name name ( JCTree tree ) { switch ( tree . getTag ( ) ) { case IDENT : return ( ( JCIdent ) tree ) . name ; case SELECT : return ( ( JCFieldAccess ) tree ) . name ; case TYPEAPPLY : return name ( ( ( JCTypeApply ) tree ) . clazz ) ; default : return null ; } }
If this tree is an identifier or a field or a parameterized type return its name otherwise return null .