java.lang.Object
com.virtuosotechnologies.asaph.standardmodel.StandardModelFactoryImpl
- All Implemented Interfaces:
- StandardModelFactory
- class StandardModelFactoryImpl
- extends java.lang.Object
- implements StandardModelFactory
Implementation of StandardModelFactory
|
Method Summary |
com.virtuosotechnologies.asaph.model.SongDatabase |
createSimpleSongDatabase()
Create a simple SongDatabase implementation. |
com.virtuosotechnologies.asaph.model.Song |
createSong(com.virtuosotechnologies.asaph.model.SongID id,
java.util.Locale locale)
Create a standard Song implementation. |
com.virtuosotechnologies.asaph.model.SongIDResultSet |
createSongIDResultSet(com.virtuosotechnologies.asaph.model.SongDatabase database)
Create a standard SongIDResultSet implementation. |
com.virtuosotechnologies.lib.util.StringID |
getSongVersion(com.virtuosotechnologies.asaph.model.Song song)
Get the version string for the given Song. |
boolean |
isSimpleSongDatabase(com.virtuosotechnologies.asaph.model.SongDatabase database)
Returns true if the given Song is a simple implementation of SongDatabase. |
boolean |
isStandardModelSong(com.virtuosotechnologies.asaph.model.Song song)
Returns true if the given Song is a StandardModel implementation of Song. |
com.virtuosotechnologies.asaph.model.SongDatabase |
parseSimpleSongDatabase(java.io.Reader reader,
org.xml.sax.ErrorHandler errorHandler,
boolean writable)
Parse a simple SongDatabase from the given XML document. |
com.virtuosotechnologies.asaph.model.Song |
parseSong(java.io.Reader reader,
com.virtuosotechnologies.asaph.model.SongID id,
org.xml.sax.ErrorHandler errorHandler)
Parse a Song from the given XML document. |
void |
setSongVersion(com.virtuosotechnologies.asaph.model.Song song,
com.virtuosotechnologies.lib.util.StringID version)
Set the version string for the given Song. |
void |
unparseSimpleSongDatabase(com.virtuosotechnologies.asaph.model.SongDatabase database,
java.io.OutputStream stream,
java.lang.String encodingName)
Unparse the given SongDatabase to an OutputStream as a standalone XML file. |
void |
unparseSimpleSongDatabase(com.virtuosotechnologies.asaph.model.SongDatabase database,
java.io.Writer writer,
java.lang.String encodingName)
Unparse the given SongDatabase to an OutputStream as a standalone XML file. |
void |
unparseSong(com.virtuosotechnologies.asaph.model.Song song,
java.io.OutputStream stream,
java.lang.String encodingName)
Unparse the given Song to an OutputStream as a standalone XML file. |
void |
unparseSong(com.virtuosotechnologies.asaph.model.Song song,
java.io.Writer writer,
java.lang.String encodingName)
Unparse the given Song to an OutputStream as a standalone XML file. |
void |
unparseSongElement(com.virtuosotechnologies.asaph.model.Song song,
com.virtuosotechnologies.lib.xml.XMLUnparser unparser)
Unparse the given Song to an OutputStream as an element within a larger XML document. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DTD_FILENAME
private static final java.lang.String DTD_FILENAME
- See Also:
- Constant Field Values
DTD_FILENAME_OLD
private static final java.lang.String DTD_FILENAME_OLD
- See Also:
- Constant Field Values
songUtils_
private com.virtuosotechnologies.asaph.modelutils.SongUtils songUtils_
parserFactory_
private javax.xml.parsers.SAXParserFactory parserFactory_
dtdString_
private java.lang.String dtdString_
dtdStringOld_
private java.lang.String dtdStringOld_
notationManager_
private com.virtuosotechnologies.asaph.notationmanager.NotationManager notationManager_
StandardModelFactoryImpl
StandardModelFactoryImpl(com.virtuosotechnologies.asaph.modelutils.SongUtils songUtils,
com.virtuosotechnologies.asaph.notationmanager.NotationManager notationManager)
throws java.io.IOException
createSongIDResultSet
public com.virtuosotechnologies.asaph.model.SongIDResultSet createSongIDResultSet(com.virtuosotechnologies.asaph.model.SongDatabase database)
- Create a standard SongIDResultSet implementation.
- Specified by:
createSongIDResultSet in interface StandardModelFactory
createSong
public com.virtuosotechnologies.asaph.model.Song createSong(com.virtuosotechnologies.asaph.model.SongID id,
java.util.Locale locale)
- Create a standard Song implementation.
- Specified by:
createSong in interface StandardModelFactory
parseSong
public com.virtuosotechnologies.asaph.model.Song parseSong(java.io.Reader reader,
com.virtuosotechnologies.asaph.model.SongID id,
org.xml.sax.ErrorHandler errorHandler)
throws java.io.IOException,
org.xml.sax.SAXException
- Parse a Song from the given XML document.
- Specified by:
parseSong in interface StandardModelFactory
isStandardModelSong
public boolean isStandardModelSong(com.virtuosotechnologies.asaph.model.Song song)
- Returns true if the given Song is a StandardModel implementation of Song.
This means the song unparse operations provided by this API may be performed.
- Specified by:
isStandardModelSong in interface StandardModelFactory
unparseSong
public void unparseSong(com.virtuosotechnologies.asaph.model.Song song,
java.io.OutputStream stream,
java.lang.String encodingName)
throws java.io.IOException
- Unparse the given Song to an OutputStream as a standalone XML file.
The Song must be a StandardModel Song.
- Specified by:
unparseSong in interface StandardModelFactory
unparseSong
public void unparseSong(com.virtuosotechnologies.asaph.model.Song song,
java.io.Writer writer,
java.lang.String encodingName)
throws java.io.IOException
- Unparse the given Song to an OutputStream as a standalone XML file.
The Song must be a StandardModel Song.
Does not check to ensure the given writer's encoding matches the encoding string.
- Specified by:
unparseSong in interface StandardModelFactory
unparseSongElement
public void unparseSongElement(com.virtuosotechnologies.asaph.model.Song song,
com.virtuosotechnologies.lib.xml.XMLUnparser unparser)
throws java.io.IOException
- Unparse the given Song to an OutputStream as an element within a larger XML document.
The Song must be a StandardModel Song.
- Specified by:
unparseSongElement in interface StandardModelFactory
getSongVersion
public com.virtuosotechnologies.lib.util.StringID getSongVersion(com.virtuosotechnologies.asaph.model.Song song)
- Get the version string for the given Song.
The Song must be a StandardModel Song.
- Specified by:
getSongVersion in interface StandardModelFactory
setSongVersion
public void setSongVersion(com.virtuosotechnologies.asaph.model.Song song,
com.virtuosotechnologies.lib.util.StringID version)
- Set the version string for the given Song.
The Song must be a StandardModel Song.
- Specified by:
setSongVersion in interface StandardModelFactory
createSimpleSongDatabase
public com.virtuosotechnologies.asaph.model.SongDatabase createSimpleSongDatabase()
- Create a simple SongDatabase implementation.
- Specified by:
createSimpleSongDatabase in interface StandardModelFactory
parseSimpleSongDatabase
public com.virtuosotechnologies.asaph.model.SongDatabase parseSimpleSongDatabase(java.io.Reader reader,
org.xml.sax.ErrorHandler errorHandler,
boolean writable)
throws java.io.IOException,
org.xml.sax.SAXException
- Parse a simple SongDatabase from the given XML document.
- Specified by:
parseSimpleSongDatabase in interface StandardModelFactory
isSimpleSongDatabase
public boolean isSimpleSongDatabase(com.virtuosotechnologies.asaph.model.SongDatabase database)
- Returns true if the given Song is a simple implementation of SongDatabase.
This means the song database unparse operations provided by this API may be performed.
- Specified by:
isSimpleSongDatabase in interface StandardModelFactory
unparseSimpleSongDatabase
public void unparseSimpleSongDatabase(com.virtuosotechnologies.asaph.model.SongDatabase database,
java.io.OutputStream stream,
java.lang.String encodingName)
throws java.io.IOException
- Unparse the given SongDatabase to an OutputStream as a standalone XML file.
The database must be a simple SongDatabase.
- Specified by:
unparseSimpleSongDatabase in interface StandardModelFactory
unparseSimpleSongDatabase
public void unparseSimpleSongDatabase(com.virtuosotechnologies.asaph.model.SongDatabase database,
java.io.Writer writer,
java.lang.String encodingName)
throws java.io.IOException
- Unparse the given SongDatabase to an OutputStream as a standalone XML file.
The database must be a simple SongDatabase.
Does not check to ensure the given writer's encoding matches the encoding string.
- Specified by:
unparseSimpleSongDatabase in interface StandardModelFactory