org.jaudiotagger.tag.id3.framebody
Class AbstractFrameBodyTextInfo
java.lang.Object
org.jaudiotagger.tag.id3.AbstractTagItem
org.jaudiotagger.tag.id3.AbstractTagFrameBody
org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody
org.jaudiotagger.tag.id3.framebody.AbstractFrameBodyTextInfo
- Direct Known Subclasses:
- FrameBodyTALB, FrameBodyTBPM, FrameBodyTCMP, FrameBodyTCOM, FrameBodyTCON, FrameBodyTCOP, FrameBodyTDAT, FrameBodyTDEN, FrameBodyTDLY, FrameBodyTDOR, FrameBodyTDRC, FrameBodyTDRL, FrameBodyTDTG, FrameBodyTENC, FrameBodyTEXT, FrameBodyTFLT, FrameBodyTIME, FrameBodyTIPL, FrameBodyTIT1, FrameBodyTIT2, FrameBodyTIT3, FrameBodyTKEY, FrameBodyTLAN, FrameBodyTLEN, FrameBodyTMCL, FrameBodyTMED, FrameBodyTMOO, FrameBodyTOAL, FrameBodyTOFN, FrameBodyTOLY, FrameBodyTOPE, FrameBodyTORY, FrameBodyTOWN, FrameBodyTPE1, FrameBodyTPE2, FrameBodyTPE3, FrameBodyTPE4, FrameBodyTPOS, FrameBodyTPRO, FrameBodyTPUB, FrameBodyTRCK, FrameBodyTRDA, FrameBodyTRSN, FrameBodyTRSO, FrameBodyTSIZ, FrameBodyTSO2, FrameBodyTSOA, FrameBodyTSOC, FrameBodyTSOP, FrameBodyTSOT, FrameBodyTSRC, FrameBodyTSSE, FrameBodyTSST, FrameBodyTXXX, FrameBodyTYER, FrameBodyXSOA, FrameBodyXSOP, FrameBodyXSOT
public abstract class AbstractFrameBodyTextInfo
- extends AbstractID3v2FrameBody
Abstract representation of a Text Frame
The text information frames are often the most important frames, containing information like artist, album and
more. There may only be one text information frame of its kind in an tag. In ID3v24 All text information frames
supports multiple strings, stored as a null separated list, where null is represented by the termination code
for the character encoding. All text frame identifiers begin with "T". Only text frame identifiers begin with "T",
with the exception of the "TXXX" frame. All the text information frames have the following format:
Text encoding $xx
Information
The list of valid text encodings increaded from two in ID3v23 to four in ID3v24
iTunes incorrectly writes null terminators at the end of every String, even though it only writes one String.
You can retrieve the first value without the null terminator using getFirstTextValue()
Method Summary |
void |
addTextValue(java.lang.String value)
Add additional value to value |
java.lang.String |
getFirstTextValue()
Get first value |
int |
getNumberOfValues()
|
java.lang.String |
getText()
Retrieve the complete Text String. |
java.lang.String |
getValueAtIndex(int index)
Get value at index |
void |
setText(java.lang.String text)
Set the Full Text String. |
void |
write(java.io.ByteArrayOutputStream tagBuffer)
Because Text frames 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.AbstractTagFrameBody |
getBriefDescription, getHeader, getLongDescription, getObject, getObjectValue, getTextEncoding, isSubsetOf, iterator, setHeader, setObjectValue, setTextEncoding, toString |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
setText
public void setText(java.lang.String text)
- Set the Full Text String.
If this String contains null terminator characters these are parsed as value
seperators, allowing you to hold multiple strings within one text frame. This functionality is only
officially support in ID3v24.
- Parameters:
text
- to set
getText
public java.lang.String getText()
- Retrieve the complete Text String.
- Returns:
- the text string
getFirstTextValue
public java.lang.String getFirstTextValue()
- Get first value
- Returns:
- value at index 0
getValueAtIndex
public java.lang.String getValueAtIndex(int index)
- Get value at index
- Parameters:
index
-
- Returns:
- value at index
addTextValue
public void addTextValue(java.lang.String value)
- Add additional value to value
- Parameters:
value
- at index
getNumberOfValues
public int getNumberOfValues()
- Returns:
- number of text values, usually one
write
public void write(java.io.ByteArrayOutputStream tagBuffer)
- Because Text frames 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 change the text
encoding.
- Overrides:
write
in class AbstractID3v2FrameBody