org.jaudiotagger.tag.mp4.field
Class Mp4TagReverseDnsField

java.lang.Object
  extended by org.jaudiotagger.tag.mp4.Mp4TagField
      extended by org.jaudiotagger.tag.mp4.field.Mp4TagReverseDnsField
All Implemented Interfaces:
TagField, TagTextField

public class Mp4TagReverseDnsField
extends Mp4TagField
implements TagTextField

Represents reverse dns field, used for custom information

Originally only used by Itunes for information that was iTunes specific but now used in a wide range of uses, for example Musicbrainz uses it for many of its fields.

These fields have a more complex setup Box ---- shows this is a reverse dns metadata field Box mean the issuer in the form of reverse DNS domain (e.g com.apple.iTunes) Box name descriptor identifying the type of contents Box data contents

The raw data passed starts from the mean box


Field Summary
protected  java.lang.String content
           
protected  int dataSize
           
private  java.lang.String descriptor
           
static java.lang.String IDENTIFIER
           
private  java.lang.String issuer
           
 
Fields inherited from class org.jaudiotagger.tag.mp4.Mp4TagField
id, logger, parentHeader
 
Constructor Summary
Mp4TagReverseDnsField(Mp4BoxHeader parentHeader, java.nio.ByteBuffer data)
          Construct from existing file data
Mp4TagReverseDnsField(Mp4FieldKey id, java.lang.String content)
          Newly created Reverse Dns field
Mp4TagReverseDnsField(java.lang.String fieldName, java.lang.String issuer, java.lang.String identifier, java.lang.String content)
          Newly created Reverse Dns field bypassing the Mp4TagField enum for creation of temporary reverse dns fields
 
Method Summary
protected  void build(java.nio.ByteBuffer data)
          Processes the data and sets the position of the data buffer to just after the end of this fields data ready for processing next field.
 void copyContent(TagField field)
          This method copies the data of the given field to the current data.
 java.lang.String getContent()
          Returns the content of the field.
protected  byte[] getDataBytes()
           
 java.lang.String getDescriptor()
           
 java.lang.String getEncoding()
          Returns the current used charset encoding.
 Mp4FieldType getFieldType()
           
 java.lang.String getIssuer()
           
 byte[] getRawContent()
          Convert back to raw content, includes ----,mean,name and data atom as views as one thing externally
 byte[] getRawContentDataOnly()
          Get raw content for the data component only
 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.
 boolean isEmpty()
          Determines whether the content of the field is empty.
 void setContent(java.lang.String s)
          Sets the content of the field.
 void setDescriptor(java.lang.String descriptor)
          Set the descriptor for the data (what type of data it is)
 void setEncoding(java.lang.String s)
          Sets the charset encoding used by the field.
 void setIssuer(java.lang.String issuer)
          Set the issuer, usually reverse dns of the Companies domain
 java.lang.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 org.jaudiotagger.tag.mp4.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 org.jaudiotagger.tag.TagField
getId, isBinary, isCommon
 

Field Detail

IDENTIFIER

public static final java.lang.String IDENTIFIER
See Also:
Constant Field Values

dataSize

protected int dataSize

issuer

private java.lang.String issuer

descriptor

private java.lang.String descriptor

content

protected java.lang.String content
Constructor Detail

Mp4TagReverseDnsField

public Mp4TagReverseDnsField(Mp4BoxHeader parentHeader,
                             java.nio.ByteBuffer data)
                      throws java.io.UnsupportedEncodingException
Construct from existing file data

Parameters:
parentHeader -
data -
Throws:
java.io.UnsupportedEncodingException

Mp4TagReverseDnsField

public Mp4TagReverseDnsField(Mp4FieldKey id,
                             java.lang.String content)
Newly created Reverse Dns field

Parameters:
id -
content -

Mp4TagReverseDnsField

public Mp4TagReverseDnsField(java.lang.String fieldName,
                             java.lang.String issuer,
                             java.lang.String identifier,
                             java.lang.String content)
Newly created Reverse Dns field bypassing the Mp4TagField enum for creation of temporary reverse dns fields

Parameters:
fieldName -
issuer -
identifier -
content -
Method Detail

getFieldType

public Mp4FieldType getFieldType()
Specified by:
getFieldType in class Mp4TagField
Returns:
the field type of this field

build

protected void build(java.nio.ByteBuffer data)
              throws java.io.UnsupportedEncodingException
Description copied from class: Mp4TagField
Processes the data and sets the position of the data buffer to just after the end of this fields data ready for processing next field.

Specified by:
build in class Mp4TagField
Throws:
java.io.UnsupportedEncodingException

copyContent

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

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

getContent

public java.lang.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 java.io.UnsupportedEncodingException
Specified by:
getDataBytes in class Mp4TagField
Returns:
the data as it is held on file
Throws:
java.io.UnsupportedEncodingException

getEncoding

public java.lang.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 java.io.UnsupportedEncodingException
Convert back to raw content, includes ----,mean,name and data atom as views as one thing externally

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

getRawContentDataOnly

public byte[] getRawContentDataOnly()
                             throws java.io.UnsupportedEncodingException
Description copied from class: Mp4TagField
Get raw content for the data component only

Overrides:
getRawContentDataOnly in class Mp4TagField
Returns:
Throws:
java.io.UnsupportedEncodingException

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 method 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(java.lang.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(java.lang.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 java.lang.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 java.lang.Object
Returns:
Description of the fields content.

getIssuer

public java.lang.String getIssuer()
Returns:
the issuer

getDescriptor

public java.lang.String getDescriptor()
Returns:
the descriptor

setIssuer

public void setIssuer(java.lang.String issuer)
Set the issuer, usually reverse dns of the Companies domain

Parameters:
issuer -

setDescriptor

public void setDescriptor(java.lang.String descriptor)
Set the descriptor for the data (what type of data it is)

Parameters:
descriptor -