edu.internet2.middleware.grouper.ws.rest.contentType
Enum WsRestResponseContentType

java.lang.Object
  extended by java.lang.Enum<WsRestResponseContentType>
      extended by edu.internet2.middleware.grouper.ws.rest.contentType.WsRestResponseContentType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<WsRestResponseContentType>

public enum WsRestResponseContentType
extends java.lang.Enum<WsRestResponseContentType>

possible content types by grouper ws rest


Enum Constant Summary
json
          json content type
xhtml
          default xhtml content type
xml
          xml content type
 
Method Summary
abstract  java.lang.String getContentType()
          get the content type
abstract  java.lang.Object parseString(java.lang.String input)
          parse a string to an object
static WsRestResponseContentType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static WsRestResponseContentType valueOfIgnoreCase(java.lang.String string, boolean exceptionOnNotFound)
          do a case-insensitive matching
static WsRestResponseContentType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
abstract  void writeString(java.lang.Object object, java.io.Writer writer)
          write a string representation to an outputstream
static XStream xstream(boolean isJson)
          setup an xstream object for input/output
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

xhtml

public static final WsRestResponseContentType xhtml
default xhtml content type


xml

public static final WsRestResponseContentType xml
xml content type


json

public static final WsRestResponseContentType json
json content type

Method Detail

values

public static WsRestResponseContentType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (WsRestResponseContentType c : WsRestResponseContentType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static WsRestResponseContentType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

writeString

public abstract void writeString(java.lang.Object object,
                                 java.io.Writer writer)
write a string representation to an outputstream

Parameters:
object - to write to output
writer - to write to (e.g. back to http client)
warnings - is where warnings should be written to

parseString

public abstract java.lang.Object parseString(java.lang.String input)
parse a string to an object

Parameters:
input -
Returns:
the object

getContentType

public abstract java.lang.String getContentType()
get the content type

Returns:
the http content type

xstream

public static XStream xstream(boolean isJson)
setup an xstream object for input/output

Parameters:
isJson - driver for json
Returns:
the xstream object

valueOfIgnoreCase

public static WsRestResponseContentType valueOfIgnoreCase(java.lang.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