|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.weblab.core.extended.factory.SegmentFactory
public class SegmentFactory
To create Segments we strongly encourage to use this class. It will enable the creation of a
Segment having an URI compliant with the WebLabRI recommendations.
Since an Segment hasn't any sense without being attached to a MediaUnit, we only provide a
method for creating Segment s that takes a MediaUnit in parameter. As a result, the created
Segment (an instance of the Segment class in
parameter) is added to the Segment List of the MediaUnit.
| 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 |
| Method Summary | ||
|---|---|---|
protected static void |
addAnnotation(org.ow2.weblab.core.model.Annotation annotation,
org.ow2.weblab.core.model.Resource resource,
org.ow2.weblab.core.model.Resource root)
|
|
protected static void |
addChild(org.ow2.weblab.core.model.MediaUnit mu,
org.ow2.weblab.core.model.Resource parent,
org.ow2.weblab.core.model.Resource root)
|
|
protected static void |
addDescriptor(org.ow2.weblab.core.model.LowLevelDescriptor descriptor,
org.ow2.weblab.core.model.Resource parent,
org.ow2.weblab.core.model.Resource root)
|
|
protected static void |
addSegment(org.ow2.weblab.core.model.Segment segment,
org.ow2.weblab.core.model.MediaUnit parent,
org.ow2.weblab.core.model.Resource root)
|
|
protected static void |
cleanMapping(java.lang.String uri)
|
|
static org.ow2.weblab.core.model.LinearSegment |
createAndLinkLinearSegment(org.ow2.weblab.core.model.Text text,
int start,
int end)
Look in text if a LinearSegment already exists at start and
end. |
|
static
|
createAndLinkSegment(org.ow2.weblab.core.model.MediaUnit mediaUnit,
java.lang.Class<T> segClass)
Automatically set a valid WebLabRI to the created Segment using the
MediaUnit to generate an unique id. |
|
protected static java.lang.String |
createUniqueURIFrom(org.ow2.weblab.core.model.Resource resource,
boolean isChild,
boolean isAnnotation)
|
|
protected static java.lang.String |
createUniqueURIin(java.util.Set<java.lang.String> uris,
boolean isChild,
boolean isAnnotation,
java.lang.String parentUri)
|
|
protected static org.ow2.weblab.core.model.Resource |
findParent(org.ow2.weblab.core.model.MediaUnit mu,
org.ow2.weblab.core.model.Resource resource)
|
|
protected static java.lang.String |
getUniqueWebLabRIFrom(org.ow2.weblab.core.model.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(org.ow2.weblab.core.model.Resource resource)
List uris in the resource |
|
protected static java.util.Set<java.lang.String> |
listUri(org.ow2.weblab.core.model.Resource resource,
boolean force)
|
|
protected static void |
removeChild(org.ow2.weblab.core.model.MediaUnit mu,
org.ow2.weblab.core.model.Resource parent,
org.ow2.weblab.core.model.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 java.util.Map<java.lang.String,java.util.Set<java.lang.String>> innerMap
| Method Detail |
|---|
public static final org.ow2.weblab.core.model.LinearSegment createAndLinkLinearSegment(org.ow2.weblab.core.model.Text text,
int start,
int end)
text if a LinearSegment already exists at start and
end. If it's the case, returns it.
Otherwise, it creates a LinearSegment using createAndLinkSegment(MediaUnit, Class) method,
and setting the start and end.
text - The Text containing the Segmentstart - char index of the Segment startend - char index of the Segment end
LinearSegment or the existing one at the same position in the
Text.
public static final <T extends org.ow2.weblab.core.model.Segment> T createAndLinkSegment(org.ow2.weblab.core.model.MediaUnit mediaUnit,
java.lang.Class<T> segClass)
WebLabRI to the created Segment using the
MediaUnit to generate an unique id. Created Segment will be added to the
MediaUnit.
T - The subclass of Segment to be createdmediaUnit - the MediaUnit that will contains the created SegmentsegClass - The class of the Segment to be created
segClass with a valid WebLabRI and added to the
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(org.ow2.weblab.core.model.Resource resource)
resource - a resource
protected static java.util.Set<java.lang.String> listUri(org.ow2.weblab.core.model.Resource resource,
boolean force)
protected static java.lang.String createUniqueURIFrom(org.ow2.weblab.core.model.Resource resource,
boolean isChild,
boolean isAnnotation)
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(org.ow2.weblab.core.model.MediaUnit mu,
org.ow2.weblab.core.model.Resource parent,
org.ow2.weblab.core.model.Resource root)
protected static void addAnnotation(org.ow2.weblab.core.model.Annotation annotation,
org.ow2.weblab.core.model.Resource resource,
org.ow2.weblab.core.model.Resource root)
protected static void addSegment(org.ow2.weblab.core.model.Segment segment,
org.ow2.weblab.core.model.MediaUnit parent,
org.ow2.weblab.core.model.Resource root)
protected static void addDescriptor(org.ow2.weblab.core.model.LowLevelDescriptor descriptor,
org.ow2.weblab.core.model.Resource parent,
org.ow2.weblab.core.model.Resource root)
protected static void addChild(org.ow2.weblab.core.model.MediaUnit mu,
org.ow2.weblab.core.model.Resource parent,
org.ow2.weblab.core.model.Resource root)
protected static org.ow2.weblab.core.model.Resource findParent(org.ow2.weblab.core.model.MediaUnit mu,
org.ow2.weblab.core.model.Resource resource)
protected static final java.lang.String getUniqueWebLabRIFrom(org.ow2.weblab.core.model.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 | |||||||||