entagged.audioformats.mp3
Class Id3v2Tag

java.lang.Object
  extended by entagged.audioformats.generic.AbstractTag
      extended by entagged.audioformats.mp3.Id3v2Tag
All Implemented Interfaces:
Tag

public class Id3v2Tag
extends AbstractTag

This class is the implementation of Tag of the ID3V2 tagging system used with MP3s.

Author:
Rapha?l Slinckx , Christian Laireiter

Field Summary
static String DEFAULT_ENCODING
          This is the default encoding to use for new frames.
The code indirectly will choose the UTF-16LE variant with BOM.
static byte ID3V22
          This constant is used to identify the minor version 2 of the ID3V2 tag.
static byte ID3V23
          This constant is used to identify the minor version 3 of the ID3V2 tag.
static byte ID3V24
          This constant is used to identify the minor version 4 of the ID3V2 tag.
 
Fields inherited from class entagged.audioformats.generic.AbstractTag
commonNumber, fields
 
Fields inherited from interface entagged.audioformats.Tag
DEFAULT_GENRES
 
Constructor Summary
Id3v2Tag()
          Creates a default instance.
Id3v2Tag(byte version)
          Creates an instance.
 
Method Summary
protected  TagField createAlbumField(String content)
          (overridden)
protected  TagField createArtistField(String content)
          (overridden)
protected  TagField createCommentField(String content)
          (overridden)
protected  TagField createGenreField(String content)
          (overridden)
protected  TagField createTitleField(String content)
          (overridden)
protected  TagField createTrackField(String content)
          (overridden)
protected  TagField createYearField(String content)
          (overridden)
protected  String getAlbumId()
          (overridden) Returns the frame id (name) for the album frame
protected  String getArtistId()
          (overridden) Returns the frame id (name) for the artist frame
 List getComment()
          (overridden)
protected  String getCommentId()
          (overridden) Returns the frame id (name) for the comment frame
protected  String getGenreId()
          (overridden) Returns the frame id (name) for the genre frame
 byte getRepresentedVersion()
          Returns the Id3v2 minor version identifier, the tag represents.
Values are ID3V22, ID3V23 and ID3V24.
protected  String getTitleId()
          (overridden) Returns the frame id (name) for the title frame
protected  String getTrackId()
          (overridden) Returns the frame id (name) for the track frame
protected  String getYearId()
          (overridden) Returns the frame id (name) for the year frame
 boolean hasId3v1()
          Determines whether the values of a parallel stored ID3V1 tag are merged whithin this object.
In fact no value may have made it into this, but there is an ID3V1 tag present in the original file.
protected  void hasId3v1(boolean b)
          This method sets the ID3V1 tag present property.
protected  boolean isAllowedEncoding(String enc)
          (overridden)
protected  void setRepresentedVersion(byte representedVersion)
           
 String toString()
          (overridden)
 
Methods inherited from class entagged.audioformats.generic.AbstractTag
add, addAlbum, addArtist, addComment, addGenre, addTitle, addTrack, addYear, get, getAlbum, getArtist, getFields, getFirstAlbum, getFirstArtist, getFirstComment, getFirstGenre, getFirstTitle, getFirstTrack, getFirstYear, getGenre, getTitle, getTrack, getYear, hasCommonFields, hasField, isEmpty, merge, set, setAlbum, setArtist, setComment, setEncoding, setGenre, setTitle, setTrack, setYear
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_ENCODING

public static String DEFAULT_ENCODING
This is the default encoding to use for new frames.
The code indirectly will choose the UTF-16LE variant with BOM.


ID3V22

public static byte ID3V22
This constant is used to identify the minor version 2 of the ID3V2 tag.


ID3V23

public static byte ID3V23
This constant is used to identify the minor version 3 of the ID3V2 tag.


ID3V24

public static byte ID3V24
This constant is used to identify the minor version 4 of the ID3V2 tag.

Constructor Detail

Id3v2Tag

public Id3v2Tag()
Creates a default instance.
Tag version is ID3V22.


Id3v2Tag

public Id3v2Tag(byte version)
Creates an instance.

Parameters:
version - The version to represent. representedVersion.
Method Detail

createAlbumField

protected TagField createAlbumField(String content)
(overridden)

Specified by:
createAlbumField in class AbstractTag
Parameters:
content - The content of the created field.
Returns:
tagfield representing the "album"
See Also:
AbstractTag.createAlbumField(java.lang.String)

createArtistField

protected TagField createArtistField(String content)
(overridden)

