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 Ruleallow()Returns a singleton rule which is always allowed.static Ruledeny()Returns a singleton rule which is always denied, with thestandardaction.static Ruledeny(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.inthashCode()final booleanReturns true if the rule is always allowed.final booleanSame asisDenied().final booleanSame asisDenied().booleanisDenied()Returns true if the rule is always denied.final RuleruleForConstructor(CharSequence descriptor) Returnsthis.final RuleruleForConstructor(Class<?>... paramTypes) Returnsthis.final RuleruleForMethod(CharSequence name, CharSequence descriptor) Returnsthis.final RuleruleForMethod(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:
isAnyDeniedin interfaceRules.ForClass
-
isConstructionDenied
public final boolean isConstructionDenied()Same asisDenied().- Specified by:
isConstructionDeniedin interfaceRules.ForClass
-
ruleForConstructor
Returnsthis.- Specified by:
ruleForConstructorin interfaceRules.ForClass- Parameters:
descriptor- descriptor for the parameters, including parenthesis, but the return type is optional
-
ruleForConstructor
Returnsthis.- Specified by:
ruleForConstructorin interfaceRules.ForClass
-
ruleForMethod
Returnsthis.- Specified by:
ruleForMethodin interfaceRules.ForClass- Parameters:
descriptor- descriptor for the parameters, including parenthesis, but the return type is optional
-
ruleForMethod
Returnsthis.- Specified by:
ruleForMethodin interfaceRules.ForClass
-
hashCode
-
toString
-