Class JexlSandbox.AllowSet
- java.lang.Object
-
- org.apache.commons.jexl3.introspection.JexlSandbox.Names
-
- org.apache.commons.jexl3.introspection.JexlSandbox.AllowSet
-
- Direct Known Subclasses:
JexlSandbox.WhiteSet
- Enclosing class:
- JexlSandbox
static class JexlSandbox.AllowSet extends JexlSandbox.Names
A allow set of names.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.String>
names
The map of controlled names and aliases.
-
Constructor Summary
Constructors Constructor Description AllowSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(java.lang.String name)
Adds a name to this set.boolean
alias(java.lang.String name, java.lang.String alias)
Adds an alias to a name to this set.protected JexlSandbox.Names
copy()
java.lang.String
get(java.lang.String name)
Whether a given name is allowed or not.
-
-
-
Method Detail
-
add
public boolean add(java.lang.String name)
Description copied from class:JexlSandbox.Names
Adds a name to this set.- Specified by:
add
in classJexlSandbox.Names
- Parameters:
name
- the name to add- Returns:
- true if the name was really added, false if not
-
alias
public boolean alias(java.lang.String name, java.lang.String alias)
Description copied from class:JexlSandbox.Names
Adds an alias to a name to this set.This only has an effect on allow lists.
- Overrides:
alias
in classJexlSandbox.Names
- Parameters:
name
- the name to aliasalias
- the alias- Returns:
- true if the alias was added, false if it was already present
-
copy
protected JexlSandbox.Names copy()
- Overrides:
copy
in classJexlSandbox.Names
- Returns:
- a copy of these Names
-
get
public java.lang.String get(java.lang.String name)
Description copied from class:JexlSandbox.Names
Whether a given name is allowed or not.- Overrides:
get
in classJexlSandbox.Names
- Parameters:
name
- the method/property name to check- Returns:
- null (or NULL if name is null) if not allowed, the actual name to use otherwise
-
-