/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at .
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox ,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2002-03 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.dynamo;
import java.util.*;
import org.apache.commons.lang.enum.*;
/**
* A type-safe enumerated type that indicates the action of a {@link com.silverwrist.dynamo.iface.Request Request}
* that comes in from the framework. Verb
objects correspond roughly to HTTP methods.
*
* @author Eric J. Bowersox <erbo@silcom.com>
* @version X
*/
public final class Verb extends Enum
{
/*--------------------------------------------------------------------------------
* The actual enumeration values
*--------------------------------------------------------------------------------
*/
/**
* Indicates a request to delete a resource identified by a URI. Corresponds to HTTP DELETE method.
*/
public static final Verb DELETE = new Verb("DELETE"); // (standard)
/**
* Indicates a request to retrieve a resource identified by a URI. Corresponds to HTTP GET method.
*/
public static final Verb GET = new Verb("GET"); // (standard)
/**
* Indicates a request to interact with a resource identified by a URI. Corresponds to HTTP POST method.
* All XML-RPC requests use this verb.
*/
public static final Verb POST = new Verb("POST"); // (standard)
/**
* Indicates a request to overwrite a resource identified by a URI. Corresponds to HTTP PUT method.
*/
public static final Verb PUT = new Verb("PUT"); // (standard)
/**
* Indicates a request to get the last modification time of a resource identified by a URI. Often associated
* with a HTTP GET method.
*/
public static final Verb _LASTMOD = new Verb("_LASTMOD"); // extended for getLastModified
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
/**
* Internal constructor which creates a new element of this enumerated type.
*
* @param name The name of the Verb
to be created.
*/
private Verb(String name)
{
super(name);
} // end constructor
/*--------------------------------------------------------------------------------
* Standard static method implementations
*--------------------------------------------------------------------------------
*/
/**
* Gets a Verb
by name.
*
* @param name The name of the Verb
to get; may be null
.
* @return The Verb
object, or null
if the Verb
does not exist.
*/
public static Verb getEnum(String name)
{
return (Verb)getEnum(Verb.class,name);
} // end getEnum
/**
* Gets the Map
of Verb
objects by name.
*
* @return The Verb
object Map
.
*/
public static Map getEnumMap()
{
return getEnumMap(Verb.class);
} // end getEnumMap
/**
* Gets the List
of Verb
objects, in the order in which the objects are listed
* in the code above.
*
* @return The Verb
object List
.
*/
public static List getEnumList()
{
return getEnumList(Verb.class);
} // end getEnumList
/**
* Gets an iterator over all Verb
objects, in the order in which the objects are listed
* in the code above.
*
* @return The Verb
object iterator.
*/
public static Iterator iterator()
{
return iterator(Verb.class);
} // end iterator
} // end class Verb