home *** CD-ROM | disk | FTP | other *** search
- package lotus.notes.internal;
-
- import java.lang.reflect.Method;
- import java.lang.reflect.Modifier;
- import java.util.Enumeration;
-
- class InfoPaneMethodItem extends InfoPaneMemberItem {
- protected String name;
- protected String longName;
- protected InfoPaneVector vector;
-
- InfoPaneMethodItem() {
- }
-
- InfoPaneMethodItem(Method var1, boolean var2) {
- this.longName = var1.toString();
- this.name = var1.getName();
- this.AddParams(var1.getParameterTypes());
- if (!Modifier.isPublic(var1.getDeclaringClass().getModifiers())) {
- this.longName = this.name;
- }
-
- this.vector = new InfoPaneVector();
-
- try {
- this.AddModifiers(var1, var2);
- this.AddReturnType(var1);
- this.AddThrows(var1);
- } catch (InfoPaneException var4) {
- System.out.println("InfoPaneMethodItem constructor: " + var4);
- }
- }
-
- void AddParams(Class[] var1) {
- this.name = this.name + "(";
- if (var1 != null) {
- try {
- this.AddParam(var1[0]);
-
- for(int var2 = 1; var1[var2] != null; ++var2) {
- this.name = this.name + ",";
- this.AddParam(var1[var2]);
- }
- } catch (ArrayIndexOutOfBoundsException var3) {
- }
- }
-
- this.name = this.name + ")";
- }
-
- void AddParam(Class var1) {
- String var2;
- for(var2 = ""; var1.isArray(); var2 = var2 + "[]") {
- var1 = var1.getComponentType();
- }
-
- this.name = this.name + InfoPaneMemberItem.StripPack(var1.getName()) + var2;
- }
-
- void AddModifiers(Method var1, boolean var2) throws InfoPaneException {
- InfoPaneMethodSubItem var3 = new InfoPaneMethodSubItem(var1.getModifiers(), var2);
- if (var3.HasSubCategory()) {
- this.vector.Insert(var3);
- }
-
- }
-
- void AddReturnType(Method var1) throws InfoPaneException {
- InfoPaneMethodSubItem var2 = new InfoPaneMethodSubItem(var1.getReturnType());
- this.vector.Insert(var2);
- }
-
- void AddThrows(Method var1) throws InfoPaneException {
- InfoPaneMethodSubItem var2 = new InfoPaneMethodSubItem(var1.getExceptionTypes());
- if (var2.HasSubCategory()) {
- this.vector.Insert(var2);
- }
-
- }
-
- public boolean HasSubCategory() {
- return this.vector != null && this.vector.size() > 0;
- }
-
- public Enumeration GetEnumeration() {
- return this.vector == null ? null : this.vector.elements();
- }
-
- public String GetName() {
- return this.name;
- }
-
- public String GetLongName() {
- return this.longName;
- }
-
- public boolean HasLongName() {
- return this.longName != null && this.name != null && this.longName.length() > this.name.length();
- }
-
- public boolean CanPaste() {
- return true;
- }
-
- public void Print(String var1, boolean var2) {
- if (var2 && this.HasLongName() && this.CanPaste()) {
- System.out.println(var1 + this.GetLongName());
- } else {
- System.out.println(var1 + this.GetName());
- }
-
- if (this.HasSubCategory()) {
- Enumeration var3 = this.GetEnumeration();
-
- while(var3.hasMoreElements()) {
- ((InfoPaneItem)var3.nextElement()).Print(var1 + " ", var2);
- }
- }
-
- }
- }
-