Example usage for java.lang.reflect Modifier constructorModifiers

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

Introduction

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

Prototype

public static int constructorModifiers() 

Source Link

Document

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

Usage

From source file:Main.java

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

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();
    }/*  w  ww. j a  v  a 2 s  .c om*/
    return Modifier.toString(mod);
}