org.weblab_project.core.factory
Class MediaUnitFactory

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

public class MediaUnitFactory
extends java.lang.Object

To create MediaUnits that are not Document we strongly encourage to use this class. It will enable the creation of a MediaUnit having an URI compliant with the WebLabRI recommendations.
Since a non-Document MediaUnit hasn't any sense without being attached to a ComposedUnit or to a Cell ( CellFactory), we only provide a method for creating MediaUnits that takes a ComposedUnit in parameter. As a result, the created MediaUnit (instance of the class given in parameter) is added to the MediaUnit List of the ComposedUnit.

Author:
EADS WebLab Team
Date:
2008-01-18

Field Summary
protected static char SEPARATOR
          The separator char.
 
Method Summary
static
<T extends org.weblab_project.core.model.MediaUnit>
T
createAndLinkMediaUnit(org.weblab_project.core.model.ComposedUnit cu, java.lang.Class<T> muClass)
          Automatically set a valid WebLabRI to the created MediaUnit (an instance of muClass in parameter) using cu to generate an unique id.
 
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 char.

See Also:
Constant Field Values
Method Detail

createAndLinkMediaUnit

public static final <T extends org.weblab_project.core.model.MediaUnit> T createAndLinkMediaUnit(org.weblab_project.core.model.ComposedUnit cu,
                                                                                                 java.lang.Class<T> muClass)
Automatically set a valid WebLabRI to the created MediaUnit (an instance of muClass in parameter) using cu to generate an unique id. Created MediaUnit will be added to the MediaUnit List ofcu.

Type Parameters:
T - The subclass of MediaUnit to be created
Parameters:
cu - the ComposedUnit that will contains the created MediaUnit
muClass - The class of the MediaUnit to be created
Returns:
a new instance of muClass with a valid WebLabRI and added to cu


Copyright © 2004-2009. All Rights Reserved.