archimate.patterns.mvc
Class MVCModel

java.lang.Object
  extended by archimate.patterns.mvc.MVCModel
All Implemented Interfaces:
IGenModel

public class MVCModel
extends java.lang.Object
implements IGenModel

Class containing all settings for a Java MVC Pattern

Author:
Samuel Esposito

Constructor Summary
MVCModel(org.eclipse.uml2.uml.Package myPackage)
          Creates a new MVCModel and initializes it by reading out the given UML model
 
Method Summary
 java.lang.String classComment(java.lang.String archiMateTag)
          Returns the comments for a class
 java.lang.String className(java.lang.String archiMateTag)
          Returns the class name for a source file
 java.util.ArrayList<java.lang.String> imports(java.lang.String archiMateTag)
          Returns the imports for a snippet of code
 java.util.ArrayList<java.lang.String> interfaces(java.lang.String archiMateTag)
          Returns a list of implemented interfaces
 boolean isInterface(java.lang.String archiMateTag)
          Returns whether a source file contains a class or an interface
 java.util.ArrayList<java.lang.String> methodInvocations(java.lang.String archiMateTag)
          Returns a list of methods invoking another method in a source file
 java.util.ArrayList<java.lang.String> methods(java.lang.String archiMateTag)
          Returns a list of methods in a source file
 java.lang.String objectClass(java.lang.String archiMateTag)
          Returns the class of an object
 java.lang.String objectName(java.lang.String archiMateTag)
          Returns the name of an object
 java.lang.String packageBase()
          Returns the source folder package base
 java.lang.String packageName(java.lang.String archiMateTag)
          Returns the package name for a source file
 java.lang.String sourceType(java.lang.String archiMateTag)
          Returns the type of the tagged source element.
 java.lang.String targetFile(java.lang.String archiMateTag)
          Returns the file name for a source file
 java.lang.String targetFolder()
          Returns the project source folder
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MVCModel

public MVCModel(org.eclipse.uml2.uml.Package myPackage)
Creates a new MVCModel and initializes it by reading out the given UML model

Parameters:
myPackage - UML model for reading out
Method Detail

sourceType

public java.lang.String sourceType(java.lang.String archiMateTag)
Description copied from interface: IGenModel
Returns the type of the tagged source element. Types can either be one of JavaHelper.METHOD_DECLARATION, JavaHelper.METHOD_IMPLEMENTATION or JavaHelper.METHOD_INVOCATION.

Specified by:
sourceType in interface IGenModel
Parameters:
archiMateTag - The tag of the source element at hand
Returns:
the type of the tagged source element

targetFolder

public java.lang.String targetFolder()
Description copied from interface: IGenModel
Returns the project source folder

Specified by:
targetFolder in interface IGenModel
Returns:
The project source folder

packageBase

public java.lang.String packageBase()
Description copied from interface: IGenModel
Returns the source folder package base

Specified by:
packageBase in interface IGenModel
Returns:
The source folder package base

targetFile

public java.lang.String targetFile(java.lang.String archiMateTag)
Description copied from interface: IGenModel
Returns the file name for a source file

Specified by:
targetFile in interface IGenModel
Parameters:
archiMateTag - The tag labeling the class in the source file
Returns:
The file name for a source file

packageName

public java.lang.String packageName(java.lang.String archiMateTag)
Description copied from interface: IGenModel
Returns the package name for a source file

Specified by:
packageName in interface IGenModel
Parameters:
archiMateTag - The tag labeling the class in the source file
Returns:
The package name for a source file

imports

public java.util.ArrayList<java.lang.String> imports(java.lang.String archiMateTag)
Description copied from interface: IGenModel
Returns the imports for a snippet of code

Specified by:
imports in interface IGenModel
Parameters:
archiMateTag - The tag labeling the key source element
Returns:
The imports for a snippet of code

classComment

public java.lang.String classComment(java.lang.String archiMateTag)
Description copied from interface: IGenModel
Returns the comments for a class

Specified by:
classComment in interface IGenModel
Parameters:
archiMateTag - The tag labeling the key source element
Returns:
The comments for a class

className

public java.lang.String className(java.lang.String archiMateTag)
Description copied from interface: IGenModel
Returns the class name for a source file

Specified by:
className in interface IGenModel
Parameters:
archiMateTag - The tag labeling the key source element
Returns:
The class name for a source file

interfaces

public java.util.ArrayList<java.lang.String> interfaces(java.lang.String archiMateTag)
Description copied from interface: IGenModel
Returns a list of implemented interfaces

Specified by:
interfaces in interface IGenModel
Parameters:
archiMateTag - The tag labeling the key source element
Returns:
A list of implemented interfaces

isInterface

public boolean isInterface(java.lang.String archiMateTag)
Description copied from interface: IGenModel
Returns whether a source file contains a class or an interface

Specified by:
isInterface in interface IGenModel
Parameters:
archiMateTag - The tag labeling the key source element
Returns:
Whether a source file contains a class or an interface

objectClass

public java.lang.String objectClass(java.lang.String archiMateTag)
Description copied from interface: IGenModel
Returns the class of an object

Specified by:
objectClass in interface IGenModel
Parameters:
archiMateTag - The tag labeling the key source element
Returns:
The class of an object

objectName

public java.lang.String objectName(java.lang.String archiMateTag)
Description copied from interface: IGenModel
Returns the name of an object

Specified by:
objectName in interface IGenModel
Parameters:
archiMateTag - The tag labeling the key source element
Returns:
The name of an object

methods

public java.util.ArrayList<java.lang.String> methods(java.lang.String archiMateTag)
Description copied from interface: IGenModel
Returns a list of methods in a source file

Specified by:
methods in interface IGenModel
Parameters:
archiMateTag - The tag labeling the key source element
Returns:
A list of methods in a source file

methodInvocations

public java.util.ArrayList<java.lang.String> methodInvocations(java.lang.String archiMateTag)
Description copied from interface: IGenModel
Returns a list of methods invoking another method in a source file

Specified by:
methodInvocations in interface IGenModel
Parameters:
archiMateTag - The tag labeling the key source element
Returns:
A list of methods invoking another method in a source file