org.farng.mp3.filename
Class FilenameTagBuilder

java.lang.Object
  extended byorg.farng.mp3.filename.FilenameTagBuilder

public class FilenameTagBuilder
extends java.lang.Object

This class builds a FilenameTag. The main method to call is createFilenameTagFromMP3File. Other methods are public in order to update parts of the tag if needed.

Version:
$Revision: 1.2 $
Author:
Eric Farng

Method Summary
static AbstractFilenameComposite createCompositeFromToken(java.lang.String token)
          Creates a FilenameComposite tree with the given string.
static FilenameTag createEmptyFilenameTag()
           
static FilenameTag createFilenameTagFromMP3File(MP3File mp3File)
          This method will create a complete FilenameTag from the given mp3File and from the options in TagOptionSingleton.
static void updateCompositeFromAllOption(AbstractFilenameComposite composite)
          Traverse the composite and set the class field to match keywords found in TagOptionSingleton.
static void updateCompositeFromAllTag(AbstractFilenameComposite composite, MP3File mp3File)
          Traverse the composite and set the class field to match frames from all three other tags that are already found in the MP3 file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createCompositeFromToken

public static AbstractFilenameComposite createCompositeFromToken(java.lang.String token)
                                                          throws TagException
Creates a FilenameComposite tree with the given string. It is parsed according to the different values that can be set in TagOptionSingleton class

Parameters:
token - filename to parse
Returns:
FilenameComposite tree representing the given token.
Throws:
TagException - is thrown if there are unmatched parenthesis

createEmptyFilenameTag

public static FilenameTag createEmptyFilenameTag()

createFilenameTagFromMP3File

public static FilenameTag createFilenameTagFromMP3File(MP3File mp3File)
                                                throws java.lang.Exception
This method will create a complete FilenameTag from the given mp3File and from the options in TagOptionSingleton. This will call all other necessary methods in this builder class.

Parameters:
mp3File - MP3 file to create the FilenameTag from.
Returns:
FilenameTag of the mp3File argument
Throws:
java.lang.Exception - is thrown on any IO errors, or parsing errors such as unmatched parenthesis

updateCompositeFromAllOption

public static void updateCompositeFromAllOption(AbstractFilenameComposite composite)
Traverse the composite and set the class field to match keywords found in TagOptionSingleton.

Parameters:
composite - composite to update.

updateCompositeFromAllTag

public static void updateCompositeFromAllTag(AbstractFilenameComposite composite,
                                             MP3File mp3File)
Traverse the composite and set the class field to match frames from all three other tags that are already found in the MP3 file.

Parameters:
composite - composite to update
mp3File - mp3file to match all it's tags against.


Copyright (c) 2004 Eric Farng