org.jaudiotagger.tag
Interface TagField

All Known Subinterfaces:
TagTextField
All Known Implementing Classes:
AbstractAsfTagImageField, AbstractID3v2Frame, AsfTagBannerField, AsfTagCoverField, AsfTagField, AsfTagTextField, GenericTag.GenericTagTextField, ID3v1TagField, ID3v22Frame, ID3v23Frame, ID3v24Frame, MetadataBlockDataPicture, Mp4DiscNoField, Mp4GenreField, Mp4TagBinaryField, Mp4TagByteField, Mp4TagCoverField, Mp4TagField, Mp4TagRawBinaryField, Mp4TagReverseDnsField, Mp4TagTextField, Mp4TagTextNumberField, Mp4TrackField, VorbisCommentTagField

public interface TagField

Implementing classes represent a tag field for the entagged audio library.
Very basic functionality is defined for use with Tag.

Author:
Rapha�l Slinckx

Method Summary
 void copyContent(TagField field)
          This method copies the data of the given field to the current data.
 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()
          This method delivers the binary representation of the fields data in order to be directly written to the file.
 boolean isBinary()
          Determines whether the represented field contains (is made up of) binary data, instead of text data.
Software can identify fields to be displayed because they are human readable if this method returns false.
 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.

 boolean isEmpty()
          Determines whether the content of the field is empty.
 java.lang.String toString()
          This method returns a human readable description of the fields contents.
For text fields it should be the text itself.
 

Method Detail

copyContent

void copyContent(TagField field)
This method copies the data of the given field to the current data.

Parameters:
field - The field containing the data to be taken.

getId

java.lang.String getId()
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.

Returns:
Unique identifier for the fields type. (title, artist...)

getRawContent

byte[] getRawContent()
                     throws java.io.UnsupportedEncodingException
This method delivers the binary representation of the fields data in order to be directly written to the file.

Returns:
Binary data representing the current tag field.
Throws:
java.io.UnsupportedEncodingException - Most tag data represents text. In some cases the underlying implementation will need to convert the text data in java to a specific charset encoding. In these cases an UnsupportedEncodingException may occur.

isBinary

boolean isBinary()
Determines whether the represented field contains (is made up of) binary data, instead of text data.
Software can identify fields to be displayed because they are human readable if this method returns false.

Returns:
true if field represents binary data (not human readable).

isBinary

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.

Parameters:
b - true, if the field contains binary data. //@deprecated As for now is of no use. Implementations should use another // way of setting this property.

isCommon

boolean isCommon()
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.

Returns:
true if the field is of common use.

isEmpty

boolean isEmpty()
Determines whether the content of the field is empty.

Returns:
true if no data is stored (or empty String).

toString

java.lang.String toString()
This method returns a human readable description of the fields contents.
For text fields it should be the text itself. Other fields containing images may return a formatted string with image properties like width, height and so on.

Overrides:
toString in class java.lang.Object
Returns:
Description of the fields content.