org.opencms.jsp.decorator
Class CmsDecoratorConfiguration

java.lang.Object
  extended byorg.opencms.jsp.decorator.CmsDecoratorConfiguration

public class CmsDecoratorConfiguration
extends java.lang.Object

The CmsDecoratorConfiguration initalizes and stores the text decorations.

It uses uses the information of one or more CmsDecorationDefintion to create the pre- and postfixs for text decorations.

Since:
6.1.3
Version:
$Revision: 1.6 $
Author:
Michael Emmerich

Constructor Summary
CmsDecoratorConfiguration(CmsObject cms)
          Constructor, creates a new, empty CmsDecoratorConfiguration.
CmsDecoratorConfiguration(CmsObject cms, java.lang.String configFile)
          Constructor, creates a new, CmsDecoratorConfiguration with a given config file.
CmsDecoratorConfiguration(CmsObject cms, java.lang.String configFile, java.util.Locale locale)
          Constructor, creates a new, CmsDecoratorConfiguration with a given config file and locale.
 
Method Summary
 void addDecorations(CmsDecorationDefintion decorationDefinition)
          Adds decorations defined in a CmsDecorationDefintion object to the map of all decorations.
 CmsDecorationBundle getDecorations()
          Gets the decoration bundle.
 boolean hasUsed(java.lang.String key)
          Tests if a decoration key was used before in this configuration.
 boolean isExcluded(java.lang.String tag)
          Tests if a tag is contained in the exclude list of the decorator.
 void markAsUsed(java.lang.String key)
          Mark a decoration key as already used.
 void resetMarkedDecorations()
          Resets the used decoration keys.
 void setDecorations(CmsDecorationBundle decorations)
          Sets the decoration bundle, overwriting an exiting one.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CmsDecoratorConfiguration

public CmsDecoratorConfiguration(CmsObject cms)
Constructor, creates a new, empty CmsDecoratorConfiguration.

Parameters:
cms - the CmsObject

CmsDecoratorConfiguration

public CmsDecoratorConfiguration(CmsObject cms,
                                 java.lang.String configFile)
                          throws CmsException
Constructor, creates a new, CmsDecoratorConfiguration with a given config file.

Parameters:
cms - the CmsObject
configFile - the configuration file
Throws:
CmsException - if something goes wrong

CmsDecoratorConfiguration

public CmsDecoratorConfiguration(CmsObject cms,
                                 java.lang.String configFile,
                                 java.util.Locale locale)
                          throws CmsException
Constructor, creates a new, CmsDecoratorConfiguration with a given config file and locale.

Parameters:
cms - the CmsObject
configFile - the configuration file
locale - to locale to build this configuration for
Throws:
CmsException - if something goes wrong
Method Detail

addDecorations

public void addDecorations(CmsDecorationDefintion decorationDefinition)
                    throws CmsException
Adds decorations defined in a CmsDecorationDefintion object to the map of all decorations.

Parameters:
decorationDefinition - the CmsDecorationDefintion the decorations to be added
Throws:
CmsException - if something goes wrong

getDecorations

public CmsDecorationBundle getDecorations()
Gets the decoration bundle.

Returns:
the decoration bundle to be used

hasUsed

public boolean hasUsed(java.lang.String key)
Tests if a decoration key was used before in this configuration.

Parameters:
key - the key to look for
Returns:
true if this key was already used

isExcluded

public boolean isExcluded(java.lang.String tag)
Tests if a tag is contained in the exclude list of the decorator.

Parameters:
tag - the tag to test
Returns:
true if the tag is in the exclode list, false othwerwise.

markAsUsed

public void markAsUsed(java.lang.String key)
Mark a decoration key as already used.

Parameters:
key - the key to mark

resetMarkedDecorations

public void resetMarkedDecorations()
Resets the used decoration keys.


setDecorations

public void setDecorations(CmsDecorationBundle decorations)
Sets the decoration bundle, overwriting an exiting one.

Parameters:
decorations - new decoration bundle

toString

public java.lang.String toString()
See Also:
Object.toString()