Specified by:
createArtistField in class AbstractTag
Parameters:
content - The content of the created field.
Returns:
tagfield representing the "artist"
See Also:
AbstractTag.createArtistField(java.lang.String)

createCommentField

protected TagField createCommentField(String content)
(overridden)

Specified by:
createCommentField in class AbstractTag
Parameters:
content - The content of the created field.
Returns:
tagfield representing the "comment"
See Also:
AbstractTag.createCommentField(java.lang.String)

createGenreField

protected TagField createGenreField(String content)
(overridden)

Specified by:
createGenreField in class AbstractTag
Parameters:
content - The content of the created field.
Returns:
tagfield representing the "genre"
See Also:
AbstractTag.createGenreField(java.lang.String)

createTitleField

protected TagField createTitleField(String content)
(overridden)

Specified by:
createTitleField in class AbstractTag
Parameters:
content - The content of the created field.
Returns:
tagfield representing the "title"
See Also:
AbstractTag.createTitleField(java.lang.String)

createTrackField

protected TagField createTrackField(String content)
(overridden)

Specified by:
createTrackField in class AbstractTag
Parameters:
content - The content of the created field.
Returns:
tagfield representing the "track"
See Also:
AbstractTag.createTrackField(java.lang.String)

createYearField

protected TagField createYearField(String content)
(overridden)

Specified by:
createYearField in class AbstractTag
Parameters:
content - The content of the created field.
Returns:
tagfield representing the "year"
See Also:
AbstractTag.createYearField(java.lang.String)

getAlbumId

protected String getAlbumId()
(overridden) Returns the frame id (name) for the album frame

Specified by:
getAlbumId in class AbstractTag
Returns:
identifier for the "album" field.
See Also:
AbstractTag.getAlbumId()

getArtistId

protected String getArtistId()
(overridden) Returns the frame id (name) for the artist frame

Specified by:
getArtistId in class AbstractTag
Returns:
identifier for the "artist" field.
See Also:
AbstractTag.getArtistId()

getComment

public List getComment()
(overridden)

Specified by:
getComment in interface Tag
Overrides:
getComment in class AbstractTag
See Also:
AbstractTag.getComment()

getCommentId

protected String getCommentId()
(overridden) Returns the frame id (name) for the comment frame

Specified by:
getCommentId in class AbstractTag
Returns:
identifier for the "comment" field.
See Also:
AbstractTag.getCommentId()

getGenreId

protected String getGenreId()
(overridden) Returns the frame id (name) for the genre frame

Specified by:
getGenreId in class AbstractTag
Returns:
identifier for the "genre" field.
See Also:
AbstractTag.getGenreId()

getRepresentedVersion

public byte getRepresentedVersion()
Returns the Id3v2 minor version identifier, the tag represents.
Values are ID3V22, ID3V23 and ID3V24.

Returns:
Returns the Id3v2 version identifier of mp3 library part.

getTitleId

protected String getTitleId()
(overridden) Returns the frame id (name) for the title frame

Specified by:
getTitleId in class AbstractTag
Returns:
identifier for the "title" field.
See Also:
AbstractTag.getTitleId()

getTrackId

protected String getTrackId()
(overridden) Returns the frame id (name) for the track frame

Specified by:
getTrackId in class AbstractTag
Returns:
identifier for the "track" field.
See Also:
AbstractTag.getTrackId()

getYearId

protected String getYearId()
(overridden) Returns the frame id (name) for the year frame

Specified by:
getYearId in class AbstractTag
Returns:
identifier for the "year" field.
See Also:
AbstractTag.getYearId()

hasId3v1

public boolean hasId3v1()
Determines whether the values of a parallel stored ID3V1 tag are merged whithin this object.
In fact no value may have made it into this, but there is an ID3V1 tag present in the original file.

Returns:
true if there was a ID3V1 tag present.

hasId3v1

protected void hasId3v1(boolean b)
This method sets the ID3V1 tag present property.

Parameters:
b - the value to set.
See Also:
hasId3v1()

isAllowedEncoding

protected boolean isAllowedEncoding(String enc)
(overridden)

Specified by:
isAllowedEncoding in class AbstractTag
Parameters:
enc - charset encoding.
Returns:
true if the given encoding can be used.
See Also:
AbstractTag.isAllowedEncoding(java.lang.String)

toString

public String toString()
(overridden)

Specified by:
toString in interface Tag
Overrides:
toString in class AbstractTag
See Also:
Object.toString()

setRepresentedVersion

protected void setRepresentedVersion(byte representedVersion)
Parameters:
representedVersion - The representedVersion to set.


Copyright © 2007-2008. All Rights Reserved.