org.blinkenlights.jid3.v2
Class ID3V2Frame

java.lang.Object
  extended byorg.blinkenlights.jid3.v2.ID3V2Frame
All Implemented Interfaces:
ID3Subject, ID3Visitable
Direct Known Subclasses:
AENCID3V2Frame, APICID3V2Frame, COMMID3V2Frame, COMRID3V2Frame, ENCRID3V2Frame, EncryptedID3V2Frame, EQUAID3V2Frame, ETCOID3V2Frame, GEOBID3V2Frame, GRIDID3V2Frame, IPLSID3V2Frame, LINKID3V2Frame, MCDIID3V2Frame, MLLTID3V2Frame, OWNEID3V2Frame, PCNTID3V2Frame, POPMID3V2Frame, POSSID3V2Frame, PRIVID3V2Frame, RBUFID3V2Frame, RVADID3V2Frame, RVRBID3V2Frame, SYLTID3V2Frame, SYTCID3V2Frame, org.blinkenlights.jid3.v2.TextInformationID3V2Frame, UFIDID3V2Frame, UnknownID3V2Frame, UrlLinkID3V2Frame, USERID3V2Frame, USLTID3V2Frame

public abstract class ID3V2Frame
extends java.lang.Object
implements ID3Subject, ID3Visitable


Constructor Summary
ID3V2Frame()
           
 
Method Summary
 void addID3Observer(ID3Observer oID3Observer)
           
 byte getEncryptionMethod()
          Get the encryption method symbol used to encrypt this frame.
protected abstract  byte[] getFrameId()
          Get the four bytes which uniquely specify of which type this frame is.
 boolean isEncrypted()
          Check whether this frame is encrypted.
 void notifyID3Observers()
           
 void removeID3Observer(ID3Observer oID3Observer)
           
 void setCompressionFlag(boolean bCompressionFlagValue)
          Specify whether this frame is compressed or not.
 void setEncryption(byte byEncryptionMethod)
          Set encryption method for this frame.
 void setFileAlterPreservationFlag(boolean bFileAlterPreservationFlagValue)
          Specify what should happen to this frame, if this file (other than the tag) is modified by a program which does not recognize it.
 void setGroupingIdentityFlag(boolean bGroupingIdentityFlagValue)
          Specify whether this frame belongs to a group of other frames or not.
 void setReadOnlyFlag(boolean bReadOnlyFlagValue)
          Specify whether this frame should be considered read only or not.
 void setTagAlterPreservationFlag(boolean bTagAlterPreservationFlagValue)
          Specify what should happen to this frame, if the tag it is in is modified by another program which does not recognize it.
abstract  java.lang.String toString()
          Represent the contents of this frame as a string.
 void write(java.io.OutputStream oOS)
          Write this frame to an output stream.
protected abstract  void writeBody(ID3DataOutputStream oIDOS)
          Write the body of the frame to an ID3 data output stream.
protected  void writeHeader(java.io.OutputStream oOS)
          Write the header of this frame to an output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.blinkenlights.jid3.util.ID3Visitable
accept
 

Constructor Detail

ID3V2Frame

public ID3V2Frame()
Method Detail

addID3Observer

public void addID3Observer(ID3Observer oID3Observer)
Specified by:
addID3Observer in interface ID3Subject

removeID3Observer

public void removeID3Observer(ID3Observer oID3Observer)
Specified by:
removeID3Observer in interface ID3Subject

notifyID3Observers

public void notifyID3Observers()
                        throws ID3Exception
Specified by:
notifyID3Observers in interface ID3Subject
Throws:
ID3Exception

setTagAlterPreservationFlag

public void setTagAlterPreservationFlag(boolean bTagAlterPreservationFlagValue)
Specify what should happen to this frame, if the tag it is in is modified by another program which does not recognize it. If set to true, then this frame should be discarded by a program which does not recognize it. If set to false, it should be left as is.

Parameters:
bTagAlterPreservationFlagValue - the state this flag should be set to

setFileAlterPreservationFlag

public void setFileAlterPreservationFlag(boolean bFileAlterPreservationFlagValue)
Specify what should happen to this frame, if this file (other than the tag) is modified by a program which does not recognize it. If set to true, then this frame should be discarded. If set to false, then the frame should be preserved as is.

Parameters:
bFileAlterPreservationFlagValue - the state this flag should be set to

setReadOnlyFlag

public void setReadOnlyFlag(boolean bReadOnlyFlagValue)
Specify whether this frame should be considered read only or not.

Parameters:
bReadOnlyFlagValue - the state this flag should be set to

setCompressionFlag

public void setCompressionFlag(boolean bCompressionFlagValue)
Specify whether this frame is compressed or not. The compression method used is zlib.

Parameters:
bCompressionFlagValue - the state this flag should be set to

setEncryption

public void setEncryption(byte byEncryptionMethod)
                   throws ID3Exception
Set encryption method for this frame. When an encryption method is specified, the frame will be encrypted before being written to a file.

Parameters:
byEncryptionMethod - the encryption method value to use (this value must match a method specified in an ENCR frame in this tag)
Throws:
ID3Exception

isEncrypted

public boolean isEncrypted()
Check whether this frame is encrypted.

Returns:
true if the frame is encrypted, false otherwise

getEncryptionMethod

public byte getEncryptionMethod()
                         throws ID3Exception
Get the encryption method symbol used to encrypt this frame.

Returns:
the encryption method symbol used
Throws:
ID3Exception - if this frame is not encrypted

setGroupingIdentityFlag

public void setGroupingIdentityFlag(boolean bGroupingIdentityFlagValue)
Specify whether this frame belongs to a group of other frames or not. If set, the group identifier must be specified.

Parameters:
bGroupingIdentityFlagValue - the state this flag should be set to

getFrameId

protected abstract byte[] getFrameId()
Get the four bytes which uniquely specify of which type this frame is.


toString

public abstract java.lang.String toString()
Represent the contents of this frame as a string. For debugging purposes.

Returns:
a string representing this frame

writeHeader

protected void writeHeader(java.io.OutputStream oOS)
                    throws ID3Exception
Write the header of this frame to an output stream.

Parameters:
oOS - the output stream to write to
Throws:
ID3Exception - if an error occurs while writing

writeBody

protected abstract void writeBody(ID3DataOutputStream oIDOS)
                           throws java.io.IOException
Write the body of the frame to an ID3 data output stream.

Parameters:
oIDOS - the output stream to write to
Throws:
ID3Exception - if an error occurs while writing
java.io.IOException

write

public void write(java.io.OutputStream oOS)
           throws java.io.IOException,
                  ID3Exception
Write this frame to an output stream.

Parameters:
oOS - the output stream to write to
Throws:
ID3Exception - if an error occurs while writing the frame
java.io.IOException - if an error occurs while writing the frame