org.cert.cc.description
Enum DescriptionProcessorFactory

java.lang.Object
  extended by java.lang.Enum<DescriptionProcessorFactory>
      extended by org.cert.cc.description.DescriptionProcessorFactory
All Implemented Interfaces:
Serializable, Comparable<DescriptionProcessorFactory>, DescriptionProcessor

public enum DescriptionProcessorFactory
extends Enum<DescriptionProcessorFactory>
implements DescriptionProcessor

DescriptionProcessorFactory will create and return appropiate DescriptionProcessor based on an input email Message. It also implements DescriptionProcessor directly for easy processing.

© 2009 Carnegie Mellon University

Author:
Steve Scholnick

Enum Constant Summary
INSTANCE
           
 
Method Summary
 String generateDescription(Message message)
          Creates and returns the description
static DescriptionProcessorFactory getInstance()
          Singleton access point
 DescriptionProcessor getProcessor(Message message)
          Returns the correct DescriptionProcessor for the specified Message
static DescriptionProcessorFactory valueOf(String name)
          Returns the enum constant of this type with the specified name.
static DescriptionProcessorFactory[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

INSTANCE

public static final DescriptionProcessorFactory INSTANCE
Method Detail

values

public static DescriptionProcessorFactory[] 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 (DescriptionProcessorFactory c : DescriptionProcessorFactory.values())
    System.out.println(c);

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

valueOf

public static DescriptionProcessorFactory valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getInstance

public static DescriptionProcessorFactory getInstance()
Singleton access point


generateDescription

public String generateDescription(Message message)
                           throws MessagingException
Creates and returns the description

Specified by:
generateDescription in interface DescriptionProcessor
Parameters:
message - Email Message
Returns:
Clear text description
Throws:
MessagingException - If unable to generate the description

getProcessor

public DescriptionProcessor getProcessor(Message message)
                                  throws MessagingException
Returns the correct DescriptionProcessor for the specified Message

Parameters:
message - Email Message
Returns:
DescriptionProcessor
Throws:
MessagingException - If unable to interrogate the Message


Copyright © 2012 Carnegie Mellon University