org.appdapter.registry.basic
Class BasicRegistry

java.lang.Object
  extended by org.appdapter.core.log.BasicDebugger
      extended by org.appdapter.registry.basic.BasicRegistry
All Implemented Interfaces:
Registry, SimpleRegistry, VerySimpleRegistry

public class BasicRegistry
extends BasicDebugger
implements VerySimpleRegistry

Author:
Stu B.

Field Summary
 
Fields inherited from class org.appdapter.core.log.BasicDebugger
IMPO_HI, IMPO_HIHI, IMPO_LO, IMPO_LOLO, IMPO_MAX, IMPO_MIN, IMPO_NORM
 
Constructor Summary
BasicRegistry()
           
 
Method Summary
protected
<OT> List<OT>
brutishlyCollectAllMatches(Class<OT> objClz, Pattern p)
           
<OT> List<OT>
findAllMatches(Class<OT> objClaz, Pattern p, int minAllowed, int maxAllowed)
           
<OT> OT
findOptionalFirstMatch(Class<OT> objClaz, Pattern p)
           
<OT> OT
findOptionalUniqueMatch(Class<OT> objClaz, Pattern p)
           
<OT> OT
findOptionalUniqueNamedObject(Class<OT> objClaz, String objName)
           
<OT> OT
findRequiredUniqueMatch(Class<OT> objClaz, Pattern p)
           
<OT> OT
findRequiredUniqueNamedObject(Class<OT> objClaz, String objName)
           
protected
<OT> BasicFinder<OT>
getBasicFinder(Class<OT> objClaz)
           
<OT> Finder<OT>
getFinder(Class<OT> objClaz)
           
 void registerNamedObject(Object o, String objName)
           
 void registerObject(Object o, Description d)
           
 
Methods inherited from class org.appdapter.core.log.BasicDebugger
checkDebugImportance, getLogger, isLoggerUsable, logError, logInfo, logInfo, logInfoEvent, setDebugImportanceThreshold, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicRegistry

public BasicRegistry()
Method Detail

registerObject

public void registerObject(Object o,
                           Description d)
Specified by:
registerObject in interface Registry

getFinder

public <OT> Finder<OT> getFinder(Class<OT> objClaz)
Specified by:
getFinder in interface Registry
Returns:
a Finder that can search the Registry for objects of the given class OT.

getBasicFinder

protected <OT> BasicFinder<OT> getBasicFinder(Class<OT> objClaz)

findRequiredUniqueMatch

public <OT> OT findRequiredUniqueMatch(Class<OT> objClaz,
                                       Pattern p)
                           throws Exception
Specified by:
findRequiredUniqueMatch in interface SimpleRegistry
Returns:
exactly one unique match or exception is thrown
Throws:
Exception

findOptionalUniqueMatch

public <OT> OT findOptionalUniqueMatch(Class<OT> objClaz,
                                       Pattern p)
                           throws Exception
Specified by:
findOptionalUniqueMatch in interface SimpleRegistry
Returns:
null if nothing, or single unique match, but throws on multi-match
Throws:
Exception

findOptionalFirstMatch

public <OT> OT findOptionalFirstMatch(Class<OT> objClaz,
                                      Pattern p)
Specified by:
findOptionalFirstMatch in interface SimpleRegistry
Returns:
any match found or null, with no uniqueness constraints, no problem mon.

findAllMatches

public <OT> List<OT> findAllMatches(Class<OT> objClaz,
                                    Pattern p,
                                    int minAllowed,
                                    int maxAllowed)
                        throws Exception
Specified by:
findAllMatches in interface SimpleRegistry
Returns:
all matches, but throws if result size would be outside of inclusive-bounds [minAllowed, maxAllowed]
Throws:
Exception

brutishlyCollectAllMatches

protected <OT> List<OT> brutishlyCollectAllMatches(Class<OT> objClz,
                                                   Pattern p)

registerNamedObject

public void registerNamedObject(Object o,
                                String objName)
Specified by:
registerNamedObject in interface VerySimpleRegistry

findOptionalUniqueNamedObject

public <OT> OT findOptionalUniqueNamedObject(Class<OT> objClaz,
                                             String objName)
                                 throws Exception
Specified by:
findOptionalUniqueNamedObject in interface VerySimpleRegistry
Throws:
Exception

findRequiredUniqueNamedObject

public <OT> OT findRequiredUniqueNamedObject(Class<OT> objClaz,
                                             String objName)
                                 throws Exception
Specified by:
findRequiredUniqueNamedObject in interface VerySimpleRegistry
Throws:
Exception


Copyright © 2010-2012. All Rights Reserved.