magoffin.matt.meta.audio
Class ID3v1MetadataResource

java.lang.Object
  extended by magoffin.matt.meta.support.AbstractMetadataResource
      extended by magoffin.matt.meta.support.AbstractEnumMetadataResource<AudioMetadataType>
          extended by magoffin.matt.meta.audio.ID3v1MetadataResource
All Implemented Interfaces:
AudioMetadataResource, MetadataResource
Direct Known Subclasses:
ID3v1_1MetadataResource

public class ID3v1MetadataResource
extends AbstractEnumMetadataResource<AudioMetadataType>
implements AudioMetadataResource

MetadataResource implementation for ID3v1 resources.

Version:
$Revision: 3 $ $Date: 2008-12-27 08:09:28 +1300 (Sat, 27 Dec 2008) $
Author:
Matt Magoffin (spamsqr@msqr.us)

Field Summary
 
Fields inherited from class magoffin.matt.meta.support.AbstractMetadataResource
log
 
Constructor Summary
ID3v1MetadataResource(java.io.RandomAccessFile file)
          Construct with a RandomAccessFile.
 
Method Summary
 java.lang.Object getValue(java.lang.String key, java.util.Locale locale)
          Get a single metadata value based on an arbitrary key.
protected  void parseFile(java.io.RandomAccessFile file)
          Parse ID3v1 metadata from a file.
 
Methods inherited from class magoffin.matt.meta.support.AbstractEnumMetadataResource
addError, addValue, getValue, getValues, setValue, setValues
 
Methods inherited from class magoffin.matt.meta.support.AbstractMetadataResource
addError, addValue, clearValues, getParsedKeys, getParseErrors, getValueList, getValues, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface magoffin.matt.meta.audio.AudioMetadataResource
getValue, getValues
 
Methods inherited from interface magoffin.matt.meta.MetadataResource
getParsedKeys, getParseErrors, getValues
 

Constructor Detail

ID3v1MetadataResource

public ID3v1MetadataResource(java.io.RandomAccessFile file)
                      throws java.io.IOException
Construct with a RandomAccessFile.

Parameters:
file - the file
Throws:
java.io.IOException - if an error occurs
Method Detail

parseFile

protected void parseFile(java.io.RandomAccessFile file)
                  throws java.io.IOException
Parse ID3v1 metadata from a file.

Parameters:
file - the file
Throws:
java.io.IOException - if an IO error occurs

getValue

public java.lang.Object getValue(java.lang.String key,
                                 java.util.Locale locale)
Description copied from interface: MetadataResource
Get a single metadata value based on an arbitrary key.

Keys are implementation specific. If more than one metadata of the specified key is available, this will return the first available one.

An optional Locale parameter may be provided. Some metadata values might have Locale-specific variations. The Locale parameter may be null in which case the platform's default Locale will be used.

Specified by:
getValue in interface MetadataResource
Overrides:
getValue in class AbstractMetadataResource
Parameters:
key - the key
locale - a Locale
Returns:
the value, or null if not available