eu.etaxonomy.cdm.model.media
Class MediaRepresentation

java.lang.Object
  extended by eu.etaxonomy.cdm.model.common.CdmBase
      extended by eu.etaxonomy.cdm.model.common.VersionableEntity
          extended by eu.etaxonomy.cdm.model.media.MediaRepresentation
All Implemented Interfaces:
ICdmBase, IVersionableEntity, Serializable, Cloneable

@Entity
public class MediaRepresentation
extends VersionableEntity
implements Cloneable

A media representation is basically anything having a MIME Media Type. A media representation consists of one or more parts. Each of them having the same MIME Type, file suffix (if existing) and quality (more or less). E.g. a list of jpg files that represent a scanned article of multiple pages.

Version:
1.0
Author:
m.doering
See Also:
Serialized Form

Field Summary
 
Fields inherited from class eu.etaxonomy.cdm.model.common.CdmBase
uuid
 
Constructor Summary
protected MediaRepresentation()
           
 
Method Summary
 void addRepresentationPart(MediaRepresentationPart mediaRepresentationPart)
           
 Object clone()
          Clones this versionable entity.
 Media getMedia()
           
 String getMimeType()
          getter /setter
 List<MediaRepresentationPart> getParts()
           
 String getSuffix()
           
static MediaRepresentation NewInstance()
          Factory method
static MediaRepresentation NewInstance(String mimeType, String suffix)
          Factory method which sets the mime type and the suffix
static
<T extends MediaRepresentationPart>
MediaRepresentation
NewInstance(String mimeType, String suffix, URI uri, Integer size, Class<T> clazz)
          Factory method which creates a new media representation and adds a media representation part for the uri and the given size.
 void removeRepresentationPart(MediaRepresentationPart representationPart)
           
protected  void setMedia(Media media)
          Deprecated. for internal (bidirectional) use only
 void setMimeType(String mimeType)
           
 void setSuffix(String suffix)
           
 
Methods inherited from class eu.etaxonomy.cdm.model.common.VersionableEntity
equals, getUpdated, getUpdatedBy, setUpdated, setUpdatedBy
 
Methods inherited from class eu.etaxonomy.cdm.model.common.CdmBase
addPropertyChangeListener, addPropertyChangeListener, clone, deproxy, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getCreated, getCreatedBy, getId, getUuid, hashCode, hasListeners, instanceToString, invokeSetMethod, invokeSetMethodWithNull, isInstanceOf, removePropertyChangeListener, removePropertyChangeListener, setCreated, setCreatedBy, setId, setUuid, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.ICdmBase
getCreated, getCreatedBy, getId, getUuid, setCreated, setCreatedBy, setId, setUuid
 

Constructor Detail

MediaRepresentation

protected MediaRepresentation()
Method Detail

NewInstance

public static MediaRepresentation NewInstance()
Factory method

Returns:

NewInstance

public static MediaRepresentation NewInstance(String mimeType,
                                              String suffix)
Factory method which sets the mime type and the suffix

Returns:

NewInstance

public static <T extends MediaRepresentationPart> MediaRepresentation NewInstance(String mimeType,
                                                                                  String suffix,
                                                                                  URI uri,
                                                                                  Integer size,
                                                                                  Class<T> clazz)
Factory method which creates a new media representation and adds a media representation part for the uri and the given size. Returns null if uri is empty

Returns:
Throws:
IllegalAccessException
InstantiationException

getMimeType

public String getMimeType()
getter /setter


setMimeType

public void setMimeType(String mimeType)
Parameters:
mimeType - mimeType

getSuffix

public String getSuffix()

setSuffix

public void setSuffix(String suffix)
Parameters:
mimeType - mimeType

getMedia

public Media getMedia()

setMedia

@Deprecated
protected void setMedia(Media media)
Deprecated. for internal (bidirectional) use only

Parameters:
media -

getParts

public List<MediaRepresentationPart> getParts()

addRepresentationPart

public void addRepresentationPart(MediaRepresentationPart mediaRepresentationPart)

removeRepresentationPart

public void removeRepresentationPart(MediaRepresentationPart representationPart)

clone

public Object clone()
             throws CloneNotSupportedException
Description copied from class: VersionableEntity
Clones this versionable entity. Set fields for nextVersion, previousVersion, updated, updatedBy and createdBy are set to null The id is set to 0. The uuid is created new. The createdWhen is set to the current date.

Overrides:
clone in class VersionableEntity
Throws:
CloneNotSupportedException
See Also:
Object.clone()


Copyright © 2007-2013 EDIT. All Rights Reserved.