Package org.biojava.utils.walker
Class WalkerFactory
- java.lang.Object
-
- org.biojava.utils.walker.WalkerFactory
-
public class WalkerFactory extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTypeWithParent(Class type)
Register a type as being a 'container' class.static WalkerFactory
getInstance()
static WalkerFactory
getInstance(Class typeClazz)
Make a WalkerFactory that handles a Visitor for a class of type typeClazz.Class
getTypeClass()
Walker
getWalker(Visitor visitor)
Get a Walker that is customosed to a particular visitor.
-
-
-
Method Detail
-
getInstance
public static WalkerFactory getInstance(Class typeClazz)
Make a WalkerFactory that handles a Visitor for a class of type typeClazz.- Parameters:
typeClazz
- the Class this factory will walk over
-
getInstance
public static WalkerFactory getInstance()
-
getTypeClass
public Class getTypeClass()
-
addTypeWithParent
public void addTypeWithParent(Class type)
Register a type as being a 'container' class. Container classes will be scanned for methods for retrieving child instances that can be walked to. You should never need to call this. The library authors should take care of this for you. Register 'structural' classes here - those with children.- Parameters:
type
- the Class of the type with children
-
getWalker
public Walker getWalker(Visitor visitor) throws BioException
Get a Walker that is customosed to a particular visitor.- Parameters:
visitor
- the Visitor this walker will scan with- Returns:
- a Walker bound to this visitor
- Throws:
BioException
- if the walker could not be built
-
-