biz.hammurapi.registry
Class Directory

java.lang.Object
  extended by biz.hammurapi.registry.Directory
All Implemented Interfaces:
RegistryEntry

public class Directory
extends java.lang.Object
implements RegistryEntry

Registry entry which groups other entries.

Author:
Pavel

Constructor Summary
Directory()
           
Directory(java.lang.String name, java.util.Collection<RegistryEntry> children)
           
Directory(java.lang.String name, RegistryEntry... children)
           
 
Method Summary
 void addEntry(RegistryEntry child)
           
 void addEntry(java.net.URL childConfigUrl)
           
 java.util.List<RegistryEntry> getChildren(java.lang.Class<?>[] componentTypes, java.lang.Class<?> factoryTypes, java.util.Set<java.lang.String> filterTokens)
           
 java.lang.Class<?>[] getComponentTypes()
          One entry may produce different types of objects.
 java.lang.String getDescription()
           
 java.lang.Class<?>[] getFactoryTypes()
          One entry may support different factory types, e.g.
 java.lang.String getName()
           
 java.lang.String getTooltip()
           
 boolean hasChildren(java.lang.Class<?>[] componentTypes, java.lang.Class<?> factoryTypes, java.util.Set<java.lang.String> filterTokens)
           
 boolean match(java.lang.Class<?>[] componentTypes, java.lang.Class<?> factoryTypes, java.util.Set<java.lang.String> filterTokens)
          Directory never matches.
<T> FactoryConfigurator<T>
newFactory(java.lang.Class<T> factoryClass)
          Directory cannot be instantiated.
 void setDescription(java.lang.String description)
           
 void setName(java.lang.String name)
           
 void setTooltip(java.lang.String tooltip)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Directory

public Directory()

Directory

public Directory(java.lang.String name,
                 java.util.Collection<RegistryEntry> children)

Directory

public Directory(java.lang.String name,
                 RegistryEntry... children)
Method Detail

addEntry

public void addEntry(RegistryEntry child)

addEntry

public void addEntry(java.net.URL childConfigUrl)
              throws biz.hammurapi.config.ConfigurationException
Throws:
biz.hammurapi.config.ConfigurationException

getChildren

public java.util.List<RegistryEntry> getChildren(java.lang.Class<?>[] componentTypes,
                                                 java.lang.Class<?> factoryTypes,
                                                 java.util.Set<java.lang.String> filterTokens)
Specified by:
getChildren in interface RegistryEntry
Parameters:
componentTypes - If this parameter is not null then only entries which support one of component types are returned.
Returns:
Children matching tokens.

getComponentTypes

public java.lang.Class<?>[] getComponentTypes()
Description copied from interface: RegistryEntry
One entry may produce different types of objects. This method returns types supported by the entry.

Specified by:
getComponentTypes in interface RegistryEntry
Returns:
Classes/interfaces implemented by this entry.

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface RegistryEntry
Returns:
Long description to display in component details panel.

setDescription

public void setDescription(java.lang.String description)

getFactoryTypes

public java.lang.Class<?>[] getFactoryTypes()
Description copied from interface: RegistryEntry
One entry may support different factory types, e.g. CodeSnippet factory creates a code snippet. That code snippet instantiates and configures component. XML document factory creates an XML element/document for instantiating/configuring component.

Specified by:
getFactoryTypes in interface RegistryEntry
Returns:

getName

public java.lang.String getName()
Specified by:
getName in interface RegistryEntry
Returns:
Component/service name

setName

public void setName(java.lang.String name)

getTooltip

public java.lang.String getTooltip()
Specified by:
getTooltip in interface RegistryEntry
Returns:
Short description to display in component selection tree control.

setTooltip

public void setTooltip(java.lang.String tooltip)

hasChildren

public boolean hasChildren(java.lang.Class<?>[] componentTypes,
                           java.lang.Class<?> factoryTypes,
                           java.util.Set<java.lang.String> filterTokens)
Specified by:
hasChildren in interface RegistryEntry
Parameters:
componentTypes - If this parameter is not null then only entries which support one of component types are displayed.
filterTokens - Filter tokens
Returns:
True if entry has children matching tokens.

match

public boolean match(java.lang.Class<?>[] componentTypes,
                     java.lang.Class<?> factoryTypes,
                     java.util.Set<java.lang.String> filterTokens)
Directory never matches.

Specified by:
match in interface RegistryEntry
Parameters:
componentTypes - If this parameter is not null then only entries which support one of component types are displayed.
filterTokens - Filter tokens
Returns:
True if entry itself matches (i.e. it can be selected in the browser).

newFactory

public <T> FactoryConfigurator<T> newFactory(java.lang.Class<T> factoryClass)
Directory cannot be instantiated.

Specified by:
newFactory in interface RegistryEntry
Type Parameters:
T - Factory class.
Returns:
null


Copyright © 2006 Hammurapi Group. All Rights Reserved.