cz.cuni.mff.procasor.core.helper
Class ProjectHelper

java.lang.Object
  extended bycz.cuni.mff.procasor.core.helper.ProjectHelper

public final class ProjectHelper
extends java.lang.Object

Helper class for Project.

Author:
Jirka

Field Summary
static java.lang.String FILE_DESCRIPTION
          Description of Procasor project file
static java.lang.String FILE_EXTENSION
          Extension of saving project files.
static java.lang.String IMPORT_LOCATION
          Location for importing projects
static java.lang.String SAVE_LOCATION
          Location for saving and opening projects
 
Method Summary
static Project createProject(java.lang.String name, java.lang.String description)
          Creation of new project and initialization all parameters.
static Project loadProject(java.io.File file)
          Load project using JAXB from file in paramater.
static void save(Project project, java.lang.String path)
          Save project to file (projectname .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SAVE_LOCATION

public static final java.lang.String SAVE_LOCATION
Location for saving and opening projects


IMPORT_LOCATION

public static final java.lang.String IMPORT_LOCATION
Location for importing projects


FILE_EXTENSION

public static final java.lang.String FILE_EXTENSION
Extension of saving project files.

See Also:
Constant Field Values

FILE_DESCRIPTION

public static final java.lang.String FILE_DESCRIPTION
Description of Procasor project file

See Also:
Constant Field Values
Method Detail

createProject

public static Project createProject(java.lang.String name,
                                    java.lang.String description)
Creation of new project and initialization all parameters.

Parameters:
name - jname of the project
description - description of the project
Returns:
newly created project

save

public static void save(Project project,
                        java.lang.String path)
                 throws javax.xml.bind.JAXBException,
                        java.io.FileNotFoundException
Save project to file (projectname . extension) using JAXB.

Parameters:
project - project to save
path - pathe where project is saved to
Throws:
javax.xml.bind.JAXBException - throws exeption if JAXB fails
java.io.FileNotFoundException - thorws exception if path is not correct

loadProject

public static Project loadProject(java.io.File file)
                           throws javax.xml.bind.JAXBException
Load project using JAXB from file in paramater.

Parameters:
file - file project is load from
Returns:
newly loaded project
Throws:
javax.xml.bind.JAXBException - throws exeption if JAXB fails