pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.service.request
Class CommandBuilder

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.service.request.CommandBuilder
All Implemented Interfaces:
java.io.Serializable, JDOMable

@Entity
public class CommandBuilder
extends AbstractBasicEntity
implements JDOMable

used to build Commands.

Is used to build new Commands from an existing Command (usually the current Command). CommandBuilders can be created from XML definitions similar to CommandMatcher or CommandMatchers definitions.

Version:
$Revision: 1477 $
Author:
Thomas Weber, Daniel Dietz
See Also:
mixIn(Command), Serialized Form

Constructor Summary
protected CommandBuilder()
          Deprecated. 
  CommandBuilder(CommandMatcher matcher)
          builds a CommandBuilder from a given CommandMatcher.
  CommandBuilder(org.jdom.Element command, java.lang.String b)
          builds the CommandBuilder defined in the mapping XML.
 
Method Summary
 CommandBuilder createCopy()
          returns a clone of the CommandBuilder.
 org.jdom.Element deserializeToJDOM()
          this will deserialize the state of the JDOMable as a JDOM Element.
 java.lang.String getAction()
           
 Bundle getBundle()
           
 java.lang.String getBundleName()
           
 java.util.Locale getLocale()
           
 java.util.Set<Parameter> getParameters()
          returns the Parameters of the CommandBuilder.
 java.lang.Long getSitemapNodeId()
           
 Command mixIn(Command templateCommand)
          creates a mixture of the given template Command and the CommandMatcher, in terms of adding all specified information of the CommandMatcher to the given template Command.
 void removeParameter(Parameter parameter)
          removes a Parameter from the CommandBuilder.
 void setAction(java.lang.String a)
           
 void setBundle(Bundle b)
           
 void setLocale(java.util.Locale l)
           
 void setParameters(java.util.Set<Parameter> newParameters)
          sets the Parameters of the CommandBuilder.
 void setSitemapNodeId(java.lang.Long i)
           
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity
compareTo, equals, getFullQualifiedClassNameJAXB, getId, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandBuilder

@Deprecated
protected CommandBuilder()
Deprecated. 

default constructor for HibernateTM.


CommandBuilder

public CommandBuilder(org.jdom.Element command,
                      java.lang.String b)
builds the CommandBuilder defined in the mapping XML.

sample mapping XML snippet:

                            <command action="actionname" locale="de_DE">
                              <parameter name="param1">
                                <value>value1.1</value>
                                <value>value1.2</value>
                              </parameter>
                              <parameter name="param2"/>
                              <parameter name="param3">
                                <value>value3</value>
                              </parameter>
                            </command>
 
The above sample is full blown. The following example shows the minimal mapping:
                            <command action="actionname"/>
 

Parameters:
command - the command XML
b - the Bundle

CommandBuilder

public CommandBuilder(CommandMatcher matcher)
builds a CommandBuilder from a given CommandMatcher.

Parameters:
matcher - the template CommandMatcher
Method Detail

getAction

public final java.lang.String getAction()
Returns:
Returns the action.

setAction

public final void setAction(java.lang.String a)
Parameters:
a - The action to set.

getBundle

public final Bundle getBundle()
Returns:
Returns the bundle.

setBundle

public final void setBundle(Bundle b)
Parameters:
b - The bundle to set.

getLocale

public final java.util.Locale getLocale()
Returns:
Returns the locale.

setLocale

public final void setLocale(java.util.Locale l)
Parameters:
l - The locale to set.

getSitemapNodeId

public final java.lang.Long getSitemapNodeId()
Returns:
Returns the sitemapNodeId.

setSitemapNodeId

public final void setSitemapNodeId(java.lang.Long i)
Parameters:
i - The sitemapNodeId to set.

mixIn

public final Command mixIn(Command templateCommand)
creates a mixture of the given template Command and the CommandMatcher, in terms of adding all specified information of the CommandMatcher to the given template Command.

Parameters:
templateCommand - the template Command
Returns:
the modified template Command

getParameters

public final java.util.Set<Parameter> getParameters()
returns the Parameters of the CommandBuilder.

Returns:
the Parameters of the CommandBuilder

removeParameter

public final void removeParameter(Parameter parameter)
removes a Parameter from the CommandBuilder.

Parameters:
parameter - the Parameter to be removed

setParameters

public final void setParameters(java.util.Set<Parameter> newParameters)
sets the Parameters of the CommandBuilder.

Parameters:
newParameters - the new Parameters for the CommandBuilder

createCopy

public final CommandBuilder createCopy()
returns a clone of the CommandBuilder.

Returns:
a clone of the CommandBuilder

deserializeToJDOM

public final org.jdom.Element deserializeToJDOM()
Description copied from interface: JDOMable
this will deserialize the state of the JDOMable as a JDOM Element.

Specified by:
deserializeToJDOM in interface JDOMable
Returns:
a basic JDOM representation
See Also:
JDOMable.deserializeToJDOM()

getBundleName

public final java.lang.String getBundleName()
Returns:
the bundleName