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
possible content types by grouper ws rest
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionhttp params set fields in a lite object http request content type should not be set, or set to: application/x-www-form-urlencodedjson content type, uses the pluggable json converter http request content type should be set to application/json or text/x-jsonxml content type http request content type should be set to application/xml or text/xml -
Method Summary
Modifier and TypeMethodDescriptionabstract WsRestResponseContentType
based on the request type, calculate the response typestatic WsRestRequestContentType
findByContentType
(String theContentType, String requestBody) find a request content type by content typeDefault content type from acceptable content-type optionsString[]
Array of valid options content type headerstatic JsonConverter
instantiate the json convert configured in the grouper-ws.properties filestatic void
test out a parseabstract Object
parseString
(String input, StringBuilder warnings) parse a string to an objectstatic WsRestRequestContentType
Returns the enum constant of this class with the specified name.static WsRestRequestContentType
valueOfIgnoreCase
(String string, boolean exceptionOnNotFound) do a case-insensitive matchingstatic WsRestRequestContentType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.abstract String
writeString
(Object object) write a string representation to result string
-
Enum Constant Details
-
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
xml content type http request content type should be set to application/xml or text/xml -
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
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
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 nameNullPointerException
- if the argument is null
-
jsonConverter
instantiate the json convert configured in the grouper-ws.properties file- Returns:
- the json converter
-
calculateResponseContentType
based on the request type, calculate the response type- Returns:
- the response type or null if there is not a clear winner
-
main
test out a parse- Parameters:
args
-
-
parseString
parse a string to an object- Parameters:
input
-warnings
- is where warnings should be written to- Returns:
- the object
-
writeString
write a string representation to result string- Parameters:
object
- to write to output- Returns:
- the string representation
-
getContentTypes
Array of valid options content type header- Returns:
- Valid content types
-
getContentType
Default content type from acceptable content-type options- Returns:
- The default content type
-
findByContentType
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
-