FileDocCategorySizeDatePackage
Mp4TagTextField.javaAPI DocJaudiotagger 2.0.44053Wed Mar 30 16:12:10 BST 2011org.jaudiotagger.tag.mp4.field

Mp4TagTextField

public class Mp4TagTextField extends org.jaudiotagger.tag.mp4.Mp4TagField implements org.jaudiotagger.tag.TagTextField
Represents a single text field

Mp4 metadata normally held as follows:

MP4Box Parent contains
:length (includes length of data child) (4 bytes)
:name (4 bytes)
:child with
:length (4 bytes)
:name 'Data' (4 bytes)
:atom version (1 byte)
:atom type flags (3 bytes)
:null field (4 bytes)
:data

Note:This class is initilized with the child data atom only, the parent data has already been processed, this may change as it seems that code should probably be enscapulated into this. Whereas the raw content returned by the getRawContent() contais the byte data for parent and child.

Fields Summary
protected int
dataSize
protected String
content
Constructors Summary
public Mp4TagTextField(String id, ByteBuffer data)
Construct from File

param
id parent id
param
data atom data
throws
UnsupportedEncodingException

        super(id, data);
    
public Mp4TagTextField(String id, String content)
Construct new Field

param
id parent id
param
content data atom data

        super(id);
        this.content = content;
    
Methods Summary
protected voidbuild(java.nio.ByteBuffer data)

        //Data actually contains a 'Data' Box so process data using this
        Mp4BoxHeader header = new Mp4BoxHeader(data);
        Mp4DataBox databox = new Mp4DataBox(header, data);
        dataSize = header.getDataLength();
        content = databox.getContent();
    
public voidcopyContent(org.jaudiotagger.tag.TagField field)

        if (field instanceof Mp4TagTextField)
        {
            this.content = ((Mp4TagTextField) field).getContent();
        }
    
public java.lang.StringgetContent()

        return content;
    
protected byte[]getDataBytes()

        return content.getBytes(getEncoding());
    
public java.lang.StringgetEncoding()

        return Mp4BoxHeader.CHARSET_UTF_8;
    
public Mp4FieldTypegetFieldType()

        return Mp4FieldType.TEXT;
    
public booleanisBinary()

        return false;
    
public booleanisEmpty()

        return this.content.trim().equals("");
    
public voidsetContent(java.lang.String s)

        this.content = s;
    
public voidsetEncoding(java.lang.String s)

        /* Not allowed */
    
public java.lang.StringtoString()

        return content;