1 22 package org.aspectj.tools.ajdoc; 23 24 import org.aspectj.compiler.base.ast.Dec; 25 import org.aspectj.compiler.base.ast.FieldDec; 26 27 import com.sun.javadoc.ClassDoc; 28 import com.sun.javadoc.SerialFieldTag; 29 30 import java.lang.reflect.Modifier ; 31 32 public class FieldDocImpl 33 extends MemberDocImpl 34 implements org.aspectj.ajdoc.FieldDoc { 35 36 37 private final FieldDec field; 38 39 44 private org.aspectj.compiler.base.ast.Type type; 45 46 55 public void setType(org.aspectj.compiler.base.ast.Type type) { 56 this.type = type; 57 } 58 59 public FieldDocImpl(ClassDoc containingClass, FieldDec field) { 60 super(containingClass); 61 this.field = field; 62 setType(field.getType()); 63 } 64 65 protected Dec dec() { 66 return field; 67 } 68 69 70 protected FieldDec fieldDec() { 71 return field; 72 } 73 74 79 public boolean isField() { 80 return true; 81 } 82 83 88 public com.sun.javadoc.Type type() { 89 return TypeImpl.getInstance(type); 90 } 91 92 97 public boolean isVolatile() { 98 return Modifier.isVolatile(modifierSpecifier()); 99 } 100 101 106 public boolean isTransient() { 107 return Modifier.isTransient(modifierSpecifier()); 108 } 109 110 116 public SerialFieldTag[] serialFieldTags() { 117 return getComment().serialFieldTags(); 118 } 119 120 125 public String toString() { 126 return name(); 127 } 128 129 136 public boolean weakEquals(Object md) { 137 if (!(md instanceof FieldDocImpl)) return false; 138 return name().equals(((FieldDocImpl)md).name()); 139 } 140 } 141 | Popular Tags |