Interface ScriptPropertyResolver


@SupportedAll public interface ScriptPropertyResolver
Resolver for getting properties in scripts.
  • Method Summary

    Modifier and Type
    Method
    Description
    getProperty(String propertyName)
    Retrieve the property with the input name as a String.
    getProperty(String propertyName, String defaultValue)
    Retrieve the property with the input name as a String.
    <T> T
    getProperty(String propertyName, String defaultValue, Class<T> returnType)
    Retrieve the property with the input name and coerce it to type T.
  • Method Details

    • 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 the propertyName cannot 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, or Boolean.
      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 the propertyName cannot be retrieved
      returnType - 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 retrieved
      IllegalArgumentException - if the return type is not one of the specified types