code: public static ProjectWriter getProjectWriter(String name) throws InstantiationException, IllegalAccessException
     {
        int index = name.lastIndexOf('.');
        if (index == -1)
        {
           throw new IllegalArgumentException("Filename has no extension: " + name);
        }
  
        String extension = name.substring(index + 1).toUpperCase();
  
        Class<? extends ProjectWriter> fileClass = WRITER_MAP.get(extension);
        if (fileClass == null)
        {
           throw new IllegalArgumentException("Cannot write files of type: " + name);
        }
  
        ProjectWriter file = fileClass.newInstance();
  
        return (file);
     }
docs: Retrieves a ProjectWriter instance which can write a file of the
  type specified by the supplied file name.
  
  @param name file name
  @return ProjectWriter instance