Enum Class WsRestRequestContentType

java.lang.Object
java.lang.Enum<WsRestRequestContentType>
edu.internet2.middleware.grouper.ws.rest.contentType.WsRestRequestContentType
All Implemented Interfaces:
Serializable, Comparable<WsRestRequestContentType>, Constable

public enum WsRestRequestContentType extends Enum<WsRestRequestContentType>
possible content types by grouper ws rest
  • Enum Constant Details

    • http

      public static final WsRestRequestContentType http
      http params set fields in a lite object http request content type should not be set, or set to: application/x-www-form-urlencoded
    • xml

      public static final WsRestRequestContentType xml
      xml content type http request content type should be set to application/xml or text/xml
    • json

      public static final WsRestRequestContentType json
      json content type, uses the pluggable json converter http request content type should be set to application/json or text/x-json
  • Method Details

    • values

      public static WsRestRequestContentType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static WsRestRequestContentType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • jsonConverter

      public static JsonConverter jsonConverter()
      instantiate the json convert configured in the grouper-ws.properties file
      Returns:
      the json converter
    • calculateResponseContentType

      public abstract WsRestResponseContentType calculateResponseContentType()
      based on the request type, calculate the response type
      Returns:
      the response type or null if there is not a clear winner
    • main

      public static void main(String[] args)
      test out a parse
      Parameters:
      args -
    • parseString

      public abstract Object parseString(String input, StringBuilder warnings)
      parse a string to an object
      Parameters:
      input -
      warnings - is where warnings should be written to
      Returns:
      the object
    • writeString

      public abstract String writeString(Object object)
      write a string representation to result string
      Parameters:
      object - to write to output
      Returns:
      the string representation
    • getContentTypes

      public String[] getContentTypes()
      Array of valid options content type header
      Returns:
      Valid content types
    • getContentType

      public String getContentType()
      Default content type from acceptable content-type options
      Returns:
      The default content type
    • findByContentType

      public static WsRestRequestContentType findByContentType(String theContentType, String requestBody)
      find a request content type by content type
      Parameters:
      theContentType -
      requestBody - is the request onverted to a body
      Returns:
      the requestContentType
    • valueOfIgnoreCase

      public static WsRestRequestContentType valueOfIgnoreCase(String string, boolean exceptionOnNotFound) throws GrouperRestInvalidRequest
      do a case-insensitive matching
      Parameters:
      string -
      exceptionOnNotFound - true to throw exception on not found
      Returns:
      the enum or null or exception if not found
      Throws:
      GrouperRestInvalidRequest - if problem