Class RulesBuilder.ClassScope
java.lang.Object
org.cojen.boxtin.RulesBuilder.ClassScope
- Enclosing class:
RulesBuilder
Builder of rules at the class level.
-
Method Summary
Modifier and TypeMethodDescriptionallowAll()Allow access to all constructors and locally declared methods, superseding all previous rules.Allow access to all constructors, superseding all previous rules.Allow access to all locally declared methods, superseding all previous rules.allowMethod(String name) Allow access to all variants of the given method, superseding all previous rules.allowVariant(Class<?>... paramTypes) Allow access to a specific variant of the current constructor or method, superseding all previous rules.allowVariant(String descriptor) Allow access to a specific variant of the current constructor or method, superseding all previous rules.denyAll()Deny access to all constructors and locally declared methods, superseding all previous rules.denyAll(DenyAction action) Deny access to all constructors and locally declared methods, superseding all previous rules.Deny access to all constructors, superseding all previous rules.denyAllConstructors(DenyAction action) Deny access to all constructors, superseding all previous rules.Deny access to all locally declared methods, superseding all previous rules.denyAllMethods(DenyAction action) Deny access to all locally declared methods, superseding all previous rules.denyMethod(String name) Deny access to all variants of the given method, superseding all previous rules.denyMethod(DenyAction action, String name) Deny access to all variants of the given method, superseding all previous rules.denyVariant(Class<?>... paramTypes) Deny access to a specific variant of the current constructor or method, superseding all previous rules.denyVariant(String descriptor) Deny access to a specific variant of the current constructor or method, superseding all previous rules.denyVariant(DenyAction action, Class<?>... paramTypes) Deny access to a specific variant of the current constructor or method, superseding all previous rules.denyVariant(DenyAction action, String descriptor) Deny access to a specific variant of the current constructor or method, superseding all previous rules.end()End the current rules for this class and return to the package scope.End the current rules for this class and begin a new class scope.End the current rules for this class and begin a new class scope.End the current rules for this class, package and module, and begin a new module scope.End the current rules for this class, package and module, and begin a new module scope.forPackage(String name) End the current rules for this class and package, and begin a new package scope.
-
Method Details
-
denyAll
Deny access to all constructors and locally declared methods, superseding all previous rules.- Returns:
- this
-
denyAll
Deny access to all constructors and locally declared methods, superseding all previous rules.- Returns:
- this
-
denyAllConstructors
Deny access to all constructors, superseding all previous rules.- Returns:
- this
-
denyAllConstructors
Deny access to all constructors, superseding all previous rules.- Returns:
- this
-
denyAllMethods
Deny access to all locally declared methods, superseding all previous rules.- Returns:
- this
-
denyAllMethods
Deny access to all locally declared methods, superseding all previous rules.- Returns:
- this
-
denyMethod
Deny access to all variants of the given method, superseding all previous rules.- Returns:
- this
- Throws:
IllegalArgumentException- if not a valid method name
-
denyMethod
Deny access to all variants of the given method, superseding all previous rules.- Returns:
- this
- Throws:
IllegalArgumentException- if not a valid method name
-
allowVariant
Allow access to a specific variant of the current constructor or method, superseding all previous rules.- Parameters:
descriptor- descriptor for the parameters, not including parenthesis or the return type- Returns:
- this
- Throws:
IllegalStateException- if no current constructor or method
-
allowVariant
Allow access to a specific variant of the current constructor or method, superseding all previous rules.- Returns:
- this
- Throws:
IllegalStateException- if no current constructor or method, or if all variants are explicitly allowed
-
allowAll
Allow access to all constructors and locally declared methods, superseding all previous rules.- Returns:
- this
-
allowAllConstructors
Allow access to all constructors, superseding all previous rules.- Returns:
- this
-
allowAllMethods
Allow access to all locally declared methods, superseding all previous rules.- Returns:
- this
-
allowMethod
Allow access to all variants of the given method, superseding all previous rules.- Returns:
- this
- Throws:
IllegalArgumentException- if not a valid method name
-
denyVariant
Deny access to a specific variant of the current constructor or method, superseding all previous rules.- Parameters:
descriptor- descriptor for the parameters, not including parenthesis or the return type- Returns:
- this
- Throws:
IllegalStateException- if no current constructor or method
-
denyVariant
Deny access to a specific variant of the current constructor or method, superseding all previous rules.- Parameters:
descriptor- descriptor for the parameters, not including parenthesis or the return type- Returns:
- this
- Throws:
IllegalStateException- if no current constructor or method
-
denyVariant
Deny access to a specific variant of the current constructor or method, superseding all previous rules.- Returns:
- this
- Throws:
IllegalStateException- if no current constructor or method
-
denyVariant
Deny access to a specific variant of the current constructor or method, superseding all previous rules.- Returns:
- this
- Throws:
IllegalStateException- if no current constructor or method
-
end
End the current rules for this class and return to the package scope. More rules can be added to this scope later if desired. -
forClass
End the current rules for this class and begin a new class scope. More rules can be added to the scope later if desired. -
forClass
End the current rules for this class and begin a new class scope. More rules can be added to the scope later if desired. -
forPackage
End the current rules for this class and package, and begin a new package scope. More rules can be added to the scope later if desired. -
forModule
End the current rules for this class, package and module, and begin a new module scope. More rules can be added to the scope later if desired.- Parameters:
name- fully qualified module name- Throws:
IllegalArgumentException- if the module isn't found
-
forModule
End the current rules for this class, package and module, and begin a new module scope. More rules can be added to the scope later if desired.- Parameters:
name- fully qualified module nameminVersion- optional minimummodule version numberto support (inclusive)maxVersion- optional maximummodule version numberto support (exclusive)- Throws:
IllegalArgumentException- if the module isn't found, or if the version is out of bounds, or if the min/max versions provided aren't parseable
-