net.fckeditor.handlers
Class ResourceTypeHandler

java.lang.Object
  extended by net.fckeditor.handlers.ResourceTypeHandler

public class ResourceTypeHandler
extends java.lang.Object

Handler for different resource types.

Version:
$Id: ResourceTypeHandler.java 3840 2009-07-08 20:29:46Z mosipov $

Field Summary
static ResourceTypeHandler FILE
           
static ResourceTypeHandler FLASH
           
static ResourceTypeHandler IMAGE
           
static ResourceTypeHandler MEDIA
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
static ResourceTypeHandler getDefaultResourceType(java.lang.String name)
          Tries to determine ResourceType from string and return FILE if provided string is invalid.
 java.lang.String getName()
          Getter for the name.
 java.lang.String getPath()
          Getter for the resource type path (sub folder).
static ResourceTypeHandler getResourceType(java.lang.String name)
          A wrapper for valueOf(String).
 int hashCode()
           
static boolean isValid(java.lang.String name)
          Checks if a specfied string represents a valid resource type.
 java.lang.String toString()
           
static ResourceTypeHandler valueOf(java.lang.String name)
          Getter for a ResourceTypeHandler for a specified string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FILE

public static final ResourceTypeHandler FILE

FLASH

public static final ResourceTypeHandler FLASH

IMAGE

public static final ResourceTypeHandler IMAGE

MEDIA

public static final ResourceTypeHandler MEDIA
Method Detail

getName

public java.lang.String getName()
Getter for the name.

Returns:
name

getPath

public java.lang.String getPath()
Getter for the resource type path (sub folder).

Returns:
The path (sub folder).

valueOf

public static ResourceTypeHandler valueOf(java.lang.String name)
                                   throws java.lang.IllegalArgumentException
Getter for a ResourceTypeHandler for a specified string.

Parameters:
name - A resource type to retrieve.
Returns:
A ResourceTypeHandler object holding the value represented by the string argument.
Throws:
java.lang.IllegalArgumentException - If 'name' is null, empty, or does not exist.

isValid

public static boolean isValid(java.lang.String name)
Checks if a specfied string represents a valid resource type.

Parameters:
name - A resource type string to check.
Returns:
true if the string representation is valid else false.

getDefaultResourceType

public static ResourceTypeHandler getDefaultResourceType(java.lang.String name)
Tries to determine ResourceType from string and return FILE if provided string is invalid.

Parameters:
name -
Returns:
resource type

getResourceType

public static ResourceTypeHandler getResourceType(java.lang.String name)
A wrapper for valueOf(String). It returns null instead of throwing an exception.

Parameters:
name - A resource type string to check.
Returns:
A ResourceTypeHandler object holding the value represented by the string argument, or null.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2004-2009 Frederico Caldeira Knabben. All Rights Reserved.