Top Description Methods
org.glassfish.pfl.dynamic.codegen.spi

public Interface MemberInfo

Known Direct Subinterfaces
org.glassfish.pfl.dynamic.codegen.spi.MethodInfo, org.glassfish.pfl.dynamic.codegen.spi.FieldInfo
Known Direct Implementers
org.glassfish.pfl.dynamic.codegen.impl.MemberInfoBase

An interface that provides information common to all kinds of class members. This includes data members (represented by FieldInfo) and methods and constructors (represented by MethodInfo). This can be used to describe both MethodGenerators that are used to generate code and pre-existing Java classes.

Method Summary

Modifier and TypeMethod and Description
public boolean
isAccessibleInContext(ClassInfo
the ClassInfo of the class in which the access occurs.
definingClass
,
ClassInfo
the ClassInfo of the class used to access the member.
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).

public int
modifiers()

Return the modifiers on this member

public ClassInfo
myClassInfo()

Return the ClassInfo of the class that contains this member.

public String
name()

Return the name of this member.

Method Detail

isAccessibleInContextback to summary
public 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). 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().
Parameters
definingClass:ClassInfo

the ClassInfo of the class in which the access occurs.

accessClass:ClassInfo

the ClassInfo of the class used to access the member.

modifiersback to summary
public int modifiers()

Return the modifiers on this member

myClassInfoback to summary
public ClassInfo myClassInfo()

Return the ClassInfo of the class that contains this member.

nameback to summary
public String name()

Return the name of this member.