org.jaudiotagger.tag.id3
Class AbstractID3v2Tag

java.lang.Object
  extended by org.jaudiotagger.tag.id3.AbstractTagItem
      extended by org.jaudiotagger.tag.id3.AbstractTag
          extended by org.jaudiotagger.tag.id3.AbstractID3Tag
              extended by org.jaudiotagger.tag.id3.AbstractID3v2Tag
All Implemented Interfaces:
Tag
Direct Known Subclasses:
ID3v22Tag, ID3v23Tag, ID3v24Tag

public abstract class AbstractID3v2Tag
extends AbstractID3Tag
implements Tag

This is the abstract base class for all ID3v2 tags.

Version:
$Id: AbstractID3v2Tag.java,v 1.30 2007/12/03 13:28:04 paultaylor Exp $
Author:
: Paul Taylor, : Eric Farng

Field Summary
 java.util.HashMap frameMap
          Map of all frames for this tag
static int TAG_HEADER_LENGTH
           
 
Fields inherited from class org.jaudiotagger.tag.id3.AbstractID3Tag
logger
 
Constructor Summary
AbstractID3v2Tag()
          Empty Constructor
 
Method Summary
 void add(TagField field)
          Adds a tagfield to the structure.
 void addAlbum(java.lang.String album)
          Adds an album to the tag.
 void addArtist(java.lang.String artist)
          Adds an artist to the tag.
 void addComment(java.lang.String comment)
          Adds a comment to the tag.
 void addGenre(java.lang.String genre)
          Adds a genre to the tag.
 void addTitle(java.lang.String title)
          Adds a title to the tag.
 void addTrack(java.lang.String track)
          Adds a track to the tag.
 void addYear(java.lang.String year)
          Adds a year to the Tag.
 void adjustPadding(java.io.File file, int paddingSize, long audioStart)
          Adjust the length of the padding at the beginning of the MP3 file, this is only called when there is currently not enough space before the start of the audio to write the tag.
 TagField createAlbumField(java.lang.String content)
           
 TagField createArtistField(java.lang.String content)
           
 TagField createArtworkField(byte[] data, java.lang.String mimeType)
          Create Artwork
 TagField createCommentField(java.lang.String content)
           
abstract  AbstractID3v2Frame createFrame(java.lang.String id)
          Create Frame of correct ID3 version with the specified id
 TagField createGenreField(java.lang.String content)
           
 TagField createLinkedArtworkField(java.lang.String url)
          Create a link to artwork, this is not recommended because the link may be broken if the mp3 or image file is moved
 void createStructure()
           
 void createStructureBody()
           
 void createStructureHeader()
           
 TagField createTagField(TagFieldKey genericKey, java.lang.String value)
          Create a new TagField

Only textual data supported at the moment.

 TagField createTitleField(java.lang.String content)
           
 TagField createTrackField(java.lang.String content)
           
 TagField createYearField(java.lang.String content)
           
 void delete(java.io.RandomAccessFile file)
          Delete Tag
 void deleteTagField(TagFieldKey genericKey)
          Delete fields with this generic key
 boolean equals(java.lang.Object obj)
          Is this tag equivalent to another
 java.util.List<TagField> get(java.lang.String id)
          Retrieve the values that exists for this id3 frame id
 java.util.List<TagField> get(TagFieldKey genericKey)
          Get field(s) for this key
 java.util.List getAlbum()
           
 java.util.List getArtist()
           
 java.util.List getComment()
           
 int getDuplicateBytes()
          Returns the number of bytes which come from duplicate frames
 java.lang.String getDuplicateFrameId()
          Return the string which holds the ids of all duplicate frames.
 int getEmptyFrameBytes()
          Returns the number of bytes which come from empty frames
 int getFieldCount()
          Return the number of fields
 java.util.Iterator getFields()
          Iterator over all the fields within the tag, handle multiple fields with the same id
 int getFileReadBytes()
          Returns the tag size as reported by the tag header
 java.lang.String getFirst(java.lang.String identifier)
          Retrieve the first value that exists for this identifier

If the value is a String it returns that, otherwise returns a summary of the fields information

 java.lang.String getFirst(TagFieldKey genericKey)
          Retrieve the first value that exists for this generic key
 java.lang.String getFirstAlbum()
           
 java.lang.String getFirstArtist()
           
 java.lang.String getFirstComment()
           
 AbstractID3v2Frame getFirstField(java.lang.String identifier)
          Retrieve the first tagfield that exists for this identifier
 java.lang.String getFirstGenre()
           
 java.lang.String getFirstTitle()
           
 java.lang.String getFirstTrack()
           
 java.lang.String getFirstYear()
           
 java.lang.Object getFrame(java.lang.String identifier)
          For single frames return the frame in this tag with given identifier if it exists, if multiple frames exist with the same identifier it will return a list containing all the frames with this identifier

