jreversepro.reflect
Class JMember

java.lang.Object
  extended by jreversepro.reflect.JMember
Direct Known Subclasses:
JField, JMethod

public class JMember
extends java.lang.Object

Describes a class member ( both field and method ).

Author:
Karthik Kumar.

Field Summary
static int ACC_ABSTRACT
          Qualifer 'abstract'
static int ACC_FINAL
          Qualifier 'final'
static int ACC_NATIVE
          Qualifer 'native'
static int ACC_PRIVATE
          Private access specifier.
static int ACC_PROTECTED
          Protected access specifier.
static int ACC_PUBLIC
          Public access specifier.
static int ACC_STATIC
          Qualifer 'static'
static int ACC_STRICT
          Qualifer 'strictfp'
static int ACC_SYNCHRONIZED
          Qualifer 'synchronized'
static int ACC_TRANSIENT
          Qualifer 'transient' This qualifer is valid for fields only.
static int ACC_VOLATILE
          Qualifer 'volatile'.
protected  java.lang.String datatype
          This field contains the datatype of the member.
protected  java.lang.String name
          This field contains the name of the member ( field/ method).
protected  int qualifier
          This contains the integer representation of the qualifier of the member with the appropriate combination of bits set to know the qualifier string.
 
Constructor Summary
JMember()
           
 
Method Summary
 java.lang.String getDatatype()
           
 java.lang.String getName()
          Getter method for name
 int getQualifier()
          Getter method for the qualifier.
 java.lang.String getQualifierName()
           
static java.lang.String getStringRep(int rhsQualifier, boolean memberOnly)
          Returns the String Representation of the qualifier.
 boolean isFinal()
          Returns if this member is a 'final' one or not.
 boolean isStatic()
          Returns if this member is a 'static' one or not.
 void setDatatype(java.lang.String rhsType)
          Setter method for datatype.
 void setName(java.lang.String rhsName)
          Setter method for name
 void setQualifier(int rhsQualify)
          Setter method for qualifiers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACC_PUBLIC

public static final int ACC_PUBLIC
Public access specifier.

See Also:
Constant Field Values

ACC_PRIVATE

public static final int ACC_PRIVATE
Private access specifier.

See Also:
Constant Field Values

ACC_PROTECTED

public static final int ACC_PROTECTED
Protected access specifier.

See Also:
Constant Field Values

ACC_STATIC

public static final int ACC_STATIC
Qualifer 'static'

See Also:
Constant Field Values

ACC_FINAL

public static final int ACC_FINAL
Qualifier 'final'

See Also:
Constant Field Values

ACC_SYNCHRONIZED

public static final int ACC_SYNCHRONIZED
Qualifer 'synchronized'

See Also:
Constant Field Values

ACC_NATIVE

public static final int ACC_NATIVE
Qualifer 'native'

See Also:
Constant Field Values

ACC_ABSTRACT

public static final int ACC_ABSTRACT
Qualifer 'abstract'

See Also:
Constant Field Values

ACC_STRICT

public static final int ACC_STRICT
Qualifer 'strictfp'

See Also:
Constant Field Values

ACC_VOLATILE

public static final int ACC_VOLATILE
Qualifer 'volatile'. This qualifer is valid for fields only.

See Also:
Constant Field Values

ACC_TRANSIENT

public static final int ACC_TRANSIENT
Qualifer 'transient' This qualifer is valid for fields only.

See Also:
Constant Field Values

datatype

protected java.lang.String datatype
This field contains the datatype of the member.


name

protected java.lang.String name
This field contains the name of the member ( field/ method).


qualifier

protected int qualifier
This contains the integer representation of the qualifier of the member with the appropriate combination of bits set to know the qualifier string.

Constructor Detail

JMember

public JMember()
Method Detail

setDatatype

public void setDatatype(java.lang.String rhsType)
Setter method for datatype.

Parameters:
rhsType - data type value.

setName

public void setName(java.lang.String rhsName)
Setter method for name

Parameters:
rhsName - New Name

setQualifier

public void setQualifier(int rhsQualify)
Setter method for qualifiers.

Parameters:
rhsQualify - qualifier value

getStringRep

public static java.lang.String getStringRep(int rhsQualifier,
                                            boolean memberOnly)
Returns the String Representation of the qualifier. Certain qualifiers like volatile, transient, sync. are applicable only for methods and fields. and not classes. To identify them separately, we also pass another parameter called memberOnly. Only if this is set then those bits are checked for. Else they are ignored, since for a class/interface they may not be applicable.

Parameters:
rhsQualifier - Qualifier byte with the bits set.
memberOnly - Only if this is set then the bits relevant to fields and methods only are checked for. Else ignored.
Returns:
String Containing the representation.

getName

public java.lang.String getName()
Getter method for name

Returns:
Returns name of the member.

getQualifier

public int getQualifier()
Getter method for the qualifier.

Returns:
Returns the qualifier integer.

getQualifierName

public java.lang.String getQualifierName()
Returns:
Returns the qualifier in string format.

getDatatype

public java.lang.String getDatatype()
Returns:
Returns the data type

isFinal

public boolean isFinal()
Returns if this member is a 'final' one or not.

Returns:
Returns true, if final. false, otherwise.

isStatic

public boolean isStatic()
Returns if this member is a 'static' one or not.

Returns:
Returns true, if static. false, otherwise.


Submit Feedback to akkumar@users.sourceforge.net