1 /* 2 * Copyright (C) 2008 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 public abstract class MemberInfo extends DocInfo implements Comparable, Scoped 18 { MemberInfo(String rawCommentText, String name, String signature, ClassInfo containingClass, ClassInfo realContainingClass, boolean isPublic, boolean isProtected, boolean isPackagePrivate, boolean isPrivate, boolean isFinal, boolean isStatic, boolean isSynthetic, String kind, SourcePositionInfo position, AnnotationInstanceInfo[] annotations)19 public MemberInfo(String rawCommentText, String name, String signature, 20 ClassInfo containingClass, ClassInfo realContainingClass, 21 boolean isPublic, boolean isProtected, 22 boolean isPackagePrivate, boolean isPrivate, 23 boolean isFinal, boolean isStatic, boolean isSynthetic, 24 String kind, 25 SourcePositionInfo position, 26 AnnotationInstanceInfo[] annotations) 27 { 28 super(rawCommentText, position); 29 mName = name; 30 mSignature = signature; 31 mContainingClass = containingClass; 32 mRealContainingClass = realContainingClass; 33 mIsPublic = isPublic; 34 mIsProtected = isProtected; 35 mIsPackagePrivate = isPackagePrivate; 36 mIsPrivate = isPrivate; 37 mIsFinal = isFinal; 38 mIsStatic = isStatic; 39 mIsSynthetic = isSynthetic; 40 mKind = kind; 41 mAnnotations = annotations; 42 } 43 isExecutable()44 public abstract boolean isExecutable(); 45 anchor()46 public String anchor() 47 { 48 if (mSignature != null) { 49 return mName + mSignature; 50 } else { 51 return mName; 52 } 53 } 54 htmlPage()55 public String htmlPage() { 56 return mContainingClass.htmlPage() + "#" + anchor(); 57 } 58 compareTo(Object that)59 public int compareTo(Object that) { 60 return this.htmlPage().compareTo(((MemberInfo)that).htmlPage()); 61 } 62 name()63 public String name() 64 { 65 return mName; 66 } 67 signature()68 public String signature() 69 { 70 return mSignature; 71 } 72 realContainingClass()73 public ClassInfo realContainingClass() 74 { 75 return mRealContainingClass; 76 } 77 containingClass()78 public ClassInfo containingClass() 79 { 80 return mContainingClass; 81 } 82 isPublic()83 public boolean isPublic() 84 { 85 return mIsPublic; 86 } 87 isProtected()88 public boolean isProtected() 89 { 90 return mIsProtected; 91 } 92 isPackagePrivate()93 public boolean isPackagePrivate() 94 { 95 return mIsPackagePrivate; 96 } 97 isPrivate()98 public boolean isPrivate() 99 { 100 return mIsPrivate; 101 } 102 isStatic()103 public boolean isStatic() 104 { 105 return mIsStatic; 106 } 107 isFinal()108 public boolean isFinal() 109 { 110 return mIsFinal; 111 } 112 isSynthetic()113 public boolean isSynthetic() 114 { 115 return mIsSynthetic; 116 } 117 118 @Override parent()119 public ContainerInfo parent() 120 { 121 return mContainingClass; 122 } 123 checkLevel()124 public boolean checkLevel() 125 { 126 return DroidDoc.checkLevel(mIsPublic, mIsProtected, 127 mIsPackagePrivate, mIsPrivate, isHidden()); 128 } 129 kind()130 public String kind() 131 { 132 return mKind; 133 } 134 annotations()135 public AnnotationInstanceInfo[] annotations() 136 { 137 return mAnnotations; 138 } 139 140 ClassInfo mContainingClass; 141 ClassInfo mRealContainingClass; 142 String mName; 143 String mSignature; 144 boolean mIsPublic; 145 boolean mIsProtected; 146 boolean mIsPackagePrivate; 147 boolean mIsPrivate; 148 boolean mIsFinal; 149 boolean mIsStatic; 150 boolean mIsSynthetic; 151 String mKind; 152 private AnnotationInstanceInfo[] mAnnotations; 153 154 } 155 156