|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.weblab.core.extended.factory.MediaUnitFactory
public class MediaUnitFactory
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 Document, we only provide a method
for creating MediaUnits that takes a Document in
parameter. As a result, the created MediaUnit (instance of the
class given in parameter) is added to the MediaUnit List of the Document.
| Field Summary | |
|---|---|
protected static java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
innerMap
This data structure is not well adapted to manage WebLab Resource |
protected static char |
SEPARATOR
The separator char. |
| Method Summary | ||
|---|---|---|
protected static void |
addAnnotation(Annotation annotation,
Resource resource,
Resource root)
|
|
protected static void |
addChild(MediaUnit mu,
Document parent)
|
|
protected static void |
addChild(MediaUnit mu,
Resource parent,
Resource root)
Deprecated. since model 1.2, no need to separates root and parent. replaced by addChild(final MediaUnit mu, final Document parent) |
|
protected static void |
addDescriptor(LowLevelDescriptor descriptor,
Resource parent,
Resource root)
|
|
protected static void |
addSegment(Segment segment,
MediaUnit parent,
Resource root)
|
|
protected static void |
cleanMapping(java.lang.String uri)
|
|
static
|
createAndLinkMediaUnit(Document doc,
java.lang.Class<T> muClass)
|
|
static
|
createAndLinkMediaUnit(Resource res,
java.lang.Class<T> muClass)
Deprecated. since model 1.2, impossible to create a sub MediaUnit on something else than a Document. replaced by createAndLinkMediaUnit(final Document doc, final Class |
|
protected static java.lang.String |
createSegmentURIFor(java.lang.Object segmentContainer)
|
|
protected static java.lang.String |
createUniqueURIFrom(Resource resource,
boolean isChild,
boolean isAnnotation)
Create a URI checking it does not already exist in the resource. |
|
protected static java.lang.String |
createUniqueURIin(java.util.Set<java.lang.String> uris,
boolean isChild,
boolean isAnnotation,
java.lang.String parentUri)
|
|
protected static Resource |
findParent(MediaUnit mu,
Resource resource)
|
|
protected static java.lang.String |
getUniqueWebLabRIFrom(Resource res,
boolean isChild,
boolean isAnnotation)
|
|
protected static java.util.Set<java.lang.String> |
getUris(java.lang.String key)
|
|
protected static java.util.Set<java.lang.String> |
listUri(Resource resource)
List uris in the resource |
|
protected static java.util.Set<java.lang.String> |
listUri(Resource resource,
boolean force)
Lists all URI in a resource and its subresources. |
|
protected static java.util.Set<java.lang.String> |
listUri(Segment segment)
Lists all URI in a segment and its subsegments. |
|
protected static void |
removeChild(MediaUnit mu,
Resource parent,
Resource root)
|
|
protected static void |
setUris(java.lang.String key,
java.util.Set<java.lang.String> uris)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final char SEPARATOR
protected static final java.util.Map<java.lang.String,java.util.Set<java.lang.String>> innerMap
| Method Detail |
|---|
@Deprecated
public static final <T extends MediaUnit> T createAndLinkMediaUnit(Resource res,
java.lang.Class<T> muClass)
WebLabRI to the created MediaUnit (an instance of muClass in parameter)
using doc to generate an unique id. Created MediaUnit will be added to the MediaUnit List of
doc.
T - The subclass of MediaUnit to be createdres - the Resource that will contains the created MediaUnitmuClass - The class of the MediaUnit to be created
muClass with a valid WebLabRI and added to cu
public static final <T extends MediaUnit> T createAndLinkMediaUnit(Document doc,
java.lang.Class<T> muClass)
T - The parametrised type of MediaUnit to be created and returneddoc - The document in which to add the created MediaUnitmuClass - The parametrised type of MediaUnit to be created and returned
MediaUnitprotected static void cleanMapping(java.lang.String uri)
protected static java.util.Set<java.lang.String> getUris(java.lang.String key)
protected static void setUris(java.lang.String key,
java.util.Set<java.lang.String> uris)
protected static java.util.Set<java.lang.String> listUri(Resource resource)
resource - a resource
protected static java.util.Set<java.lang.String> listUri(Segment segment)
segment - a segment
protected static java.util.Set<java.lang.String> listUri(Resource resource,
boolean force)
resource - a resourceforce - if false URI in this resource will not be listed if the resource have already been processed, else they will not matter what.
protected static java.lang.String createSegmentURIFor(java.lang.Object segmentContainer)
protected static java.lang.String createUniqueURIFrom(Resource resource,
boolean isChild,
boolean isAnnotation)
resource - a top container resourceisChild - if true, the uri will describe a child or subchild of this resourceisAnnotation - if true, the uri will describe a annotation on this resource
protected static java.lang.String createUniqueURIin(java.util.Set<java.lang.String> uris,
boolean isChild,
boolean isAnnotation,
java.lang.String parentUri)
protected static void removeChild(MediaUnit mu,
Resource parent,
Resource root)
protected static void addAnnotation(Annotation annotation,
Resource resource,
Resource root)
protected static void addSegment(Segment segment,
MediaUnit parent,
Resource root)
protected static void addDescriptor(LowLevelDescriptor descriptor,
Resource parent,
Resource root)
@Deprecated
protected static void addChild(MediaUnit mu,
Resource parent,
Resource root)
protected static void addChild(MediaUnit mu,
Document parent)
protected static Resource findParent(MediaUnit mu,
Resource resource)
protected static final java.lang.String getUniqueWebLabRIFrom(Resource res,
boolean isChild,
boolean isAnnotation)
res - The Resource to be used to create WebLabRI
String to be used as URI by the MediaUnit created
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||