public class RichObjectFactory
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
clearLRUCache()
Removes all objects from the LRU cache.
|
static void |
clearLRUCache(java.lang.Class clazz)
Removes all objects of the specified class from the LRU cache.
|
static void |
connectToBioSQL(java.lang.Object session)
A utility method that configures the RichObjectFactory for use with a Hibernate session.
|
static CrossReferenceResolver |
getDefaultCrossReferenceResolver()
Returns the default cross ref resolver object.
|
static Namespace |
getDefaultNamespace()
Returns the default namespace object.
|
static ComparableOntology |
getDefaultOntology()
Returns the default ontology object.
|
static PositionResolver |
getDefaultPositionResolver()
Returns the default position resolver object.
|
static RichSequenceHandler |
getDefaultRichSequenceHandler()
Returns the default sequence resolver object.
|
static java.lang.Object |
getObject(java.lang.Class clazz,
java.lang.Object[] params)
Delegates to a RichObjectBuilder to construct/retrieve the object, and returns it.
|
static void |
setApplicationClass(java.lang.Class theBiojavaClass,
java.lang.Class theApplicationClass)
Allow application to override the default biojava class created in getObject - subclass restriction is checked in the builder.
|
static void |
setDefaultCrossReferenceResolver(CrossReferenceResolver crr)
Sets the default crossref resolver to use when resolving remote entries.
|
static void |
setDefaultNamespaceName(java.lang.String name)
Sets the default namespace name to use when loading sequences.
|
static void |
setDefaultOntologyName(java.lang.String name)
Sets the default ontology name to use when loading sequences.
|
static void |
setDefaultPositionResolver(PositionResolver pr)
Sets the default position resolver to use when creating new rich feature locations.
|
static void |
setDefaultRichSequenceHandler(RichSequenceHandler rsh)
Sets the default sequence handler to use when performing sequence manipulation.
|
static void |
setLRUCacheSize(java.lang.Class clazz,
int size)
Sets the size of the LRU cache.
|
static void |
setLRUCacheSize(int size)
Sets the size of the LRU cache.
|
static void |
setRichObjectBuilder(RichObjectBuilder b)
Sets the builder to use when instantiating new Rich objects.
|
public static void setRichObjectBuilder(RichObjectBuilder b)
b
- the builder to use.SimpleRichObjectBuilder
,
BioSQLRichObjectBuilder
public static java.lang.Object getObject(java.lang.Class clazz, java.lang.Object[] params)
clazz
- the class to buildparams
- the parameters to pass to the class' constructorpublic static final void setApplicationClass(java.lang.Class theBiojavaClass, java.lang.Class theApplicationClass)
theBiojavaClass
- one of the well-known builder classes: SimpleNamespace, SimpleComparableOntology, SimpleNCBITaxon, SimpleCrossRef, or SimpleDocReftheApplicationClass
- - a subclass of theBiojavaClasspublic static void clearLRUCache()
public static void clearLRUCache(java.lang.Class clazz)
clazz
- The class of the objects to remove.public static void setLRUCacheSize(int size)
size
- the size of the cache.public static void setLRUCacheSize(java.lang.Class clazz, int size)
size
- the size of the cache.public static void setDefaultNamespaceName(java.lang.String name)
name
- the namespace name to use.public static void setDefaultOntologyName(java.lang.String name)
name
- the ontology name to use.public static void setDefaultPositionResolver(PositionResolver pr)
pr
- the position resolver to use.PositionResolver
,
PositionResolver.AverageResolver
,
RichLocation
public static void setDefaultCrossReferenceResolver(CrossReferenceResolver crr)
crr
- the resolver to use.CrossReferenceResolver
,
DummyCrossReferenceResolver
public static void setDefaultRichSequenceHandler(RichSequenceHandler rsh)
rsh
- the resolver to use.RichSequenceHandler
,
DummyRichSequenceHandler
public static Namespace getDefaultNamespace()
public static ComparableOntology getDefaultOntology()
public static PositionResolver getDefaultPositionResolver()
PositionResolver.AverageResolver
public static CrossReferenceResolver getDefaultCrossReferenceResolver()
DummyCrossReferenceResolver
public static RichSequenceHandler getDefaultRichSequenceHandler()
DummyRichSequenceHandler
public static void connectToBioSQL(java.lang.Object session)
session
- an object containing a Hibernate session.