org.weblab_project.core.factory
Class ResourceFactory

java.lang.Object
  extended by org.weblab_project.core.factory.ResourceFactory

public class ResourceFactory
extends java.lang.Object

A factory to be used to create all the Resources defined in the model. When creating a Resource, this factory will ensure that it contains an URI compliant with WebLabRI.
We strongly encourage NOT to use this class in order to create non standalone resources. In fact, use this class to create Document, ResourceCollection, Ontology, Query, Service and HumanResource, the only standalone Resources. For other Resources, you should use other factories.

Author:
EADS WebLab Team
See Also:
AnnotationFactory, LineFactory, MediaUnitFactory, SegmentFactory, LowLevelDescriptorFactory, CellFactory
Date:
2008-01-15

Field Summary
protected static char SEPARATOR
          The separator
 
Method Summary
static
<T extends Resource>
T
createResource(java.lang.String idRef, java.lang.String idRes, java.lang.Class<T> resClass)
          Use this method to create Resources that have a sense alone, and that are not contained by anything (but a ResourceCollection).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEPARATOR

protected static final char SEPARATOR
The separator

See Also:
Constant Field Values
Method Detail

createResource

public static <T extends Resource> T createResource(java.lang.String idRef,
                                                    java.lang.String idRes,
                                                    java.lang.Class<T> resClass)
Use this method to create Resources that have a sense alone, and that are not contained by anything (but a ResourceCollection).
It's recommended to only use this class when creating Document, ResourceCollection, Ontology, Query, Service and HumanResource instances.

Type Parameters:
T - The class of the Resource to be instancied.F
Parameters:
idRef - Resource creator unique reference
idRes - Resource unique reference in the creator
resClass - The implementation class of the resource
Returns:
An instance of resourceClass with a valid WebLabRI


Copyright © 2004-2010. All Rights Reserved.