org.jaudiotagger.audio.generic
Class GenericTag

java.lang.Object
  extended by org.jaudiotagger.audio.generic.AbstractTag
      extended by org.jaudiotagger.audio.generic.GenericTag
All Implemented Interfaces:
Tag
Direct Known Subclasses:
RealTag, WavTag

public abstract class GenericTag
extends AbstractTag

This is a complete example implementation of AbstractTag and it currenlty used to provide basic support to audio formats with only read tagging ability such as Real or Wav files

Author:
Raphaƫl Slinckx

Nested Class Summary
private  class GenericTag.GenericTagTextField
          Implementations of TagTextField for use with "ISO-8859-1" strings.
 
Field Summary
private static java.util.EnumSet<FieldKey> supportedKeys
           
 
Fields inherited from class org.jaudiotagger.audio.generic.AbstractTag
commonNumber, fields
 
Constructor Summary
GenericTag()
           
 
Method Summary
 TagField createField(Artwork artwork)
          Create artwork field based on the data in artwork
 TagField createField(FieldKey genericKey, java.lang.String value)
          Create a new field based on generic key, used internally by the library

 void deleteField(FieldKey genericKey)
          Delete any fields with this key
 java.util.List<Artwork> getArtworkList()
           
 java.lang.String getFirst(FieldKey genericKey)
          Retrieve String value of the first tagfield that exists for this generic key
 TagField getFirstField(FieldKey genericKey)
           
protected  boolean isAllowedEncoding(java.lang.String enc)
          (overridden)
 
Methods inherited from class org.jaudiotagger.audio.generic.AbstractTag
addField, addField, addField, deleteArtworkField, deleteField, get, getFieldCount, getFields, getFields, getFirst, getFirstArtwork, getFirstField, hasCommonFields, hasField, isEmpty, setEncoding, setField, setField, setField, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

supportedKeys

private static java.util.EnumSet<FieldKey> supportedKeys
Constructor Detail

GenericTag

public GenericTag()
Method Detail

isAllowedEncoding

protected boolean isAllowedEncoding(java.lang.String enc)
(overridden)

Specified by:
isAllowedEncoding in class AbstractTag
Parameters:
enc - charset encoding.
Returns:
true if the given encoding can be used.
See Also:
AbstractTag.isAllowedEncoding(java.lang.String)

createField

public TagField createField(FieldKey genericKey,
                            java.lang.String value)
                     throws KeyNotFoundException,
                            FieldDataInvalidException
Description copied from interface: Tag
Create a new field based on generic key, used internally by the library

Only textual data supported at the moment. The genericKey will be mapped to the correct implementation key and return a TagField.

It is not recommended to use this method for normal use of the audiolibrary, this is snot added to the structure

Specified by:
createField in interface Tag
Specified by:
createField in class AbstractTag
Parameters:
genericKey - is the generic key
value - to store
Returns:
Throws:
KeyNotFoundException
FieldDataInvalidException

getFirst

public java.lang.String getFirst(FieldKey genericKey)
                          throws KeyNotFoundException
Description copied from interface: Tag
Retrieve String value of the first tagfield that exists for this generic key

Specified by:
getFirst in interface Tag
Specified by:
getFirst in class AbstractTag
Parameters:
genericKey -
Returns:
Throws:
KeyNotFoundException

deleteField

public void deleteField(FieldKey genericKey)
                 throws KeyNotFoundException
Description copied from interface: Tag
Delete any fields with this key

Specified by:
deleteField in interface Tag
Specified by:
deleteField in class AbstractTag
Parameters:
genericKey -
Throws:
KeyNotFoundException

getFirstField

public TagField getFirstField(FieldKey genericKey)
                       throws KeyNotFoundException
Specified by:
getFirstField in interface Tag
Specified by:
getFirstField in class AbstractTag
Parameters:
genericKey -
Returns:
Throws:
KeyNotFoundException

getArtworkList

public java.util.List<Artwork> getArtworkList()
Returns:
a list of all artwork in this file using the format indepedent Artwork class

createField

public TagField createField(Artwork artwork)
                     throws FieldDataInvalidException
Description copied from interface: Tag
Create artwork field based on the data in artwork

Returns:
suitable tagfield for this format that represents the artwork data
Throws:
FieldDataInvalidException