org.jaudiotagger.tag.id3.framebody
Class FrameBodyCOMM

java.lang.Object
  extended by org.jaudiotagger.tag.id3.AbstractTagItem
      extended by org.jaudiotagger.tag.id3.AbstractTagFrameBody
          extended by org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody
              extended by org.jaudiotagger.tag.id3.framebody.FrameBodyCOMM
All Implemented Interfaces:
ID3v23FrameBody, ID3v24FrameBody

public class FrameBodyCOMM
extends AbstractID3v2FrameBody
implements ID3v24FrameBody, ID3v23FrameBody

Comments frame.

This frame is indended for any kind of full text information that does not fit in any other frame. It consists of a frame header followed by encoding, language and content descriptors and is ended with the actual comment as a text string. Newline characters are allowed in the comment text string. There may be more than one comment frame in each tag, but only one with the same language and content descriptor.

<Header for 'Comment', ID: "COMM">
Text encoding $xx
Language $xx xx xx
Short content descrip.<text string according to encoding> $00 (00)
The actual text <full text string according to encoding>

For more details, please refer to the ID3 specifications:

Version:
$Id: FrameBodyCOMM.java,v 1.27 2009/11/12 15:42:56 paultaylor Exp $
Author:
: Paul Taylor, : Eric Farng

Field Summary
static java.lang.String DEFAULT
           
static java.lang.String ITUNES_NORMALIZATION
           
 
Fields inherited from class org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody
TYPE_BODY
 
Fields inherited from class org.jaudiotagger.tag.id3.AbstractTagFrameBody
objectList
 
Fields inherited from class org.jaudiotagger.tag.id3.AbstractTagItem
logger
 
Constructor Summary
FrameBodyCOMM()
          Creates a new FrameBodyCOMM datatype.
FrameBodyCOMM(java.nio.ByteBuffer byteBuffer, int frameSize)
          Construct a Comment frame body from the buffer
FrameBodyCOMM(byte textEncoding, java.lang.String language, java.lang.String description, java.lang.String text)
          Creates a new FrameBodyCOMM datatype.
FrameBodyCOMM(FrameBodyCOMM body)
           
 
Method Summary
 java.lang.String getDescription()
          Get the description field, which describes the type of comment
 java.lang.String getIdentifier()
          The ID3v2 frame identifier
 java.lang.String getLanguage()
          Get the language the comment is written in
 java.lang.String getText()
          Returns the the text field which holds the comment, adjusted to ensure does not return trailing null which is due to a iTunes bug.
 void setDescription(java.lang.String description)
          Set the description field, which describes the type of comment
 void setLanguage(java.lang.String language)
          Sets the language the comment is written in
 void setText(java.lang.String text)
           
protected  void setupObjectList()
          Create the list of Datatypes that this body expects in the correct order This method needs to be implemented by concrete subclasses
 void write(java.io.ByteArrayOutputStream tagBuffer)
          Because COMM have a text encoding we need to check the text String does not contain characters that cannot be encoded in current encoding before we write data.
 
Methods inherited from class org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody
createStructure, equals, getSize, read, setSize, setSize
 
Methods inherited from class org.jaudiotagger.tag.id3.AbstractTagFrameBody
getBriefDescription, getHeader, getLongDescription, getObject, getObjectValue, getTextEncoding, isSubsetOf, iterator, setHeader, setObjectValue, setTextEncoding, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT

public static final java.lang.String DEFAULT
See Also:
Constant Field Values

ITUNES_NORMALIZATION

public static final java.lang.String ITUNES_NORMALIZATION
See Also:
Constant Field Values
Constructor Detail

FrameBodyCOMM

public FrameBodyCOMM()
Creates a new FrameBodyCOMM datatype.


FrameBodyCOMM

public FrameBodyCOMM(FrameBodyCOMM body)

FrameBodyCOMM

public FrameBodyCOMM(byte textEncoding,
                     java.lang.String language,
                     java.lang.String description,
                     java.lang.String text)
Creates a new FrameBodyCOMM datatype.

Parameters:
textEncoding -
language -
description -
text -

FrameBodyCOMM

public FrameBodyCOMM(java.nio.ByteBuffer byteBuffer,
                     int frameSize)
              throws InvalidTagException
Construct a Comment frame body from the buffer

Parameters:
byteBuffer -
frameSize -
Throws:
InvalidTagException - if unable to create framebody from buffer
Method Detail

setDescription

public void setDescription(java.lang.String description)
Set the description field, which describes the type of comment

Parameters:
description -

getDescription

public java.lang.String getDescription()
Get the description field, which describes the type of comment

Returns:
description field

getIdentifier

public java.lang.String getIdentifier()
The ID3v2 frame identifier

Specified by:
getIdentifier in class AbstractID3v2FrameBody
Returns:
the ID3v2 frame identifier for this frame type

setLanguage

public void setLanguage(java.lang.String language)
Sets the language the comment is written in

Parameters:
language -

getLanguage

public java.lang.String getLanguage()
Get the language the comment is written in

Returns:
the language

setText

public void setText(java.lang.String text)
Parameters:
text -

getText

public java.lang.String getText()
Returns the the text field which holds the comment, adjusted to ensure does not return trailing null which is due to a iTunes bug.

Returns:
the text field

setupObjectList

protected void setupObjectList()
Description copied from class: AbstractTagFrameBody
Create the list of Datatypes that this body expects in the correct order This method needs to be implemented by concrete subclasses

Specified by:
setupObjectList in class AbstractTagFrameBody

write

public void write(java.io.ByteArrayOutputStream tagBuffer)
Because COMM have a text encoding we need to check the text String does not contain characters that cannot be encoded in current encoding before we write data. If there are we change the encoding.

Overrides:
write in class AbstractID3v2FrameBody