Class UrlDeserializer

java.lang.Object
cz.metacentrum.perun.rpc.deserializer.Deserializer
cz.metacentrum.perun.rpc.deserializer.UrlDeserializer

public class UrlDeserializer extends Deserializer
Deserializer for URL data format.

Reads parameters only from URL of request, which is typically GET. Doesn't read any parameters from request body (InputStream)!

Author:
Jan Klos invalid input: '<'ddd@mail.muni.cz>, Pavel Zlamal invalid input: '<'256627@mail.muni.cz>
  • Constructor Details

    • UrlDeserializer

      public UrlDeserializer(jakarta.servlet.http.HttpServletRequest request)
      Create deserializer for URL data format.
      Parameters:
      request - HttpServletRequest this deserializer is about to process
  • Method Details

    • contains

      public boolean contains(String name)
      Returns true if value with the specified name is supplied. Check ignores array suffix "[]". It means, that true is returned for both "name" and "name[]" parameters.
      Specified by:
      contains in class Deserializer
      Parameters:
      name - name of the value to check
      Returns:
      true if value with the specified name is supplied, false otherwise
    • getServletRequest

      public jakarta.servlet.http.HttpServletRequest getServletRequest()
      Description copied from class: Deserializer
      Return HttpServletRequest related to concrete call this deserializer is used to process.

      Note that this "request" is not necessarily used as source to read parameters by other methods of deserializer. It IS typically for GET requests, but NOT for POST with JSON/JSONP data format.

      Overrides:
      getServletRequest in class Deserializer
      Returns:
      HttpServletRequest related to concrete call
    • readAll

      public String readAll()
      Description copied from class: Deserializer
      Returns string representation of the variables stored in the deserializer.
      Specified by:
      readAll in class Deserializer
      Returns:
      string containing all variables
    • readArrayOfInts

      public int[] readArrayOfInts(String name)
      Overrides:
      readArrayOfInts in class Deserializer
    • readBoolean

      public Boolean readBoolean(String name)
      Description copied from class: Deserializer
      Reads value with the specified name as Boolean.
      Specified by:
      readBoolean in class Deserializer
      Parameters:
      name - name of the value to read
      Returns:
      the value as Boolean
    • readInt

      public int readInt(String name)
      Description copied from class: Deserializer
      Reads value with the specified name as int.
      Specified by:
      readInt in class Deserializer
      Parameters:
      name - name of the value to read
      Returns:
      the value as int
    • readList

      public <T> List<T> readList(String name, Class<T> valueType)
      Description copied from class: Deserializer
      Reads array with the specified name as List<valueType>.
      Overrides:
      readList in class Deserializer
      Parameters:
      name - name of the array to read
      valueType - type of the value to read
      Returns:
      the value as List<valueType>
    • readString

      public String readString(String name)
      Description copied from class: Deserializer
      Reads value with the specified name as String.
      Specified by:
      readString in class Deserializer
      Parameters:
      name - name of the value to read
      Returns:
      the value as String
    • readUUID

      public UUID readUUID(String name)
      Description copied from class: Deserializer
      Reads value with the specified name as UUID.
      Specified by:
      readUUID in class Deserializer
      Parameters:
      name - name of the value to read
      Returns:
      the value as UUID