org.jaudiotagger.tag.mp4
Class Mp4TagField

java.lang.Object
  extended by org.jaudiotagger.tag.mp4.Mp4TagField
All Implemented Interfaces:
TagField
Direct Known Subclasses:
Mp4TagBinaryField, Mp4TagRawBinaryField, Mp4TagReverseDnsField, Mp4TagTextField

public abstract class Mp4TagField
extends java.lang.Object
implements TagField

This abstract class represents a link between piece of data, and how it is stored as an mp4 atom

Note there isnt a one to one correspondance between a tag field and a box because some fields are represented by multiple boxes, for example many of the MusicBrainz fields use the '----' box, which in turn uses one of mean, name and data box. So an instance of a tag field maps to one item of data such as 'Title', but it may have to read multiple boxes to do this.

There are various subclasses that represent different types of fields


Field Summary
static java.util.logging.Logger logger
           
 
Method Summary
abstract  Mp4FieldType getFieldType()
           
 java.lang.String getId()
          Returns the Id of the represented tag field.
This value should uniquely identify a kind of tag data, like title.
 byte[] getRawContent()
          Convert back to raw content, includes parent and data atom as views as one thing externally
 byte[] getRawContentDataOnly()
          Get raw content for the data component only
 void isBinary(boolean b)
          This method will set the field to represent binary data.
Some implementations may support conversions.
As of now (Octobre 2005) there is no implementation really using this method to perform useful operations.
 boolean isCommon()
          Identifies a field to be of common use.
Some software may differ between common and not common fields.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jaudiotagger.tag.TagField
copyContent, isBinary, isEmpty, toString
 

Field Detail

logger

public static java.util.logging.Logger logger
Method Detail

getId

public java.lang.String getId()
Description copied from interface: TagField
Returns the Id of the represented tag field.
This value should uniquely identify a kind of tag data, like title. AbstractTag will use the "id" to summarize multiple fields.

Specified by:
getId in interface TagField
Returns:
field identifier

isBinary

public void isBinary(boolean b)
Description copied from interface: TagField
This method will set the field to represent binary data.
Some implementations may support conversions.
As of now (Octobre 2005) there is no implementation really using this method to perform useful operations.

Specified by:
isBinary in interface TagField
Parameters:
b - true, if the field contains binary data.

isCommon

public boolean isCommon()
Description copied from interface: TagField
Identifies a field to be of common use.
Some software may differ between common and not common fields. A common one is for sure the title field. A web link may not be of common use for tagging. However some file formats, or future development of users expectations will make more fields common than now can be known.

Specified by:
isCommon in interface TagField
Returns:
true if the field is of common use.

getFieldType

public abstract Mp4FieldType getFieldType()
Returns:
the field type of this field

getRawContent

public byte[] getRawContent()
                     throws java.io.UnsupportedEncodingException
Convert back to raw content, includes parent and data atom as views as one thing externally

Specified by:
getRawContent in interface TagField
Returns:
Throws:
java.io.UnsupportedEncodingException

getRawContentDataOnly

public byte[] getRawContentDataOnly()
                             throws java.io.UnsupportedEncodingException
Get raw content for the data component only

Returns:
Throws:
java.io.UnsupportedEncodingException