Class AccessCode


  • public class AccessCode
    extends java.lang.Object
    Represents access styles for members of a class and field through a 5-bit integer.
    The bits designate following aspects of access style being used at class level:
  • Bit position 0 (UNKNOWN): generally 0. All bits as zero represent that no access style has been set. 1 denotes that the class has no property at all and its access can not be determined.
  • Bit position 1 (FIELD): Field based access is default
  • Bit position 2 (PROPERTY): Property based access is default
  • Bit position 3 (EXPLICIT): whether explicit or implicit Explicit access style allows members to use mixed access style, implicit access style does not
  • Bit position 4 (MIXED): whether all members are using the same access style or not. Can only be set if EXPLICT bit is set. If set, then bit 1 or 2 denotes what is the default.
    The same bits designate following aspects of access style being used at field level:
  • Bit position 0 (UNKNOWN): always 0. All bits as zero represent that no access style has been set.
  • Bit position 1 (FIELD): Field based access is default
  • Bit position 2 (PROPERTY): Property based access is default
  • Bit position 3 (EXPLICIT): whether the access is explicit or implicit
  • Bit position 4 (MIXED): not used

    Validation Rules for the bits:

  • 1. Only one of the position 1 (FIELD) and 2 (PROPERTY) can be set. A single bit is not used for legacy reason to cope with the access constants used in ClassMetaData which this class now refactors to address new behaviors specified in JPA 2.0 specification.
  • 2. if position 3 (EXPLICIT) is set then one of position 1 (FIELD) and 2 (PROPERTY) must be set.
  • 3. If position 4 (MIXED) is set then the set position of either FIELD or PROPERTY designates the default access of the member.
Since:
2.0.0
Author:
Pinaki Poddar