⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 memberaccessmanager.html

📁 ONGL学习的好书,介绍ONGL的相关知识
💻 HTML
字号:
<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter&nbsp;7.&nbsp;Member Access</title><link href="../docbook.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.65.0" name="generator"><link rel="home" href="index.html" title="OGNL Developer Guide"><link rel="up" href="index.html" title="OGNL Developer Guide"><link rel="previous" href="typeConversion.html" title="Chapter&nbsp;6.&nbsp;Type Conversion"><link rel="next" href="nullHandler.html" title="Chapter&nbsp;8.&nbsp;Null Handler"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">Chapter&nbsp;7.&nbsp;Member Access</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="typeConversion.html"><img src="../images/navigation/prev.gif" alt="Prev"></a>&nbsp;</td><th align="center" width="60%">&nbsp;</th><td align="right" width="20%">&nbsp;<a accesskey="n" href="nullHandler.html"><img src="../images/navigation/next.gif" alt="Next"></a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="memberAccessManager"></a>Chapter&nbsp;7.&nbsp;Member Access</h2></div></div><div></div></div><p>Normally in Java the only members of a class (fields, methods) that can be accessed are the ones defined with public access. <span class="acronym">OGNL</span> includes an interface that you can set globally (using <tt class="function">OgnlContext.setMemberAccessManager()</tt>)
        that allows you to modify the runtime in Java 2 to allow access to private, protected and package protected fields and methods. Included in the <span class="acronym">OGNL</span> package is the <tt class="classname">DefaultMemberAccess</tt> class. It
        contains a constructor that allows you to selectively lower the protection on any private, protected or package protected members<tt class="classname"> using the AccessibleObject</tt> interface in Java2. The default class can be subclasses to
        select different objects for which accessibility is allowed.</p><pre class="programlisting">public interface MemberAccess
{
    public Object setup( Member member );
    public void restore( Member member, Object state );
    public boolean isAccessible( Member member );
}</pre></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="typeConversion.html"><img src="../images/navigation/prev.gif" alt="Prev"></a>&nbsp;</td><td align="center" width="20%"><a accesskey="u" href="index.html"><img src="../images/navigation/up.gif" alt="Up"></a></td><td align="right" width="40%">&nbsp;<a accesskey="n" href="nullHandler.html"><img src="../images/navigation/next.gif" alt="Next"></a></td></tr><tr><td valign="top" align="left" width="40%">Chapter&nbsp;6.&nbsp;Type Conversion&nbsp;</td><td align="center" width="20%"><a accesskey="h" href="index.html"><img src="../images/navigation/home.gif" alt="Home"></a></td><td valign="top" align="right" width="40%">&nbsp;Chapter&nbsp;8.&nbsp;Null Handler</td></tr></table></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -