Interface ScriptPropertyResolver
-
@SupportedAll public interface ScriptPropertyResolver
Resolver for getting properties in scripts.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetProperty(String propertyName)Retrieve the property with the input name as a String.StringgetProperty(String propertyName, String defaultValue)Retrieve the property with the input name as a String.<T> TgetProperty(String propertyName, String defaultValue, Class<T> returnType)Retrieve the property with the input name and coerce it to type T.
-
-
-
Method Detail
-
getProperty
String getProperty(String propertyName) throws org.forgerock.openam.scripting.api.ScriptPropertyResolverException
Retrieve the property with the input name as a String.- Parameters:
propertyName- the name of the property value to retrieve, this must start with the prefix configured in the global scripting configuration. Must not contain a | character.- Returns:
- the property value as a String
- Throws:
org.forgerock.openam.scripting.api.ScriptPropertyResolverException- if the property cannot be retrieved
-
getProperty
String getProperty(String propertyName, String defaultValue) throws org.forgerock.openam.scripting.api.ScriptPropertyResolverException
Retrieve the property with the input name as a String.- Parameters:
propertyName- the name of the property value to retrieve, this must start with the prefix configured in the global scripting configuration. Must not contain a | character.defaultValue- the default value to be used, if thepropertyNamecannot be retrieved- Returns:
- the property value as a String
- Throws:
org.forgerock.openam.scripting.api.ScriptPropertyResolverException- if the property cannot be retrieved
-
getProperty
<T> T getProperty(String propertyName, String defaultValue, Class<T> returnType) throws org.forgerock.openam.scripting.api.ScriptPropertyResolverException, IllegalArgumentException
Retrieve the property with the input name and coerce it to type T. T must be one of the following types:String,Integer,Double,List,Map, orBoolean.- Type Parameters:
T- the type of the property to return- Parameters:
propertyName- the name of the property value to retrieve,this must start with the prefix configured in the global scripting configuration. Must not contain a | character.defaultValue- the default value to be used, if thepropertyNamecannot be retrievedreturnType- the return type of the property- Returns:
- the property value as an instance of return type T
- Throws:
org.forgerock.openam.scripting.api.ScriptPropertyResolverException- if the property cannot be retrievedIllegalArgumentException- if the return type is not one of the specified types
-
-