Class MemberInfoBase
- java.lang.Object
-
- org.glassfish.pfl.dynamic.codegen.impl.MemberInfoBase
-
- All Implemented Interfaces:
MemberInfo
- Direct Known Subclasses:
FieldInfoImpl
,MethodInfoBase
public class MemberInfoBase extends java.lang.Object implements MemberInfo
-
-
Field Summary
Fields Modifier and Type Field Description private int
modifiers
private ClassInfo
myClassInfo
private java.lang.String
name
-
Constructor Summary
Constructors Constructor Description MemberInfoBase(ClassInfo myClassInfo, int modifiers, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
int
hashCode()
boolean
isAccessibleInContext(ClassInfo definingClass, ClassInfo accessClass)
Returns true iff this member is accessible in the context defined by definingClass (the class containing the reference to the member) and accessClass (the type of the expression used to access this member).int
modifiers()
Return the modifiers on this memberClassInfo
myClassInfo()
Return the ClassInfo of the class that contains this member.java.lang.String
name()
Return the name of this member.java.lang.String
toString()
-
-
-
Field Detail
-
myClassInfo
private ClassInfo myClassInfo
-
modifiers
private int modifiers
-
name
private java.lang.String name
-
-
Constructor Detail
-
MemberInfoBase
public MemberInfoBase(ClassInfo myClassInfo, int modifiers, java.lang.String name)
-
-
Method Detail
-
myClassInfo
public ClassInfo myClassInfo()
Description copied from interface:MemberInfo
Return the ClassInfo of the class that contains this member.- Specified by:
myClassInfo
in interfaceMemberInfo
-
modifiers
public int modifiers()
Description copied from interface:MemberInfo
Return the modifiers on this member- Specified by:
modifiers
in interfaceMemberInfo
-
name
public java.lang.String name()
Description copied from interface:MemberInfo
Return the name of this member.- Specified by:
name
in interfaceMemberInfo
-
isAccessibleInContext
public boolean isAccessibleInContext(ClassInfo definingClass, ClassInfo accessClass)
Description copied from interface:MemberInfo
Returns true iff this member is accessible in the context defined by definingClass (the class containing the reference to the member) and accessClass (the type of the expression used to access this member). This works as follows:- If modifiers() contains PUBLIC, the access is permitted.
- If modifiers() contains PRIVATE, the access is permitted iff myClassInfo().name() is the same as definingClass.name().
- If modifiers() contains PROTECTED, the access is permitted as follows:
- If myClassInfo().pkgName() is the same as definingClass.pkgName(), the access is permitted.
- Otherwise, the access is permitted iff definingClass is a subclass of myClassInfo(), and accessClass is a subclass of definingClass.
- Otherwise, the access is permitted iff myClassInfo().pkgName is the same as definingClass.pkgName().
- Specified by:
isAccessibleInContext
in interfaceMemberInfo
- Parameters:
definingClass
- the ClassInfo of the class in which the access occurs.accessClass
- the ClassInfo of the class used to access the member.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-