1 26 27 package org.objectweb.util.browser.plugin.java.reflect; 28 29 import java.lang.reflect.Field ; 30 31 39 public class FieldUtil 40 extends MemberUtil { 41 42 48 49 protected Field field_; 50 51 57 public FieldUtil(Field field){ 58 super(); 59 field_ = field; 60 } 61 62 public FieldUtil(Field field, ClassVisibilityConfig config) { 63 super(config); 64 field_ = field; 65 } 66 67 73 79 82 public String toHTML(){ 83 boolean displayType = config_.get(ClassVisibilityConfig.ATTRIBUTE + "." + ClassVisibilityConfig.TYPE); 84 String visibility = getVisibility(field_.getModifiers()); 85 StringBuffer name = new StringBuffer ((visibility!=null?"<i>"+visibility+"</i>" + " ":"") + "<b>" + field_.getName() + "</b>"); 86 if(displayType) 87 name.append(": " + ClassVisibility.getTypeName(field_.getType())); 88 return name.toString(); 89 } 90 91 } 92 93 94 | Popular Tags |