Warning the match is only done against the identifier so if a tag contains a frame with an unsupported body but happens to have an identifier that is valid for another version of the tag it will be returned.

 int getFrameCount()
          Return the number of frames in this tag of a particular type, multiple frames of the same time will only be counted once
 java.util.Iterator getFrameOfType(java.lang.String identifier)
          Return all frames which start with the identifier, this can be more than one which is useful if trying to retrieve similar frames e.g TIT1,TIT2,TIT3 ...
 java.util.List getGenre()
           
 int getInvalidFrameBytes()
          Return byte count of invalid frames
 int getSize()
          Return tag size based upon the sizes of the tags rather than the physical no of bytes between start of ID3Tag and start of Audio Data.Should be extended by subclasses to include header.
 java.util.List getTitle()
           
 java.util.List getTrack()
           
static long getV2TagSizeIfExists(java.io.File file)
          Checks to see if the file contains an ID3tag and if so return its size as reported in the tag header and return the size of the tag (including header), if no such tag exists return zero.
 java.util.List getYear()
           
 boolean hasCommonFields()
          Returns true, if at least one of the contained fields is a common field (TagField.isCommon()).
 boolean hasField(java.lang.String id)
          Does this tag contain a field with the specified id
 boolean hasFrame(java.lang.String identifier)
          Return whether tag has frame with this identifier

Warning the match is only done against the identifier so if a tag contains a frame with an unsuported body but happens to have an identifier that is valid for another version of the tag it will return true

 boolean hasFrameAndBody(java.lang.String identifier)
          Return whether tag has frame with this identifier and a related body.
 boolean hasFrameOfType(java.lang.String identifier)
          Return whether tag has frame starting with this identifier

Warning the match is only done against the identifier so if a tag contains a frame with an unsupported body but happens to have an identifier that is valid for another version of the tag it will return true

 boolean isEmpty()
          Is this tag empty
 java.util.Iterator iterator()
          Return the frames in the order they were added
 void removeFrame(java.lang.String identifier)
          Remove frame(s) with this identifier from tag
 void removeFrameOfType(java.lang.String identifier)
          Remove any frames starting with this identifier from tag
 void removeUnsupportedFrames()
          Remove all frame(s) which have an unsupported body, in other words remove all frames that are not part of the standard frameset for this tag
 boolean seek(java.nio.ByteBuffer byteBuffer)
          Does a tag of the correct version exist in this file.
 void set(TagField field)
           
 void setAlbum(java.lang.String s)
           
 void setArtist(java.lang.String s)
           
 void setComment(java.lang.String s)
           
 boolean setEncoding(java.lang.String enc)
           
 void setFrame(AbstractID3v2Frame frame)
          Add a frame to this tag
 void setFrame(java.lang.String identifier, java.util.List<AbstractID3v2Frame> multiFrame)
          Used for setting multiple frames for a single frame Identifier

Warning if frame(s) already exists for this identifier thay are overwritten

TODO needs to ensure do not add an invalid frame for this tag

 void setGenre(java.lang.String s)
           
 void setTitle(java.lang.String s)
           
 void setTrack(java.lang.String s)
           
 void setYear(java.lang.String s)
           
 void write(java.io.File file, long audioStartByte)
          Write tag to file.
 void write(java.io.RandomAccessFile file)
          Write tag to file.
 void write(java.nio.channels.WritableByteChannel channel)
          Write tag to channel.
 
Methods inherited from class org.jaudiotagger.tag.id3.AbstractID3Tag
getIdentifier, getMajorVersion, getRelease, getRevision, toString
 
Methods inherited from class org.jaudiotagger.tag.id3.AbstractTagItem
isSubsetOf, read
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jaudiotagger.tag.Tag
toString
 

Field Detail

TAG_HEADER_LENGTH

public static final int TAG_HEADER_LENGTH
See Also:
Constant Field Values

frameMap

public java.util.HashMap frameMap
Map of all frames for this tag

Constructor Detail

AbstractID3v2Tag

public AbstractID3v2Tag()
Empty Constructor

Method Detail

getDuplicateBytes

public int getDuplicateBytes()
Returns the number of bytes which come from duplicate frames

