public interface Guard
该接口表示一个保护,它是一个用于保护对另一个对象的访问的对象。
此接口包含一个单一的方法, checkGuard
,具有单个object
参数。 checkGuard
被调用(由GuardedObject getObject
方法)来确定是否允许访问该对象。
GuardedObject
Modifier and Type | Method and Description |
---|---|
void |
checkGuard(Object object)
确定是否允许访问被保护对象
object 。
|
void checkGuard(Object object) throws SecurityException
object
。
如果允许访问,则默认返回。
否则,抛出SecurityException。
object
- 被保护者保护的对象。
SecurityException
- if access is denied.
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.