Class AttachmentBuilderPlugin
- java.lang.Object
-
- org.opencastproject.mediapackage.elementbuilder.AbstractElementBuilderPlugin
-
- org.opencastproject.mediapackage.elementbuilder.AbstractAttachmentBuilderPlugin
-
- org.opencastproject.mediapackage.elementbuilder.AttachmentBuilderPlugin
-
- All Implemented Interfaces:
MediaPackageElementBuilderPlugin
,MediaPackageElementBuilder
public class AttachmentBuilderPlugin extends AbstractAttachmentBuilderPlugin implements MediaPackageElementBuilder
This implementation of theMediaPackageElementBuilderPlugin
recognizes arbitrary attachments and creates media package element representations for them.A media package element is considered an attachment by this plugin if it is of type
Attachment
and does not have any specializing flavor.
-
-
Field Summary
-
Fields inherited from class org.opencastproject.mediapackage.elementbuilder.AbstractAttachmentBuilderPlugin
flavor
-
Fields inherited from class org.opencastproject.mediapackage.elementbuilder.AbstractElementBuilderPlugin
mimeTypes, priority, xpath
-
-
Constructor Summary
Constructors Constructor Description AttachmentBuilderPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(URI uri, MediaPackageElement.Type type, MediaPackageElementFlavor flavor)
This method is called on every registered media package builder plugin until one of these plugins returnstrue
.boolean
accept(Node elementNode)
This implementation ofaccept
tests for the correct node type (attachment).int
getPriority()
Returns -1 by default.String
toString()
-
Methods inherited from class org.opencastproject.mediapackage.elementbuilder.AbstractAttachmentBuilderPlugin
accept, elementFromManifest, elementFromURI, elementFromURI, newElement, specializeAttachment
-
Methods inherited from class org.opencastproject.mediapackage.elementbuilder.AbstractElementBuilderPlugin
destroy, init, setPriority
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opencastproject.mediapackage.MediaPackageElementBuilder
elementFromManifest, elementFromURI, elementFromURI, newElement
-
-
-
-
Method Detail
-
accept
public boolean accept(URI uri, MediaPackageElement.Type type, MediaPackageElementFlavor flavor)
Description copied from interface:MediaPackageElementBuilderPlugin
This method is called on every registered media package builder plugin until one of these plugins returnstrue
. If no plugin recognises the file, it is rejected.The parameters
type
andflavor
may be taken as strong hints and may both benull
.Implementers schould return the correct mime type for the given file if they are absolutely sure about the file. Otherwise,
null
should be returned.- Specified by:
accept
in interfaceMediaPackageElementBuilderPlugin
- Overrides:
accept
in classAbstractAttachmentBuilderPlugin
- Parameters:
uri
- the element locationtype
- the element typeflavor
- the element flavor- Returns:
true
if the plugin can handle the element- See Also:
AbstractAttachmentBuilderPlugin.accept(URI, org.opencastproject.mediapackage.MediaPackageElement.Type , org.opencastproject.mediapackage.MediaPackageElementFlavor)
-
accept
public boolean accept(Node elementNode)
Description copied from class:AbstractAttachmentBuilderPlugin
This implementation ofaccept
tests for the correct node type (attachment).- Specified by:
accept
in interfaceMediaPackageElementBuilderPlugin
- Overrides:
accept
in classAbstractAttachmentBuilderPlugin
- Parameters:
elementNode
- the node- Returns:
true
if the plugin is able to create such an element- See Also:
AbstractAttachmentBuilderPlugin.accept(org.w3c.dom.Node)
-
getPriority
public int getPriority()
Returns -1 by default. This plugin is an implementation for unknown attachments, therefore it returns-1
as its priority.- Overrides:
getPriority
in classAbstractElementBuilderPlugin
- See Also:
AbstractElementBuilderPlugin.getPriority()
-
toString
public String toString()
- Overrides:
toString
in classAbstractAttachmentBuilderPlugin
- See Also:
Object.toString()
-
-