Class DynaBeanACRParameter
- java.lang.Object
-
- org.owasp.esapi.reference.accesscontrol.DynaBeanACRParameter
-
- All Implemented Interfaces:
PolicyParameters
public class DynaBeanACRParameter extends java.lang.Object implements PolicyParameters
A DynaBean comes from the apache bean utils. It is basically a convenient way to dynamically assign getters and setters. Essentially, the way we use DynaBean is a HashMap that can be set to read only.- Author:
- Mike H. Fauzy
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.commons.beanutils.LazyDynaMappolicyProperties
-
Constructor Summary
Constructors Constructor Description DynaBeanACRParameter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectget(java.lang.String key)Follows the contract for java.util.Map;java.math.BigDecimalgetBigDecimal(java.lang.String key)Convenience method to avoid common casts.java.math.BigIntegergetBigInteger(java.lang.String key)Convenience method to avoid common casts.booleangetBoolean(java.lang.String key)Convenience method to avoid common casts.bytegetByte(java.lang.String key)Convenience method to avoid common casts.chargetChar(java.lang.String key)Convenience method to avoid common casts.java.util.DategetDate(java.lang.String key)Convenience method to avoid common casts.doublegetDouble(java.lang.String key)Convenience method to avoid common casts.floatgetFloat(java.lang.String key)Convenience method to avoid common casts.intgetInt(java.lang.String key)Convenience method to avoid common casts.longgetLong(java.lang.String key)Convenience method to avoid common casts.java.lang.ObjectgetObject(java.lang.String key)Convenience method to avoid common casts.java.lang.StringgetString(java.lang.String key)Convenience method to avoid common casts.java.lang.StringgetString(java.lang.String key, java.lang.String defaultValue)java.lang.String[]getStringArray(java.lang.String key)java.util.DategetTime(java.lang.String key)Convenience method to avoid common casts.voidlock()This makes the map itself read only, but the mutability of objects that this map contains is not affected.voidput(java.lang.String key, java.lang.Object value)This is a convenience method for developers that prefer to think of this as a map instead of being bean-like.voidset(java.lang.String key, java.lang.Object value)This works just like a Map, except it will throw an exception if lock() has been called.java.lang.StringtoString()
-
-
-
Method Detail
-
get
public java.lang.Object get(java.lang.String key)
Description copied from interface:PolicyParametersFollows the contract for java.util.Map;- Specified by:
getin interfacePolicyParameters- Returns:
- See Also:
Map
-
getBoolean
public boolean getBoolean(java.lang.String key)
Convenience method to avoid common casts.- Parameters:
key-- Returns:
-
getByte
public byte getByte(java.lang.String key)
Convenience method to avoid common casts.- Parameters:
key-- Returns:
-
getChar
public char getChar(java.lang.String key)
Convenience method to avoid common casts.- Parameters:
key-- Returns:
-
getInt
public int getInt(java.lang.String key)
Convenience method to avoid common casts.- Parameters:
key-- Returns:
-
getLong
public long getLong(java.lang.String key)
Convenience method to avoid common casts.- Parameters:
key-- Returns:
-
getFloat
public float getFloat(java.lang.String key)
Convenience method to avoid common casts.- Parameters:
key-- Returns:
-
getDouble
public double getDouble(java.lang.String key)
Convenience method to avoid common casts.- Parameters:
key-- Returns:
-
getBigDecimal
public java.math.BigDecimal getBigDecimal(java.lang.String key)
Convenience method to avoid common casts.- Parameters:
key-- Returns:
-
getBigInteger
public java.math.BigInteger getBigInteger(java.lang.String key)
Convenience method to avoid common casts.- Parameters:
key-- Returns:
-
getDate
public java.util.Date getDate(java.lang.String key)
Convenience method to avoid common casts.- Parameters:
key-- Returns:
-
getTime
public java.util.Date getTime(java.lang.String key)
Convenience method to avoid common casts. Note that the time object is the same as a date object- Parameters:
key-- Returns:
-
getString
public java.lang.String getString(java.lang.String key)
Convenience method to avoid common casts.- Parameters:
key-- Returns:
-
getString
public java.lang.String getString(java.lang.String key, java.lang.String defaultValue)
-
getStringArray
public java.lang.String[] getStringArray(java.lang.String key)
-
getObject
public java.lang.Object getObject(java.lang.String key)
Convenience method to avoid common casts.- Parameters:
key-- Returns:
-
set
public void set(java.lang.String key, java.lang.Object value) throws java.lang.IllegalArgumentExceptionDescription copied from interface:PolicyParametersThis works just like a Map, except it will throw an exception if lock() has been called.- Specified by:
setin interfacePolicyParameters- Throws:
java.lang.IllegalArgumentException- if this DynaBeanACRParameter instance has already been locked.
-
put
public void put(java.lang.String key, java.lang.Object value) throws java.lang.IllegalArgumentExceptionDescription copied from interface:PolicyParametersThis is a convenience method for developers that prefer to think of this as a map instead of being bean-like.- Specified by:
putin interfacePolicyParameters- Throws:
java.lang.IllegalArgumentException- See Also:
PolicyParameters.set(java.lang.String,java.lang.Object)
-
lock
public void lock()
This makes the map itself read only, but the mutability of objects that this map contains is not affected. Specifically, properties cannot be added or removed and the reference cannot be changed to a different object, but this does not change whether the values that the object contains can be changed.- Specified by:
lockin interfacePolicyParameters
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-