net.sf.fmj.registry.RegistryIOFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fmj Show documentation
Show all versions of fmj Show documentation
Freedom for Media in Java
package net.sf.fmj.registry;
/**
* Factory singleton to create RegistryIO.
*
* @author Ken Larson
*
*/
class RegistryIOFactory
{
public static final int XML = 0;
public static final int PROPERTIES = 1;
public static final RegistryIO createRegistryIO(int type,
RegistryContents contents)
{
switch (type)
{
case XML:
return new XMLRegistryIO(contents);
case PROPERTIES:
return new PropertiesRegistryIO(contents);
default:
throw new IllegalArgumentException();
}
}
}