org.objectweb.kilim.repository
Class ResourceRepository

java.lang.Object
  extended byorg.objectweb.kilim.repository.ResourceRepository
All Implemented Interfaces:
Repository
Direct Known Subclasses:
ResourceRepository1

public class ResourceRepository
extends java.lang.Object
implements Repository

Implementation of Repository using a ResourceLoader and a kilim xml format Parser. Repository

Author:
dutoo, horn

Field Summary
private static boolean DEBUG_ON
           
private static Logger logger
           
private  java.util.HashMap resourceCache
           
private  ResourceLoader resourceLoader
           
private  TemplateDescriptionParser tdParser
           
 
Fields inherited from interface org.objectweb.kilim.repository.Repository
KILIM_FILES_EXTENSION
 
Constructor Summary
ResourceRepository()
          Creates a new ResourceRepository with the given kilim xml format Parser and its ClassLoader as resource loader.
ResourceRepository(TemplateDescriptionParser aParser)
          Creates a new ResourceRepository with the given kilim xml format Parser and its ClassLoader as resource loader.
 
Method Summary
 ResourceLoader getResourceLoader()
          Returns the current repository resourceLoader.
protected  TemplateDescription getSingleDescription(java.lang.String resourceName, ResourceMapping parsingResult)
          Method getSingleDescription.
 TemplateDescription getTemplateDescription(java.lang.String resourceName)
          Method getTemplateDescription.
 void setResourceLoader(ResourceLoader aResourceLoader)
          Sets the repository resourceLoader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG_ON

private static boolean DEBUG_ON

logger

private static Logger logger

tdParser

private TemplateDescriptionParser tdParser

resourceLoader

private ResourceLoader resourceLoader

resourceCache

private java.util.HashMap resourceCache
Constructor Detail

ResourceRepository

public ResourceRepository()
Creates a new ResourceRepository with the given kilim xml format Parser and its ClassLoader as resource loader.


ResourceRepository

public ResourceRepository(TemplateDescriptionParser aParser)
Creates a new ResourceRepository with the given kilim xml format Parser and its ClassLoader as resource loader.

Parameters:
aParser - the kilim xml format parser to be used
Method Detail

getTemplateDescription

public TemplateDescription getTemplateDescription(java.lang.String resourceName)
                                           throws ResourceNotFoundException,
                                                  KilimException
Description copied from interface: Repository
Method getTemplateDescription.

Specified by:
getTemplateDescription in interface Repository
Parameters:
resourceName - : the name of the template to be loaded
Returns:
Template the loaded description template
Throws:
ResourceNotFoundException - if a required template can't be found
KilimException - :
See Also:
Repository.getTemplateDescription(String)

getSingleDescription

protected TemplateDescription getSingleDescription(java.lang.String resourceName,
                                                   ResourceMapping parsingResult)
                                            throws ResourceNotFoundException
Method getSingleDescription. This method parses a single ".kilim" file. It updates the ResourceMapping object received as a parameter by adding new unknown templates, new "super" references, etc ...

Parameters:
resourceName - : the name of the template to be parsed
parsingResult - : the ResourceMapping object used to store the parsing results to be used during next iterations.
Returns:
TemplateDescription : the internal representation of the template described in the resource.
Throws:
ResourceNotFoundException

setResourceLoader

public void setResourceLoader(ResourceLoader aResourceLoader)
Sets the repository resourceLoader.

Specified by:
setResourceLoader in interface Repository
Parameters:
aResourceLoader - : The resourceLoader to set

getResourceLoader

public ResourceLoader getResourceLoader()
Returns the current repository resourceLoader.

Specified by:
getResourceLoader in interface Repository
Returns:
ResourceLoader