Class ParameterMap

java.lang.Object
org.apache.empire.jsf2.utils.ParameterMap

public class ParameterMap extends Object
This class manages request parameters in a way that they cannot be analyzed and modified by the user
Author:
doebele
  • Field Details

  • Constructor Details

    • ParameterMap

      public ParameterMap()
  • Method Details

    • encodeString

      public String encodeString(String valueAsString)
    • encodeStringWithCache

      public String encodeStringWithCache(String valueAsString)
    • getRowSetTypeName

      protected String getRowSetTypeName(DBRowSet rowset)
      gets a unique name for a given rowset
      Parameters:
      rowset - the rowset
      Returns:
      a unique name for the given rowset
    • putValue

      protected void putValue(String typeName, String encodedId, Object item)
      puts an object into the parameter map
      Parameters:
      typeName - the type name
      encodedId - the id
      item - the object
    • encodeAndStore

      protected String encodeAndStore(String typeName, String objectKey, Object item, boolean useCache)
      encodes the objectKey and stores the item in the parameter map
      Parameters:
      typeName - the type name
      objectKey - the object key
      item - the object
      useCache - flag whether to cache the objectKey
      Returns:
      the encoded identifier
    • put

      public String put(String type, String key, String value, boolean useCache)
      puts a key of a particular type into the parameter map
      Parameters:
      type - the type name
      key - the key string
      value - the value
      useCache - true if the keys should be cached
      Returns:
      the encoded key
    • get

      public Object get(String type, String id)
    • clear

      public void clear(String type)
    • put

      public String put(ParameterObject paramObject, boolean useCache)
      Puts an object into the paramter map that implements the ParameterObject interface
      Parameters:
      paramObject - the param object
      useCache - flag whether to cache the objectKey
      Returns:
      the encoded object
    • put

      public String put(ParameterObject paramObject)
      Puts an object into the paramter map that implements the ParameterObject interface
      Parameters:
      paramObject - the param object
      Returns:
      the encoded object
    • get

      public <T extends ParameterObject> T get(Class<T> paramType, String id)
      Returns the ParameterObject for the given encoded id
      Type Parameters:
      T - the parameter type
      Parameters:
      paramType - the param type class
      id - the item id
      Returns:
      the object
    • clear

      public void clear(Class<? extends Object> paramType)
    • put

      public String put(DBRowSet rowset, Object[] key)
      Puts a RowSet key into the parameter map
      Parameters:
      rowset - the rowset
      key - the record key
      Returns:
      the encoded key
    • getKey

      public Object[] getKey(DBRowSet rowset, String id)
      Returns a record key for a given RowSet from an encoded id
      Parameters:
      rowset - the RowSet for which to get the key
      id - the encoded id
      Returns:
      the record key
    • clear

      public void clear(DBRowSet rowset)
    • put

      public String put(Class<? extends Object> c, Object[] key)
      Puts a key for a given class into the parameter map
      Parameters:
      c - the class
      key - the key for this class
      Returns:
      the encoded key
    • getKey

      public Object[] getKey(Class<? extends Object> c, String id)
      Returns a class key from an encoded id
      Parameters:
      c - the class for which to retrieve the key
      id - the encoded id
      Returns:
      the class key
    • put

      public String put(PageDefinition page, DBRowSet rowset, Object[] key)
      Generates an idParam which is only valid for the given page.
      Parameters:
      page - the target page
      rowset - the rowset
      key - the key
      Returns:
      the encoded object
    • getKey

      public Object[] getKey(PageDefinition page, DBRowSet rowset, String id)
      Returns an record key for a given page and rowset
      Parameters:
      page - the page
      rowset - the rowset
      id - the object id
      Returns:
      the object key
    • clear

      public void clear(PageDefinition page, DBRowSet rowset)