archimate.codegen
Class ASTEngine

java.lang.Object
  extended by archimate.codegen.ASTEngine

public class ASTEngine
extends java.lang.Object

Utility class providing methods for editing Java source files

Author:
Samuel Esposito

Constructor Summary
ASTEngine(org.eclipse.core.resources.IFile targetFile, SourceInspector inspector, java.lang.String mode, java.lang.String pattern)
          Creates new ASTEngine and sets the target file and SourceInspector
ASTEngine(SourceInspector inspector, java.lang.String mode, java.lang.String pattern)
          Creates new ASTEngine and sets the SourceInspector
 
Method Summary
 void createSourceFile(TagNode node, org.eclipse.core.runtime.MultiStatus status)
          Creates a new source file for the given archiMateTag
 void traverseSource()
          Parses the source in the file, lets a JavaInspector visit it and saves the changes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASTEngine

public ASTEngine(SourceInspector inspector,
                 java.lang.String mode,
                 java.lang.String pattern)
Creates new ASTEngine and sets the SourceInspector

Parameters:
inspector - SourceInspector handling code traversing and modifications
mode - the engine mode: either SourceInspector.GENERATE or SourceInspector.VALIDATE
pattern - the pattern currently processed

ASTEngine

public ASTEngine(org.eclipse.core.resources.IFile targetFile,
                 SourceInspector inspector,
                 java.lang.String mode,
                 java.lang.String pattern)
Creates new ASTEngine and sets the target file and SourceInspector

Parameters:
targetFile - the targetFile where the engine reads and writes
inspector - SourceInspector handling code traversing and modifications
mode - the engine mode: either SourceInspector.GENERATE or SourceInspector.VALIDATE
pattern - the pattern currently processed
Method Detail

traverseSource

public void traverseSource()
Parses the source in the file, lets a JavaInspector visit it and saves the changes


createSourceFile

public void createSourceFile(TagNode node,
                             org.eclipse.core.runtime.MultiStatus status)
Creates a new source file for the given archiMateTag

Parameters:
node - The TagNode to generate code for