com.free2be.dimensions.tiles.inheritance
Class AbstractInheritanceResolverImpl

java.lang.Object
  extended by com.free2be.dimensions.tiles.inheritance.AbstractInheritanceResolverImpl
All Implemented Interfaces:
InheritanceResolver
Direct Known Subclasses:
UserDeviceInheritanceResolver

public abstract class AbstractInheritanceResolverImpl
extends java.lang.Object
implements InheritanceResolver

This class is a base implementation of the interface InheritanceResolver. It contains some ready-to-use structures, so that you have to implement only the missing parts.


Field Summary
protected  java.util.Map decision2path
          A map where the key is a Decision and the value is a path to a Tiles definitions file.
protected  java.util.Map decision2sequence
          A map where the key is a decision and the value is a List containing Strings, representing the sequence of file paths to load.
 
Constructor Summary
AbstractInheritanceResolverImpl()
          Creates a new instance of AbstractInheritanceResolverImpl
 
Method Summary
 void addDefinitionsPath(Decision decision, java.lang.String xmlDefinitionsPath)
          Adds a definition path, related to a specific decision.
protected  void addPath(Decision decision, java.lang.String xmlDefinitionsPath)
          Utility method to add a path to the sequence of file path connected tu a defined decision.
 java.util.Collection getPathSequence(Decision decision)
          Returns the sequence of Tiles definitions files to load to correctly have the final XmlDefinitionsSet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.free2be.dimensions.tiles.inheritance.InheritanceResolver
resolveInheritances
 

Field Detail

decision2path

protected java.util.Map decision2path
A map where the key is a Decision and the value is a path to a Tiles definitions file.


decision2sequence

protected java.util.Map decision2sequence
A map where the key is a decision and the value is a List containing Strings, representing the sequence of file paths to load.

Constructor Detail

AbstractInheritanceResolverImpl

public AbstractInheritanceResolverImpl()
Creates a new instance of AbstractInheritanceResolverImpl

Method Detail

addDefinitionsPath

public void addDefinitionsPath(Decision decision,
                               java.lang.String xmlDefinitionsPath)
Adds a definition path, related to a specific decision.

Specified by:
addDefinitionsPath in interface InheritanceResolver
Parameters:
decision - The decision to assign to the specified Tiles definitions file.
xmlDefinitionsPath - The path to the Tiles definitions file.

getPathSequence

public java.util.Collection getPathSequence(Decision decision)
Returns the sequence of Tiles definitions files to load to correctly have the final XmlDefinitionsSet.

Specified by:
getPathSequence in interface InheritanceResolver
Parameters:
decision - The decision to be used.
Returns:
A list containing Strings that indicate the paths of files to load.

addPath

protected void addPath(Decision decision,
                       java.lang.String xmlDefinitionsPath)
Utility method to add a path to the sequence of file path connected tu a defined decision. It will put the path at the first place, shifting the others.

Parameters:
decision - The decision to consider.
xmlDefinitionsPath - The path to add to the sequence.