Class Rule
java.lang.Object
org.cojen.boxtin.Rule
- All Implemented Interfaces:
Rules.ForClass
Indicates if access to an operation is allowed or denied.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Rule
allow()
Returns a singleton rule which is always allowed.static Rule
deny()
Returns a singleton rule which is always denied, with thestandard
action.static Rule
deny
(DenyAction action) Returns a rule which is denied with the given action.Returns the deny action for this rule, which is null if the rule isn't denied.int
hashCode()
final boolean
Returns true if the rule is always allowed.final boolean
Same asisDenied()
.final boolean
Same asisDenied()
.boolean
isDenied()
Returns true if the rule is always denied.final Rule
ruleForConstructor
(CharSequence descriptor) Returnsthis
.final Rule
ruleForConstructor
(Class<?>... paramTypes) Returnsthis
.final Rule
ruleForMethod
(CharSequence name, CharSequence descriptor) Returnsthis
.final Rule
ruleForMethod
(CharSequence name, Class<?>... paramTypes) Returnsthis
.toString()
-
Method Details
-
allow
Returns a singleton rule which is always allowed. -
deny
-
deny
Returns a rule which is denied with the given action. -
isAllowed
public final boolean isAllowed()Returns true if the rule is always allowed. -
isDenied
public boolean isDenied()Returns true if the rule is always denied. -
denyAction
Returns the deny action for this rule, which is null if the rule isn't denied.- Returns:
- null if not denied
-
isAnyDenied
public final boolean isAnyDenied()Same asisDenied()
.- Specified by:
isAnyDenied
in interfaceRules.ForClass
-
isConstructionDenied
public final boolean isConstructionDenied()Same asisDenied()
.- Specified by:
isConstructionDenied
in interfaceRules.ForClass
-
ruleForConstructor
Returnsthis
.- Specified by:
ruleForConstructor
in interfaceRules.ForClass
- Parameters:
descriptor
- descriptor for the parameters, including parenthesis, but the return type is optional
-
ruleForConstructor
Returnsthis
.- Specified by:
ruleForConstructor
in interfaceRules.ForClass
-
ruleForMethod
Returnsthis
.- Specified by:
ruleForMethod
in interfaceRules.ForClass
- Parameters:
descriptor
- descriptor for the parameters, including parenthesis, but the return type is optional
-
ruleForMethod
Returnsthis
.- Specified by:
ruleForMethod
in interfaceRules.ForClass
-
hashCode
-
toString
-