Returns:
the number of bytes which come from duplicate frames

getDuplicateFrameId

public java.lang.String getDuplicateFrameId()
Return the string which holds the ids of all duplicate frames.

Returns:
the string which holds the ids of all duplicate frames.

getEmptyFrameBytes

public int getEmptyFrameBytes()
Returns the number of bytes which come from empty frames

Returns:
the number of bytes which come from empty frames

getInvalidFrameBytes

public int getInvalidFrameBytes()
Return byte count of invalid frames

Returns:
byte count of invalid frames

getFileReadBytes

public int getFileReadBytes()
Returns the tag size as reported by the tag header

Returns:
the tag size as reported by the tag header

hasFrame

public boolean hasFrame(java.lang.String identifier)
Return whether tag has frame with this identifier

Warning the match is only done against the identifier so if a tag contains a frame with an unsuported body but happens to have an identifier that is valid for another version of the tag it will return true

Parameters:
identifier - frameId to lookup
Returns:
true if tag has frame with this identifier

hasFrameAndBody

public boolean hasFrameAndBody(java.lang.String identifier)
Return whether tag has frame with this identifier and a related body. This is required to protect against circumstances whereby a tag contains a frame with an unsupported body but happens to have an identifier that is valid for another version of the tag which it has been converted to

e.g TDRC is an invalid frame in a v23 tag but if somehow a v23tag has been created by another application with a TDRC frame we construct an UnsupportedFrameBody to hold it, then this library constructs a v24 tag, it will contain a frame with id TDRC but it will not have the expected frame body it is not really a TDRC frame.

Parameters:
identifier - frameId to lookup
Returns:
true if tag has frame with this identifier

hasFrameOfType

public boolean hasFrameOfType(java.lang.String identifier)
Return whether tag has frame starting with this identifier

Warning the match is only done against the identifier so if a tag contains a frame with an unsupported body but happens to have an identifier that is valid for another version of the tag it will return true

Parameters:
identifier - start of frameId to lookup
Returns:
tag has frame starting with this identifier

getFrame

public java.lang.Object getFrame(java.lang.String identifier)
For single frames return the frame in this tag with given identifier if it exists, if multiple frames exist with the same identifier it will return a list containing all the frames with this identifier

Warning the match is only done against the identifier so if a tag contains a frame with an unsupported body but happens to have an identifier that is valid for another version of the tag it will be returned.

Parameters:
identifier - is an ID3Frame identifier
Returns:
matching frame, or list of matching frames

getFirst

public java.lang.String getFirst(java.lang.String identifier)
Retrieve the first value that exists for this identifier

If the value is a String it returns that, otherwise returns a summary of the fields information

Specified by:
getFirst in interface Tag
Parameters:
identifier -
Returns:

getFirstField

public AbstractID3v2Frame getFirstField(java.lang.String identifier)
Retrieve the first tagfield that exists for this identifier

Specified by:
getFirstField in interface Tag
Parameters:
identifier -
Returns:
tag field or null if doesnt exist

setFrame

public void setFrame(AbstractID3v2Frame frame)
Add a frame to this tag

Parameters:
frame - the frame to add

Warning if frame(s) already exists for this identifier thay are overwritten


set

public void set(TagField field)
         throws FieldDataInvalidException
Specified by:
set in interface Tag
Parameters:
field -
Throws:
FieldDataInvalidException

setAlbum

public void setAlbum(java.lang.String s)
              throws FieldDataInvalidException
Specified by:
setAlbum in interface Tag
Throws:
FieldDataInvalidException

setArtist

public void setArtist(java.lang.String s)
               throws FieldDataInvalidException
Specified by:
setArtist in interface Tag
Throws:
FieldDataInvalidException

setComment

public void setComment(java.lang.String s)
                throws FieldDataInvalidException
Specified by:
setComment in interface Tag
Throws:
FieldDataInvalidException

setGenre

public void setGenre(java.lang.String s)
              throws FieldDataInvalidException
Specified by:
setGenre in interface Tag
Throws:
FieldDataInvalidException

setTitle

public void setTitle(java.lang.String s)
              throws FieldDataInvalidException
Specified by:
setTitle in interface Tag
Throws:
FieldDataInvalidException

setTrack

public void setTrack(java.lang.String s)
              throws FieldDataInvalidException
Specified by:
setTrack in interface Tag
Throws:
FieldDataInvalidException

setYear

public void setYear(java.lang.String s)
             throws FieldDataInvalidException
