This project has retired. For details please refer to its Attic page.
MockDefinitions (Tiles 2 2.0.7 Test API)

org.apache.tiles.definition
Class MockDefinitions

Package class diagram package MockDefinitions
java.lang.Object
  extended by org.apache.tiles.definition.MockDefinitions
All Implemented Interfaces:
Definitions

public class MockDefinitions
extends Object
implements Definitions

Version:
$Rev: 537196 $ $Date: 2007-05-11 16:07:35 +0200 (Fri, 11 May 2007) $

Constructor Summary
MockDefinitions()
          Creates a new instance of MockDefinitions.
 
Method Summary
 void addDefinitions(Map<String,Definition> defsMap)
          Adds new Definition objects to the internal collection and resolves inheritance attraibutes.
 void addDefinitions(Map<String,Definition> defsMap, Locale locale)
          Adds new locale-specific Definition objects to the internal collection and resolves inheritance attraibutes.
 Map<String,Definition> getBaseDefinitions()
          
 Definition getDefinition(String name)
          Returns a Definition object that matches the given name.
 Definition getDefinition(String name, Locale locale)
          Returns a Definition object that matches the given name and locale.
static int getInstanceCount()
          Hokey way to verify that this class was created.
 void reset()
          Clears definitions.
 void resolveInheritances()
          
 void resolveInheritances(Locale locale)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockDefinitions

public MockDefinitions()
Creates a new instance of MockDefinitions.

Method Detail

getInstanceCount

public static int getInstanceCount()
Hokey way to verify that this class was created.

Returns:
The number of created instances.

getDefinition

public Definition getDefinition(String name)
Returns a Definition object that matches the given name.

Specified by:
getDefinition in interface Definitions
Parameters:
name - The name of the Definition to return.
Returns:
the Definition matching the given name or null if none is found.

addDefinitions

public void addDefinitions(Map<String,Definition> defsMap,
                           Locale locale)
Adds new locale-specific Definition objects to the internal collection and resolves inheritance attraibutes.

Specified by:
addDefinitions in interface Definitions
Parameters:
defsMap - The new definitions to add.
locale - The locale to add the definitions to.

getDefinition

public Definition getDefinition(String name,
                                Locale locale)
Returns a Definition object that matches the given name and locale.

Specified by:
getDefinition in interface Definitions
Parameters:
name - The name of the Definition to return.
locale - The locale to use to resolve the definition.
Returns:
the Definition matching the given name or null if none is found.

addDefinitions

public void addDefinitions(Map<String,Definition> defsMap)
Adds new Definition objects to the internal collection and resolves inheritance attraibutes.

Specified by:
addDefinitions in interface Definitions
Parameters:
defsMap - The new definitions to add.

resolveInheritances

public void resolveInheritances()
                         throws NoSuchDefinitionException

Specified by:
resolveInheritances in interface Definitions
Throws:
NoSuchDefinitionException

resolveInheritances

public void resolveInheritances(Locale locale)
                         throws NoSuchDefinitionException

Specified by:
resolveInheritances in interface Definitions
Throws:
NoSuchDefinitionException

reset

public void reset()
Clears definitions.

Specified by:
reset in interface Definitions

getBaseDefinitions

public Map<String,Definition> getBaseDefinitions()

Specified by:
getBaseDefinitions in interface Definitions


Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.