org.apache.commons.ognl
Class DefaultMemberAccess

java.lang.Object
  extended by org.apache.commons.ognl.DefaultMemberAccess
All Implemented Interfaces:
MemberAccess

public class DefaultMemberAccess
extends Object
implements 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.

Version:
15 October 1999
Author:
Luke Blanshard (blanshlu@netscape.net), Drew Davidson (drew@ognl.org)

Constructor Summary
DefaultMemberAccess(boolean allowAllAccess)
           
DefaultMemberAccess(boolean allowPrivateAccess, boolean allowProtectedAccess, boolean allowPackageProtectedAccess)
           
 
Method Summary
 boolean getAllowPackageProtectedAccess()
           
 boolean getAllowPrivateAccess()
           
 boolean getAllowProtectedAccess()
           
 boolean isAccessible(Map<String,Object> context, Object target, Member member, String propertyName)
          Returns true if the given member is accessible or can be made accessible by this object.
 void restore(Map<String,Object> context, Object target, Member member, String propertyName, Object state)
          Restores the member from the previous setup call.
 void setAllowPackageProtectedAccess(boolean value)
           
 void setAllowPrivateAccess(boolean value)
           
 void setAllowProtectedAccess(boolean value)
           
 Object setup(Map<String,Object> context, Object target, Member member, String propertyName)
          Sets the member up for accessibility
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMemberAccess

public DefaultMemberAccess(boolean allowAllAccess)

DefaultMemberAccess

public DefaultMemberAccess(boolean allowPrivateAccess,
                           boolean allowProtectedAccess,
                           boolean allowPackageProtectedAccess)
Method Detail

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(Map<String,Object> context,
                    Object target,
                    Member member,
                    String propertyName)
Description copied from interface: MemberAccess
Sets the member up for accessibility

Specified by:
setup in interface MemberAccess

restore

public void restore(Map<String,Object> context,
                    Object target,
                    Member member,
                    String propertyName,
                    Object state)
Description copied from interface: MemberAccess
Restores the member from the previous setup call.

Specified by:
restore in interface MemberAccess

isAccessible

public boolean isAccessible(Map<String,Object> 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 MemberAccess


Copyright © 1997-2013 The Apache Software Foundation. All Rights Reserved.