Example usage for java.lang.reflect Modifier toString

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

Introduction

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

Prototype

public static String toString(int mod) 

Source Link

Document

Return a string describing the access modifier flags in the specified modifier.

Usage

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

public static void main(String[] args) {

    Main c = new Main();
    Class cls = c.getClass();//ww  w  .  j a v a 2  s  .  c o m

    // returns the Java language modifiers for this class
    int i = cls.getModifiers();
    String retval = Modifier.toString(i);
    System.out.println(retval);
}

From source file:Main.java

public static void main(String... args) throws Exception {
    Class<?> c = Class.forName("java.lang.String");
    Constructor[] allConstructors = c.getDeclaredConstructors();
    for (Constructor ctor : allConstructors) {

        Modifier.toString(ctor.getModifiers());

    }//from ww w. j  av  a  2s. co  m
}

From source file:Main.java

public static void main(String... args) throws Exception {
    Class<?> c = Class.forName("java.lang.String");
    Constructor[] allConstructors = c.getDeclaredConstructors();
    for (Constructor ctor : allConstructors) {
        System.out.println(Modifier.toString(ctor.getModifiers()));
    }/*from   w  w w . ja  v  a  2  s. c om*/
}

From source file:Main.java

public static void main(String[] args) {
    Field[] fields = java.lang.Integer.class.getDeclaredFields();

    for (int i = 0; i < fields.length; i++) {
        Field f = fields[i];/*from  ww w  .  j  av  a2 s  .  co  m*/
        Class type = f.getType();
        String name = f.getName();
        System.out.print(Modifier.toString(f.getModifiers()));
        System.out.println(" " + type.getCanonicalName() + " " + name + ";");
    }
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    Constructor[] constructors = String.class.getDeclaredConstructors();
    for (int i = 0; i < constructors.length; i++) {
        Constructor c = constructors[i];
        Class[] paramTypes = c.getParameterTypes();
        String name = c.getName();
        System.out.print(Modifier.toString(c.getModifiers()));
        System.out.print(" " + name + "(");
        for (int j = 0; j < paramTypes.length; j++) {
            if (j > 0)
                System.out.print(", ");
            System.out.print(paramTypes[j].getCanonicalName());
        }//  w w w. j  av a2  s.  c o m
        System.out.println(");");
    }
}