Code example for Field

Methods: get, getModifiers

0
            return null; 
        } 
        // Is there a singleton instance called INSTANCE? 
        try { 
            Field field = clazz.getField("INSTANCE");
            if (Modifier.isStatic(field.getModifiers())) {
                try { 
                    Object o = field.get(null);
                    if (o != null) {
                        return outputClass.cast(o);
                    } 
                } 
                catch (IllegalAccessException e) {
                    Logger.info("Could not access INSTANCE field in class " + classname + ": trying constructor.");
                } 
                catch (ClassCastException e) {
                    Logger.info("Could not cast INSTANCE field to " + outputClass + " in class " + classname + ": trying constructor.");
                } 
            } 
        } 
        catch (NoSuchFieldException e) {