1 52 53 package com.go.teatools; 54 55 import com.go.trove.classfile.AccessFlags; 56 57 import java.beans.*; 58 import java.lang.reflect.*; 59 60 66 public abstract class FeatureDescription { 67 68 private TeaToolsUtils mUtils; 69 70 public FeatureDescription(TeaToolsUtils utils) { 71 mUtils = utils; 72 } 73 74 public TeaToolsUtils getTeaToolsUtils() { 75 return mUtils; 76 } 77 78 81 public String getName() { 82 FeatureDescriptor fd = getFeatureDescriptor(); 83 if (fd == null) { 84 return null; 85 } 86 87 return fd.getName(); 88 } 89 90 94 public String getDescription() { 95 FeatureDescriptor fd = getFeatureDescriptor(); 96 if (fd == null) { 97 return ""; 98 } 99 100 return getTeaToolsUtils().getDescription(fd); 101 } 102 103 109 public String getDescriptionFirstSentence() { 110 FeatureDescriptor fd = getFeatureDescriptor(); 111 if (fd == null) { 112 return ""; 113 } 114 115 return getTeaToolsUtils().getDescriptionFirstSentence(fd); 116 } 117 118 119 public String toString() { 120 return getLongFormat(); 121 } 122 123 124 128 public abstract FeatureDescriptor getFeatureDescriptor(); 129 130 133 public abstract String getShortFormat(); 134 135 138 public abstract String getLongFormat(); 139 140 141 } 142 | Popular Tags |