private static void initializeI18nField( Field fld ) throws IllegalAccessException { // Ensure field is public if ((fld.getModifiers() & Modifier.PUBLIC) != Modifier.PUBLIC) { throw new SystemFailureException(CommonI18n.i18nFieldNotPublic.text(fld.getName(), fld.getDeclaringClass())); } // Ensure field is static if ((fld.getModifiers() & Modifier.STATIC) != Modifier.STATIC) { throw new SystemFailureException(CommonI18n.i18nFieldNotStatic.text(fld.getName(), fld.getDeclaringClass())); } // Ensure field is not final if ((fld.getModifiers() & Modifier.FINAL) == Modifier.FINAL) { throw new SystemFailureException(CommonI18n.i18nFieldFinal.text(fld.getName(), fld.getDeclaringClass())); } // Ensure we can access field even if it's in a private class ClassUtil.makeAccessible(fld); // Initialize field. Do this every time the class is initialized (or re-initialized) fld.set(null, new I18n(fld.getName(), fld.getDeclaringClass())); }
private static void initializeI18nField( Field fld ) throws IllegalAccessException { // Ensure field is public if ((fld.getModifiers() & Modifier.PUBLIC) != Modifier.PUBLIC) { throw new SystemFailureException(CommonI18n.i18nFieldNotPublic.text(fld.getName(), fld.getDeclaringClass())); } // Ensure field is static if ((fld.getModifiers() & Modifier.STATIC) != Modifier.STATIC) { throw new SystemFailureException(CommonI18n.i18nFieldNotStatic.text(fld.getName(), fld.getDeclaringClass())); } // Ensure field is not final if ((fld.getModifiers() & Modifier.FINAL) == Modifier.FINAL) { throw new SystemFailureException(CommonI18n.i18nFieldFinal.text(fld.getName(), fld.getDeclaringClass())); } // Ensure we can access field even if it's in a private class ClassUtil.makeAccessible(fld); // Initialize field. Do this every time the class is initialized (or re-initialized) fld.set(null, new I18n(fld.getName(), fld.getDeclaringClass())); }
private static void initializeI18nField( Field fld ) throws IllegalAccessException { // Ensure field is public if ((fld.getModifiers() & Modifier.PUBLIC) != Modifier.PUBLIC) { throw new SystemFailureException(CommonI18n.i18nFieldNotPublic.text(fld.getName(), fld.getDeclaringClass())); } // Ensure field is static if ((fld.getModifiers() & Modifier.STATIC) != Modifier.STATIC) { throw new SystemFailureException(CommonI18n.i18nFieldNotStatic.text(fld.getName(), fld.getDeclaringClass())); } // Ensure field is not final if ((fld.getModifiers() & Modifier.FINAL) == Modifier.FINAL) { throw new SystemFailureException(CommonI18n.i18nFieldFinal.text(fld.getName(), fld.getDeclaringClass())); } // Ensure we can access field even if it's in a private class ClassUtil.makeAccessible(fld); // Initialize field. Do this every time the class is initialized (or re-initialized) fld.set(null, new I18n(fld.getName(), fld.getDeclaringClass())); }