Example usage for java.lang.reflect Modifier methodModifiers

List of usage examples for java.lang.reflect Modifier methodModifiers

Introduction

In this page you can find the example usage for java.lang.reflect Modifier methodModifiers.

Prototype

public static int methodModifiers() 

Source Link

Document

Return an int value OR-ing together the source language modifiers that can be applied to a method.

Usage

From source file:Main.java

public static void main(String... args) throws Exception {
    System.out.println(Modifier.toString(Modifier.methodModifiers()));
}

From source file:MyClass.java

public static String getModifiers(Executable exec) {
    int mod = exec.getModifiers();
    if (exec instanceof Method) {
        mod = mod & Modifier.methodModifiers();
    } else if (exec instanceof Constructor) {
        mod = mod & Modifier.constructorModifiers();
    }//from w  ww  .  j av a  2 s. co m
    return Modifier.toString(mod);
}