|
What this is
Other links
The source codepackage org.netbeans.modules.tasklist.javadoc; import java.lang.reflect.Modifier; import org.openide.src.ClassElement; import org.openide.src.MemberElement; /** * */ public class JavaDocUtils { /** * Creates a new instance of JavaDocUtils */ private JavaDocUtils() { } public static int getEffectiveAccess(MemberElement el) { int access = el.getModifiers() & (Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE); if (access == Modifier.PRIVATE) return access; ClassElement decl = el.getDeclaringClass(); if (decl == null) // it is a top-level class return access; if (!decl.isClassOrInterface()) // interface members must be public access = Modifier.PUBLIC; int parentAccess = getEffectiveAccess(decl); switch (parentAccess) { case Modifier.PRIVATE: case 0: // private members were handled above, everything else is // constrained by parent's privacy return parentAccess; case Modifier.PROTECTED: // member can be restricted to only the package return access == 0 ? 0 : parentAccess; case Modifier.PUBLIC: default: return access; } } } |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.