1 package com.protomatter.pool; 2 3 52 53 import java.util.*; 54 import java.lang.reflect.*; 55 56 59 public class MessageConstants 60 { 61 public static final String CANNOT_SHRINK_POOL_1 = "CannotShrinkPool1"; 62 63 public static final String CANNOT_SHRINK_POOL_2 = "CannotShrinkPool2"; 64 65 private MessageConstants() 66 { 67 super(); 68 } 69 70 73 public static void main(String args[]) 74 throws Exception 75 { 76 Class c = MessageConstants.class; 77 System.out.println("Constants class: " + c.getName()); 78 System.out.println("Locale: " + Locale.getDefault()); 79 System.out.println(""); 80 Field fields[] = c.getDeclaredFields(); 81 int count = 0; 82 for (int i=0; i<fields.length; i++) 83 { 84 if (fields[i].getType() == String .class) 85 { 86 String name = fields[i].getName(); 87 String value = (String )fields[i].get(null); 88 String val = PoolResources.getResourceString(value); 89 System.out.println("Variable name: " + name); 90 System.out.println(" value: " + value); 91 System.out.println(" property: " + val); 92 System.out.println(""); 93 count++; 94 } 95 } 96 System.out.println("Found " + count + " messages."); 97 } 98 } 99 | Popular Tags |