entagged.audioformats.mp4.util
Class Mp4TagTextField

java.lang.Object
  extended by entagged.audioformats.mp4.util.Mp4TagField
      extended by entagged.audioformats.mp4.util.Mp4TagTextField
All Implemented Interfaces:
TagField, TagTextField
Direct Known Subclasses:
Mp4TagTextNumberField

public class Mp4TagTextField
extends Mp4TagField
implements TagTextField


Field Summary
protected  String content
           
 
Fields inherited from class entagged.audioformats.mp4.util.Mp4TagField
id
 
Constructor Summary
Mp4TagTextField(String id, byte[] raw)
           
Mp4TagTextField(String id, String content)
           
 
Method Summary
protected  void build(byte[] raw)
           
 void copyContent(TagField field)
          This method copies the data of the given filed to the current data.
 String getContent()
          Returns the content of the field.
protected  byte[] getDataBytes()
           
 String getEncoding()
          Returns the current used charset encoding.
 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 mehtod returns false.
 boolean isEmpty()
          Determines whether the content of the field is empty.
 void setContent(String s)
          Sets the content of the field.
 void setEncoding(String s)
          Sets the charset encoding used by the field.
 String toString()
          This method returns a human readable description of the fields contents.
For text fields it should be the text itself.
 
Methods inherited from class entagged.audioformats.mp4.util.Mp4TagField
getId, getIdBytes, isBinary, isCommon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface entagged.audioformats.generic.TagField
getId, isBinary, isCommon
 

Field Detail

content

protected String content
Constructor Detail

Mp4TagTextField

public Mp4TagTextField(String id,
                       byte[] raw)
                throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

Mp4TagTextField

public Mp4TagTextField(String id,
                       String content)
Method Detail

build

protected void build(byte[] raw)
              throws UnsupportedEncodingException
Specified by:
build in class Mp4TagField
Throws:
UnsupportedEncodingException

copyContent

public void copyContent(TagField field)
Description copied from interface: TagField
This method copies the data of the given filed to the current data.

Specified by:
copyContent in interface TagField
Parameters:
field - The field containing the data to be taken.

getContent

public String getContent()
Description copied from interface: TagTextField
Returns the content of the field.

Specified by:
getContent in interface TagTextField
Returns:
Content

getDataBytes

protected byte[] getDataBytes()
                       throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

getEncoding

public String getEncoding()
Description copied from interface: TagTextField
Returns the current used charset encoding.

Specified by:
getEncoding in interface TagTextField
Returns:
Charset encoding.

getRawContent

public byte[] getRawContent()
                     throws UnsupportedEncodingException
Description copied from interface: TagField
This method delivers the binary representation of the fields data in order to be directly written to the file.

Specified by:
getRawContent in interface TagField
Returns:
Binary data representing the current tag field.
Throws:
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

public boolean isBinary()
Description copied from interface: TagField
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 mehtod returns false.

Specified by:
isBinary in interface TagField
Returns:
true if field represents binary data (not human readable).

isEmpty

public boolean isEmpty()
Description copied from interface: TagField
Determines whether the content of the field is empty.

Specified by:
isEmpty in interface TagField
Returns:
true if no data is stored (or empty String).

setContent

public void setContent(String s)
Description copied from interface: TagTextField
Sets the content of the field.

Specified by:
setContent in interface TagTextField
Parameters:
s - fields content.

setEncoding

public void setEncoding(String s)
Description copied from interface: TagTextField
Sets the charset encoding used by the field.

Specified by:
setEncoding in interface TagTextField
Parameters:
s - charset.

toString

public String toString()
Description copied from interface: TagField
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.

Specified by:
toString in interface TagField
Overrides:
toString in class Object
Returns:
Description of the fields content.


Copyright © 2007-2008. All Rights Reserved.