pl.edu.agh.cast.importer.base.template
Class ImportTemplate

java.lang.Object
  extended by pl.edu.agh.cast.importer.base.template.ImportTemplate
All Implemented Interfaces:
Serializable, IImportTemplate

public class ImportTemplate
extends Object
implements IImportTemplate

Default implementation of IImportTemplate.

Author:
AGH CAST Team
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface pl.edu.agh.cast.importer.base.template.IImportTemplate
TEMPLATE_FILE_EXTENSION
 
Constructor Summary
ImportTemplate()
          Default constructor.
ImportTemplate(String stringId)
          Constructor.
 
Method Summary
 IImportTemplate createCopy()
          Creates a copy of this template.
 IImportConverter getConverter()
          Gets an import converter.
 String getDescription()
          Gets template description.
 UUID getId()
          Gets template id.
 String getName()
          Gets template name.
 IImportParser getParser()
          Gets an import parser.
 IImportTokenizer getTokenizer()
          Gets import tokenizer.
 int getVersion()
          Gets version of template.
 boolean isComplete()
          Checks if a template is configured properly which means that all tokenizer, parser and converter are set and they are properly configured too.
 void setConverter(IImportConverter converter)
          Sets a new import converter.
 void setDescription(String description)
          Sets template not null description.
 void setName(String name)
          Sets template not null name.
 void setParser(IImportParser parser)
          Sets a new import parser.
 void setTokenizer(IImportTokenizer tokenizer)
          Sets a new import tokenizer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImportTemplate

public ImportTemplate()
Default constructor. Generates a random template id.


ImportTemplate

public ImportTemplate(String stringId)
Constructor. Constructs template id from given string.

Parameters:
stringId - string representation of template id
Throws:
IllegalArgumentException - when stringId parameter contains wrong id representation
Method Detail

getName

public String getName()
Gets template name. Template name can be displayed in a list of templates.

Specified by:
getName in interface IImportTemplate
Returns:
template name
See Also:
IImportTemplate.getName()

setName

public void setName(String name)
Sets template not null name.

Specified by:
setName in interface IImportTemplate
Parameters:
name - a new template name
See Also:
IImportTemplate.setName(java.lang.String)

getDescription

public String getDescription()
Gets template description. The description should contain information about the template usage such as which domain model, which kind of files, etc.

Specified by:
getDescription in interface IImportTemplate
Returns:
template description
See Also:
IImportTemplate.getDescription()

setDescription

public void setDescription(String description)
Sets template not null description.

Specified by:
setDescription in interface IImportTemplate
Parameters:
description - new template description
See Also:
IImportTemplate.setDescription(java.lang.String)

getTokenizer

public IImportTokenizer getTokenizer()
Gets import tokenizer.

Specified by:
getTokenizer in interface IImportTemplate
Returns:
import tokenizer
See Also:
#getTokenizer()

setTokenizer

public void setTokenizer(IImportTokenizer tokenizer)
Sets a new import tokenizer.

Specified by:
setTokenizer in interface IImportTemplate
Parameters:
tokenizer - a new import tokenizer
See Also:
#setTokenizer(pl.edu.agh.cast.importer.base.tokenizer.IImportTokenizer)

getParser

public IImportParser getParser()
Gets an import parser.

Specified by:
getParser in interface IImportTemplate
Returns:
an import parser
See Also:
#getParser()

setParser

public void setParser(IImportParser parser)
Sets a new import parser.

Specified by:
setParser in interface IImportTemplate
Parameters:
parser - a new import parser
See Also:
#setParser(pl.edu.agh.cast.importer.base.parser.IImportParser)

getConverter

public IImportConverter getConverter()
Gets an import converter.

Specified by:
getConverter in interface IImportTemplate
Returns:
an import converter
See Also:
#getConverter()

setConverter

public void setConverter(IImportConverter converter)
Sets a new import converter.

Specified by:
setConverter in interface IImportTemplate
Parameters:
converter - a new import converter
See Also:
#setConverter(pl.edu.agh.cast.importer.base.converter.IImportConverter)

getVersion

public int getVersion()
Gets version of template.

Specified by:
getVersion in interface IImportTemplate
Returns:
template version
See Also:
IImportTemplate.getVersion()

getId

public UUID getId()
Gets template id.

Specified by:
getId in interface IImportTemplate
Returns:
template id
See Also:
IImportTemplate.getId()

isComplete

public boolean isComplete()
Checks if a template is configured properly which means that all tokenizer, parser and converter are set and they are properly configured too.

Specified by:
isComplete in interface IImportTemplate
Returns:
true if template is properly configured, false otherwise
See Also:
IImportTemplate.isComplete()

createCopy

public IImportTemplate createCopy()
Creates a copy of this template. Reference to all fields are copied, excepting id which is generated.

Specified by:
createCopy in interface IImportTemplate
Returns:
a copy of this template
See Also:
IImportTemplate.createCopy()


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.