improve resource type enumeration

This commit is contained in:
Sebastian Sdorra
2012-02-03 19:39:02 +01:00
parent 2f7800cde7
commit 49af5df780

View File

@@ -34,7 +34,69 @@
package sonia.scm.resources;
/**
* This class represents the type of {@link Resource}.
*
* @author Sebastian Sdorra
*/
public enum ResourceType { SCRIPT, STYLESHEET }
public enum ResourceType
{
/**
* Resource type for javascript resources
*/
SCRIPT("text/javascript", "js"),
/**
* Resource type for stylesheet (css) resources
*/
STYLESHEET("text/css", "css");
/**
* Constructs a new resource type
*
*
* @param contentType content type of the resource type
* @param extension file extension of the resource type
*/
private ResourceType(String contentType, String extension)
{
this.contentType = contentType;
this.extension = extension;
}
//~--- get methods ----------------------------------------------------------
/**
* Returns the content type of the resource type.
*
*
* @return content type of the resource type
*
* @since 1.12
*/
public String getContentType()
{
return contentType;
}
/**
* Returns the file extension of the resource type.
*
*
* @return file extension of the resource type
*
* @since 1.12
*/
public String getExtension()
{
return extension;
}
//~--- fields ---------------------------------------------------------------
/** Field description */
private String contentType;
/** Field description */
private String extension;
}