@ Nullable public static ModifiersTree getModifiers ( Tree tree ) { if ( tree instanceof ClassTree ) { return ( ( ClassTree ) tree ) . getModifiers ( ) ; } else if ( tree instanceof MethodTree ) { return ( ( MethodTree ) tree ) . getModifiers ( ) ; } else if ( tree instanceof VariableTree ) { return ( ( VariableTree ) tree ) . getModifiers ( ) ; } else { return null ; } }
Returns the modifiers tree of the given class method or variable declaration .