Package ognl

Class DefaultMemberAccess

java.lang.Object
ognl.DefaultMemberAccess
All Implemented Interfaces:
ognl.MemberAccess

public class DefaultMemberAccess extends Object implements ognl.MemberAccess
This class provides methods for setting up and restoring access in a Field. Java 2 provides access utilities for setting and getting fields that are non-public. This object provides coarse-grained access controls to allow access to private, protected and package protected members. This will apply to all classes and members.
  • Field Details

    • allowPrivateAccess

      public boolean allowPrivateAccess
    • allowProtectedAccess

      public boolean allowProtectedAccess
    • allowPackageProtectedAccess

      public boolean allowPackageProtectedAccess
  • Constructor Details

    • DefaultMemberAccess

      public DefaultMemberAccess(boolean allowAllAccess)
    • DefaultMemberAccess

      public DefaultMemberAccess(boolean allowPrivateAccess, boolean allowProtectedAccess, boolean allowPackageProtectedAccess)
  • Method Details

    • getAllowPrivateAccess

      public boolean getAllowPrivateAccess()
    • setAllowPrivateAccess

      public void setAllowPrivateAccess(boolean value)
    • getAllowProtectedAccess

      public boolean getAllowProtectedAccess()
    • setAllowProtectedAccess

      public void setAllowProtectedAccess(boolean value)
    • getAllowPackageProtectedAccess

      public boolean getAllowPackageProtectedAccess()
    • setAllowPackageProtectedAccess

      public void setAllowPackageProtectedAccess(boolean value)
    • setup

      public Object setup(ognl.OgnlContext context, Object target, Member member, String propertyName)
      Specified by:
      setup in interface ognl.MemberAccess
    • restore

      public void restore(ognl.OgnlContext context, Object target, Member member, String propertyName, Object state)
      Specified by:
      restore in interface ognl.MemberAccess
    • isAccessible

      public boolean isAccessible(ognl.OgnlContext context, Object target, Member member, String propertyName)
      Returns true if the given member is accessible or can be made accessible by this object.
      Specified by:
      isAccessible in interface ognl.MemberAccess
      Parameters:
      context - the current execution context (not used).
      target - the Object to test accessibility for (not used).
      member - the Member to test accessibility for.
      propertyName - the property to test accessibility for (not used).
      Returns:
      true if the member is accessible in the context, false otherwise.