Class TincanManifest
java.lang.Object
dev.jcputney.elearning.parser.input.xapi.tincan.TincanManifest
- All Implemented Interfaces:
PackageManifest,Serializable
Represents the root element of a TinCan/xAPI manifest file.
Implements PackageManifest to provide common manifest functionality.
All PackageManifest methods delegate to the first activity in the manifest.
Example XML:
<?xml version="1.0" encoding="utf-8" ?>
<tincan xmlns="http://projecttincan.com/tincan.xsd">
<activities>
<activity id="http://example.com/activity/1"
type="http://adlnet.gov/expapi/activities/course">
<name>Course Name</name>
<description lang="en-US">Course description</description>
<launch lang="en-us">index.html</launch>
</activity>
</activities>
</tincan>
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault no-argument constructor.TincanManifest(List<TincanActivity> activities) Constructor with activities list. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the list of activities in this TinCan package.Returns the description from the first activity.Returns zero duration as TinCan manifests do not include duration.Returns the activity ID from the first activity.Returns the launch URL from the first activity.getTitle()Returns the title from the first activity.Returns null as TinCan manifests do not include version information.inthashCode()voidsetActivities(List<TincanActivity> activities) Sets the list of activities in this TinCan package.
-
Constructor Details
-
TincanManifest
public TincanManifest()Default no-argument constructor. -
TincanManifest
Constructor with activities list.- Parameters:
activities- the list of activities
-
-
Method Details
-
getTitle
Returns the title from the first activity.- Specified by:
getTitlein interfacePackageManifest- Returns:
- the activity name, or null if no activities
-
getDescription
Returns the description from the first activity.- Specified by:
getDescriptionin interfacePackageManifest- Returns:
- the activity description, or null if no activities
-
getLaunchUrl
Returns the launch URL from the first activity.- Specified by:
getLaunchUrlin interfacePackageManifest- Returns:
- the launch URL, or null if no activities
-
getIdentifier
Returns the activity ID from the first activity.- Specified by:
getIdentifierin interfacePackageManifest- Returns:
- the activity ID, or null if no activities
-
getVersion
Returns null as TinCan manifests do not include version information.- Specified by:
getVersionin interfacePackageManifest- Returns:
- null
-
getDuration
Returns zero duration as TinCan manifests do not include duration.- Specified by:
getDurationin interfacePackageManifest- Returns:
- Duration.ZERO
-
getActivities
Gets the list of activities in this TinCan package.- Returns:
- the list of activities
-
setActivities
Sets the list of activities in this TinCan package.- Parameters:
activities- the list of activities
-
equals
-
hashCode
public int hashCode()
-