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 class ParameterDescription extends FeatureDescription { 67 68 private TypeDescription mType; 69 private ParameterDescriptor mParameterDescriptor; 70 71 74 public ParameterDescription(TypeDescription type, 75 ParameterDescriptor pd, 76 TeaToolsUtils utils) { 77 78 super(utils); 79 80 mType = type; 81 mParameterDescriptor = pd; 82 } 83 84 87 public TypeDescription getType() { 88 return mType; 89 } 90 91 94 public ParameterDescriptor getParameterDescriptor() { 95 return mParameterDescriptor; 96 } 97 98 102 public String getName() { 103 String name = super.getName(); 104 if (name != null) { 105 if (name.equals(getParameterDescriptor().getDisplayName()) || 106 name.length() == 0) { 107 name = null; 108 } 109 } 110 111 return name; 112 } 113 114 115 119 public FeatureDescriptor getFeatureDescriptor() { 120 return getParameterDescriptor(); 121 } 122 123 public String getShortFormat() { 124 return getType().getShortFormat(); 125 } 126 127 public String getLongFormat() { 128 String name = getName(); 129 String longFormat = getType().getLongFormat(); 130 if (name != null) { 131 longFormat = longFormat + " " + name; 132 } 133 134 return longFormat; 135 } 136 137 138 139 140 } 141 | Popular Tags |