Interface JMember
-
- All Superinterfaces:
JAnnotatedElement
,JElement
- All Known Subinterfaces:
JClass
,JConstructor
,JField
,JInvokable
,JMethod
,MClass
,MConstructor
,MField
,MInvokable
,MMember
,MMethod
,MParameter
- All Known Implementing Classes:
ArrayClassImpl
,BuiltinClassImpl
,ClassImpl
,ConstructorImpl
,FieldImpl
,InvokableImpl
,MemberImpl
,MethodImpl
,ParameterImpl
,PrimitiveClassImpl
,UnresolvedClassImpl
,VoidClassImpl
public interface JMember extends JAnnotatedElement
Represents an abstraction which can be member of a class. Such abstractions include: constructors, methods, fields, and classes (in the case of inner classes). JMember's share the following attributes in common: they have some level of access protection (public/protected/private) and are (usually) contained within a class.
Because classes themselves can be members of other classes, JClass extends JMember. In the case where a JClass represents a top-level class (i.e. not an inner class), JMember.getContainingClass() will always return null.
Note that the various access protection levels are all mutually exclusive. For a given abstraction, only one of isPrivate(), isPackagePrivate(), isProtected(), or isPublic() will return true. Note that this information is also exposed via getModifiers(), which returns a bit-field that is identical to that described in java.lang.reflect.Modifier.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JClass
getContainingClass()
Returns a representation of the class which contains this member.int
getModifiers()
Returns the modifiers specifier.boolean
isPackagePrivate()
Return true if this member is package private (i.e.boolean
isPrivate()
Return true if this member is private.boolean
isProtected()
Return true if this member is protected.boolean
isPublic()
Return true if this member is public.-
Methods inherited from interface org.apache.xmlbeans.impl.jam.JAnnotatedElement
getAllJavadocTags, getAnnotation, getAnnotation, getAnnotationProxy, getAnnotations, getAnnotationValue, getComment
-
Methods inherited from interface org.apache.xmlbeans.impl.jam.JElement
accept, getArtifact, getParent, getQualifiedName, getSimpleName, getSourcePosition, toString
-
-
-
-
Method Detail
-
getContainingClass
JClass getContainingClass()
Returns a representation of the class which contains this member. Note that if this member is an inner class, this method returns the class in which this class is declared (i.e. 'outer'). If this member is a top-level class, this method will always return null.
-
getModifiers
int getModifiers()
Returns the modifiers specifier. This is a bit field exactly like those returned by java.lang.Class.getModifiers() and can be manipulated using java.lang.reflect.Modifier in the same way.
-
isPackagePrivate
boolean isPackagePrivate()
Return true if this member is package private (i.e. the default access protection level).
-
isPrivate
boolean isPrivate()
Return true if this member is private. Equivalent to calling Modifier.isPrivate(member.getModifiers()).
-
isProtected
boolean isProtected()
Return true if this member is protected. Equivalent to calling Modifier.isProtected(member.getModifiers()).
-
isPublic
boolean isPublic()
Return true if this member is public. Equivalent to calling Modifier.isProtected(member.getModifiers()).
-
-