org.glassfish.jersey.examples.console.resources
Class Colours

java.lang.Object
  extended by org.glassfish.jersey.examples.console.resources.Colours

public class Colours
extends Object

A web resource for a list of colours.


Constructor Summary
Colours()
           
 
Method Summary
 org.codehaus.jettison.json.JSONArray getColourListAsJSON(String filter)
          Returns a list of colours as a JSON array.
 String getColourListAsText(String filter)
          Returns a list of colours as plain text, one colour per line.
static List<String> getMatchingColours(String filter)
          Returns a list of colours.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Colours

public Colours()
Method Detail

getColourListAsText

@GET
@Produces(value="text/plain")
public String getColourListAsText(@QueryParam(value="match")
                                               String filter)
Returns a list of colours as plain text, one colour per line.

Parameters:
filter - If not empty, constrains the list of colours to only those that contain this substring
Returns:
the list of colours matching the filter

getColourListAsJSON

@GET
@Produces(value="application/json")
public org.codehaus.jettison.json.JSONArray getColourListAsJSON(@QueryParam(value="match")
                                                                             String filter)
Returns a list of colours as a JSON array.

Parameters:
filter - If not empty, constrains the list of colours to only those that contain this substring
Returns:
the list of colours matching the filter

getMatchingColours

public static List<String> getMatchingColours(String filter)
Returns a list of colours.

Parameters:
filter - If not empty, constrains the list of colours to only those that contain this substring
Returns:
the list of colours matching the filter


Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.