Example usage for java.lang.reflect Modifier TRANSIENT

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

Introduction

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

Prototype

int TRANSIENT

To view the source code for java.lang.reflect Modifier TRANSIENT.

Click Source Link

Document

The int value representing the transient modifier.

Usage

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) {
        int searchMod = Modifier.TRANSIENT;
        int mods = accessModifiers(ctor.getModifiers());
        if (searchMod == mods) {
            System.out.println(ctor);
        }//from   www .ja  v a2 s .  c om
    }
}

From source file:Main.java

public static Gson getGson() {
    return new GsonBuilder().excludeFieldsWithModifiers(new int[] { Modifier.STATIC, Modifier.TRANSIENT //, Modifier.FINAL 
    }).excludeFieldsWithoutExposeAnnotation().create();
}

From source file:Main.java

public static Gson getGsonSimple() {
    return new GsonBuilder().excludeFieldsWithModifiers(new int[] { Modifier.STATIC, Modifier.TRANSIENT //, Modifier.FINAL 
    }).create();/*from  ww  w .ja  v a 2 s .  c om*/
}

From source file:Main.java

public static Gson getGsonWithPrettyPrinting() {
    return new GsonBuilder().excludeFieldsWithModifiers(new int[] { Modifier.STATIC, Modifier.TRANSIENT //, Modifier.FINAL 
    }).excludeFieldsWithoutExposeAnnotation().setPrettyPrinting().create();
}

From source file:Main.java

public static Gson getGsonSimpleWithPrettyPrinting() {
    return new GsonBuilder().excludeFieldsWithModifiers(new int[] { Modifier.STATIC, Modifier.TRANSIENT //, Modifier.FINAL 
    }).setPrettyPrinting().create();/*w w  w.  j a  va2 s  .co m*/
}

From source file:Main.java

private static int accessModifiers(int m) {
    return m & Modifier.TRANSIENT;
}

From source file:utils.LocoUtils.java

public static Gson getGson() {
    return new GsonBuilder().excludeFieldsWithModifiers(new int[] { Modifier.STATIC, Modifier.TRANSIENT })
            .excludeFieldsWithoutExposeAnnotation().create();
}

From source file:utils.LocoUtils.java

public static Gson getGsonWithPrettyPrinting() {
    return new GsonBuilder().excludeFieldsWithModifiers(new int[] { Modifier.STATIC, Modifier.TRANSIENT })
            .excludeFieldsWithoutExposeAnnotation().setPrettyPrinting().create();
}

From source file:utils.LocoUtils.java

public static Gson getGsonSimple() {
    return new GsonBuilder().excludeFieldsWithModifiers(new int[] { Modifier.STATIC, Modifier.TRANSIENT })
            .create();/*from   w w w.j ava 2s. co  m*/
}

From source file:utils.LocoUtils.java

public static Gson getGsonSimpleWithPrettyPrinting() {
    return new GsonBuilder().excludeFieldsWithModifiers(new int[] { Modifier.STATIC, Modifier.TRANSIENT })
            .setPrettyPrinting().create();
}