1 22 package org.jboss.reflect.plugins; 23 24 import org.jboss.reflect.spi.EnumConstantInfo; 25 import org.jboss.reflect.spi.EnumInfo; 26 27 import java.util.HashMap ; 28 29 35 public class EnumInfoImpl extends ClassInfoImpl implements EnumInfo 36 { 37 38 private static final long serialVersionUID = 3617851958849713457L; 39 40 41 protected EnumConstantInfoImpl[] enumConstants; 42 43 44 protected HashMap <String , EnumConstantInfo> constants = new HashMap <String , EnumConstantInfo>(); 45 46 49 public EnumInfoImpl() 50 { 51 } 52 53 59 public EnumInfoImpl(String name, int modifiers) 60 { 61 super(name, modifiers, null, null); 62 } 63 64 69 public void setEnumConstants(EnumConstantInfoImpl[] enumConstants) 70 { 71 for (int i = 0; i < enumConstants.length; i++) 72 constants.put(enumConstants[i].getName(), enumConstants[i]); 73 } 74 75 public EnumConstantInfo[] getEnumConstants() 76 { 77 return enumConstants; 78 } 79 80 public EnumConstantInfo getEnumConstant(String name) 81 { 82 return constants.get(name); 83 } 84 } 85 | Popular Tags |