org.apache.cocoon.mail
Class MailCommandBuilder

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.mail.MailCommandBuilder

public class MailCommandBuilder
extends org.apache.cocoon.util.AbstractLogEnabled

Build an AbstractMailCommand from MailContext.

As a user requests a command, the command is mapped to an MailCommand instance. The registration of MailCommand, and the resolution of a command string to a command instance are the tasks of this class.

Since:
28 December 2002
Version:
$Id: MailCommandBuilder.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Constructor Summary
MailCommandBuilder()
          Constructor for the MailCommandBuilder object
 
Method Summary
 AbstractMailCommand buildAbstractMailCommand(MailContext mailContext)
          Build a mail command.
 void configure()
          Configure the cmd to mail command class mapping.
protected  Class getClassForCommand(String cmd)
          Get Class for a command
 boolean isCommandMapped(String cmd)
          Test if command is mapped to a Command class
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailCommandBuilder

public MailCommandBuilder()
Constructor for the MailCommandBuilder object

Method Detail

buildAbstractMailCommand

public AbstractMailCommand buildAbstractMailCommand(MailContext mailContext)
Build a mail command.

Parameters:
mailContext - Description of the Parameter
Returns:
Description of the Return Value

getClassForCommand

protected Class getClassForCommand(String cmd)
Get Class for a command

Parameters:
cmd - the command
Returns:
Class associated with cmd, or null iff cmd is not mapped to any class

isCommandMapped

public boolean isCommandMapped(String cmd)
Test if command is mapped to a Command class

Parameters:
cmd - the command
Returns:
true iff command is mapped to a Class, otherwise return false

configure

public void configure()
Configure the cmd to mail command class mapping.

New commands are registered here. A command name is associated with each command class.



Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.