Specified by:
setYear in interface Tag
Throws:
FieldDataInvalidException

add

public void add(TagField field)
         throws FieldDataInvalidException
Description copied from interface: Tag
Adds a tagfield to the structure.

It is not recommended to use this method for normal use of the audiolibrary. The developer will circumvent the underlying implementation. For example, if one adds a field with the field id "TALB" for an mp3 file, and the given TagField implementation does not return a text field compliant data with TagField.getRawContent() other software and the audio library won't read the file correctly, if they do read it at all.
So for short:

  • The field is stored withoud validation
  • No conversion of data is perfomed
  • Specified by:
    add in interface Tag
    Parameters:
    field -
    Throws:
    FieldDataInvalidException

    addAlbum

    public void addAlbum(java.lang.String album)
                  throws FieldDataInvalidException
    Adds an album to the tag.

    Specified by:
    addAlbum in interface Tag
    Parameters:
    album - Album description
    Throws:
    FieldDataInvalidException

    addArtist

    public void addArtist(java.lang.String artist)
                   throws FieldDataInvalidException
    Adds an artist to the tag.

    Specified by:
    addArtist in interface Tag
    Parameters:
    artist - Artist's name
    Throws:
    FieldDataInvalidException

    addComment

    public void addComment(java.lang.String comment)
                    throws FieldDataInvalidException
    Adds a comment to the tag.

    Specified by:
    addComment in interface Tag
    Parameters:
    comment - Comment.
    Throws:
    FieldDataInvalidException

    addGenre

    public void addGenre(java.lang.String genre)
                  throws FieldDataInvalidException
    Adds a genre to the tag.

    Specified by:
    addGenre in interface Tag
    Parameters:
    genre - Genre
    Throws:
    FieldDataInvalidException

    addTitle

    public void addTitle(java.lang.String title)
                  throws FieldDataInvalidException
    Adds a title to the tag.

    Specified by:
    addTitle in interface Tag
    Parameters:
    title - Title
    Throws:
    FieldDataInvalidException

    addTrack

    public void addTrack(java.lang.String track)
                  throws FieldDataInvalidException
    Adds a track to the tag.

    Specified by:
    addTrack in interface Tag
    Parameters:
    track - Track
    Throws:
    FieldDataInvalidException

    addYear

    public void addYear(java.lang.String year)
                 throws FieldDataInvalidException
    Adds a year to the Tag.

    Specified by:
    addYear in interface Tag
    Parameters:
    year - Year
    Throws:
    FieldDataInvalidException

    setFrame

    public void setFrame(java.lang.String identifier,
                         java.util.List<AbstractID3v2Frame> multiFrame)
    Used for setting multiple frames for a single frame Identifier

    Warning if frame(s) already exists for this identifier thay are overwritten

    TODO needs to ensure do not add an invalid frame for this tag


    getFrameCount

    public int getFrameCount()
    Return the number of frames in this tag of a particular type, multiple frames of the same time will only be counted once

    Returns:
    a count of different frames

    getFrameOfType

    public java.util.Iterator getFrameOfType(java.lang.String identifier)
    Return all frames which start with the identifier, this can be more than one which is useful if trying to retrieve similar frames e.g TIT1,TIT2,TIT3 ... and don't know exaclty which ones there are.

    Warning the match is only done against the identifier so if a tag contains a frame with an unsupported body but happens to have an identifier that is valid for another version of the tag it will be returned.

    Parameters:
    identifier -
    Returns:
    an iterator of all the frames starting with a particular identifier

    delete

    public void delete(java.io.RandomAccessFile file)
                throws java.io.IOException
    Delete Tag

    Specified by:
    delete in class AbstractTag
    Parameters:
    file - to delete the tag from
    Throws:
    java.io.IOException - if problem accessing the file


    equals

    public boolean equals(java.lang.Object obj)
    Is this tag equivalent to another

    Overrides:
    equals in class AbstractTag
    Parameters:
    obj - to test for equivalence
    Returns:
    true if they are equivalent

    iterator

    public java.util.Iterator iterator()
    Return the frames in the order they were added

    Specified by:
    iterator in class AbstractTag
    Returns:
    and iterator of the frmaes/list of multi value frames

    removeFrame

    public void removeFrame(java.lang.String identifier)
    Remove frame(s) with this identifier from tag

    Parameters:
    identifier - frameId to look for

    removeUnsupportedFrames

    public void removeUnsupportedFrames()
    Remove all frame(s) which have an unsupported body, in other words remove all frames that are not part of the standard frameset for this tag


    removeFrameOfType

    public void removeFrameOfType(java.lang.String identifier)
    Remove any frames starting with this identifier from tag

    Parameters:
    identifier - start of frameId to look for

    write

    public void write(java.io.File file,
                      long audioStartByte)
               throws java.io.IOException
    Write tag to file.

    Parameters:
    file -
    audioStartByte -
    Throws:
    java.io.IOException - TODO should be abstract

    write

    public void write(java.io.RandomAccessFile file)
               throws java.io.IOException
    Write tag to file.

    Specified by:
    write in class AbstractTag
    Parameters:
    file -
    Throws:
    java.io.IOException - TODO should be abstract

    write

    public void write(java.nio.channels.WritableByteChannel channel)
               throws java.io.IOException
    Write tag to channel.

    Parameters:
    channel -
    Throws:
    java.io.IOException - TODO should be abstract

    getV2TagSizeIfExists

    public static long getV2TagSizeIfExists(java.io.File file)
                                     throws java.io.IOException
    Checks to see if the file contains an ID3tag and if so return its size as reported in the tag header and return the size of the tag (including header), if no such tag exists return zero.

    Parameters:
    file -
    Returns:
    the end of the tag in the file or zero if no tag exists.
    Throws:
    java.io.IOException

    seek

    public boolean seek(java.nio.ByteBuffer byteBuffer)
    Does a tag of the correct version exist in this file.

    Specified by:
    seek in class AbstractTag
    Parameters:
    byteBuffer - to search through
    Returns:
    true if tag exists.

    adjustPadding

    public void adjustPadding(java.io.File file,
                              int paddingSize,
                              long audioStart)
                       throws java.io.FileNotFoundException,
                              java.io.IOException
    Adjust the length of the padding at the beginning of the MP3 file, this is only called when there is currently not enough space before the start of the audio to write the tag.

    A new file will be created with enough size to fit the ID3v2 tag. The old file will be deleted, and the new file renamed.

    Parameters:
    paddingSize - This is total size required to store tag before audio
    file - The file to adjust the padding length of
    Throws:
    java.io.FileNotFoundException - if the file exists but is a directory rather than a regular file or cannot be opened for any other reason
    java.io.IOException - on any I/O error

    getSize

    public int getSize()
    Return tag size based upon the sizes of the tags rather than the physical no of bytes between start of ID3Tag and start of Audio Data.Should be extended by subclasses to include header.

    Specified by:
    getSize in class AbstractTagItem
    Returns:
    size of the tag

    createStructure

    public void createStructure()

    createStructureHeader

    public void createStructureHeader()

    createStructureBody

    public void createStructureBody()

    get

    public java.util.List<TagField> get(java.lang.String id)
                                 throws KeyNotFoundException
    Retrieve the values that exists for this id3 frame id

    Specified by:
    get in interface Tag
    Parameters:
    id - The field id.
    Returns:
    A list of TagField objects with the given "id".
    Throws:
    KeyNotFoundException

    getAlbum

    public java.util.List getAlbum()
    Specified by:
    getAlbum in interface Tag
    Returns:

    getArtist

    public java.util.List getArtist()
    Specified by:
    getArtist in interface Tag
    Returns:

    getComment

    public java.util.List getComment()
    Specified by:
    getComment in interface Tag
    Returns:

    getGenre

    public java.util.List getGenre()
    Specified by:
    getGenre in interface Tag
    Returns:

    getTitle

    public java.util.List getTitle()
    Specified by:
    getTitle in interface Tag
    Returns:

    getTrack

    public java.util.List getTrack()
    Specified by:
    getTrack in interface Tag
    Returns:

    getYear

    public java.util.List getYear()
    Specified by:
    getYear in interface Tag
    Returns:

    getFirstAlbum

    public java.lang.String getFirstAlbum()
    Specified by:
    getFirstAlbum in interface Tag
    Returns:

    getFirstArtist

    public java.lang.String getFirstArtist()
    Specified by:
    getFirstArtist in interface Tag
    Returns:

    getFirstComment

    public java.lang.String getFirstComment()
    Specified by:
    getFirstComment in interface Tag
    Returns:

    getFirstGenre

    public java.lang.String getFirstGenre()
    Specified by:
    getFirstGenre in interface Tag
    Returns:

    getFirstTitle

    public java.lang.String getFirstTitle()
    Specified by:
    getFirstTitle in interface Tag
    Returns:

    getFirstTrack

    public java.lang.String getFirstTrack()
    Specified by:
    getFirstTrack in interface Tag
    Returns:

    getFirstYear

    public java.lang.String getFirstYear()
    Specified by:
    getFirstYear in interface Tag
    Returns:

    createFrame

    public abstract AbstractID3v2Frame createFrame(java.lang.String id)
    Create Frame of correct ID3 version with the specified id

    Parameters:
    id -
    Returns:

    createArtistField

    public TagField createArtistField(java.lang.String content)
    Parameters:
    content -
    Returns:

    createAlbumField

    public TagField createAlbumField(java.lang.String content)
    Parameters:
    content -
    Returns:

    createTitleField

    public TagField createTitleField(java.lang.String content)
    Parameters:
    content -
    Returns:

    createTrackField

    public TagField createTrackField(java.lang.String content)
    Parameters:
    content -
    Returns:

    createYearField

    public TagField createYearField(java.lang.String content)
    Parameters:
    content -
    Returns:

    createCommentField

    public TagField createCommentField(java.lang.String content)
    Parameters:
    content -
    Returns:

    createGenreField

    public TagField createGenreField(java.lang.String content)
    Parameters:
    content -
    Returns:

    hasCommonFields

    public boolean hasCommonFields()
    Description copied from interface: Tag
    Returns true, if at least one of the contained fields is a common field (TagField.isCommon()).

    Specified by:
    hasCommonFields in interface Tag
    Returns:
    true if a common field is present.

    hasField

    public boolean hasField(java.lang.String id)
    Does this tag contain a field with the specified id

    Specified by:
    hasField in interface Tag
    Parameters:
    id - The field id to look for.
    Returns:
    true if tag contains a TagField with the given id.
    See Also:
    Tag.hasField(java.lang.String)

    isEmpty

    public boolean isEmpty()
    Is this tag empty

    Specified by:
    isEmpty in interface Tag
    Returns:
    true if tag contains no field.
    See Also:
    Tag.isEmpty()

    getFields

    public java.util.Iterator getFields()
    Description copied from interface: Tag
    Iterator over all the fields within the tag, handle multiple fields with the same id

    Specified by:
    getFields in interface Tag
    Returns:
    iterator over whole list

    getFieldCount

    public int getFieldCount()
    Description copied from interface: Tag
    Return the number of fields

    Fields with the same identifiers are counted seperately i.e two title fields would contribute two to the count

    Specified by:
    getFieldCount in interface Tag
    Returns:
    total number of fields

    setEncoding

    public boolean setEncoding(java.lang.String enc)
                        throws FieldDataInvalidException
    Specified by:
    setEncoding in interface Tag
    Throws:
    FieldDataInvalidException

    getFirst

    public java.lang.String getFirst(TagFieldKey genericKey)
                              throws KeyNotFoundException
    Retrieve the first value that exists for this generic key

    Specified by:
    getFirst in interface Tag
    Parameters:
    genericKey -
    Returns:
    Throws:
    KeyNotFoundException

    createTagField

    public TagField createTagField(TagFieldKey genericKey,
                                   java.lang.String value)
                            throws KeyNotFoundException,
                                   FieldDataInvalidException
    Create a new TagField

    Only textual data supported at the moment. The genericKey will be mapped to the correct implementation key and return a TagField.

    Specified by:
    createTagField in interface Tag
    Parameters:
    genericKey - is the generic key
    value - to store
    Returns:
    Throws:
    KeyNotFoundException
    FieldDataInvalidException

    createLinkedArtworkField

    public TagField createLinkedArtworkField(java.lang.String url)
    Create a link to artwork, this is not recommended because the link may be broken if the mp3 or image file is moved

    Parameters:
    url - specifies the link, it could be a local file or could be a full url
    Returns:

    createArtworkField

    public TagField createArtworkField(byte[] data,
                                       java.lang.String mimeType)
    Create Artwork

    Parameters:
    data -
    mimeType - of the image
    See Also:
    PictureTypes

    deleteTagField

    public void deleteTagField(TagFieldKey genericKey)
                        throws KeyNotFoundException
    Delete fields with this generic key

    Specified by:
    deleteTagField in interface Tag
    Parameters:
    genericKey -
    Throws:
    KeyNotFoundException

    get

    public java.util.List<TagField> get(TagFieldKey genericKey)
                                 throws KeyNotFoundException
    Get field(s) for this key

    Specified by:
    get in interface Tag
    Parameters:
    genericKey -
    Returns:
    Throws:
    KeyNotFoundException