Search in sources :

Example 1 with I18n

use of org.glassfish.api.I18n in project Payara by payara.

the class CommandModelImpl method init.

public static Map<String, ParamModel> init(Class commandType, I18n i18n, LocalStringManager localStrings) {
    Class currentClazz = commandType;
    Map<String, ParamModel> results = new LinkedHashMap<String, ParamModel>();
    while (currentClazz != null) {
        for (Field f : currentClazz.getDeclaredFields()) {
            I18n fieldI18n = f.getAnnotation(I18n.class);
            if (fieldI18n != null) {
                localStrings = new LocalStringManagerImpl(commandType);
            }
            add(results, f, i18n, localStrings);
        }
        for (Method m : currentClazz.getDeclaredMethods()) {
            I18n fieldI18n = m.getAnnotation(I18n.class);
            if (fieldI18n != null) {
                localStrings = new LocalStringManagerImpl(commandType);
            }
            add(results, m, i18n, localStrings);
        }
        currentClazz = currentClazz.getSuperclass();
    }
    return results;
}
Also used : Field(java.lang.reflect.Field) LocalStringManagerImpl(com.sun.enterprise.util.LocalStringManagerImpl) Method(java.lang.reflect.Method) LinkedHashMap(java.util.LinkedHashMap) I18n(org.glassfish.api.I18n)

Aggregations

LocalStringManagerImpl (com.sun.enterprise.util.LocalStringManagerImpl)1 Field (java.lang.reflect.Field)1 Method (java.lang.reflect.Method)1 LinkedHashMap (java.util.LinkedHashMap)1 I18n (org.glassfish.api.I18n)1