org.eclipse.emf.codegen.merge.java
Class JMerger

java.lang.Object
  extended byorg.eclipse.emf.codegen.merge.java.JMerger

public class JMerger
extends Object

This implements the method run(java.lang.Object), which is called just like main during headless workbench invocation.


Field Summary
protected  JControlModel controlModel
           
static String DEFAULT_FACADE_HELPER_CLASS
           
protected  boolean fixInterfaceBrace
           
protected static Pattern INTERFACE_BRACE_PATTERN
           
protected  boolean isBlocked
           
protected static Object[] noArguments
           
protected  Map orderedSourceChildrenMap
           
protected  JCompilationUnit sourceCompilationUnit
           
protected  JPatternDictionary sourcePatternDictionary
           
protected  Map sourceToTargetMap
           
protected  JCompilationUnit targetCompilationUnit
           
protected  JPatternDictionary targetPatternDictionary
           
protected  Map targetToSourceMap
           
 
Constructor Summary
JMerger()
          This creates an empty instances, an when used as a runnable.
JMerger(JControlModel controlModel)
           
 
Method Summary
protected  void applyPullRules(JNode sourceNode, JNode targetNode)
           
 void applySortRules(JNode sourceNode)
           
protected  void applySweepRules(JNode targetNode)
           
 JCompilationUnit createCompilationUnitForContents(String contents)
          Create a JDOM from contents.
 JCompilationUnit createCompilationUnitForInputStream(InputStream inputStream)
           
 JCompilationUnit createCompilationUnitForInputStream(InputStream inputStream, String encoding)
           
 JCompilationUnit createCompilationUnitForURI(String uri)
          Create a JDOM from a URI.
 JCompilationUnit createCompilationUnitForURI(String uri, String encoding)
          Create a JDOM from a URI.
 String execute(Monitor monitor, String[] arguments)
          Utilitiy for headless operations.
 JControlModel getControlModel()
           
 JCompilationUnit getSourceCompilationUnit()
           
 String getSourceCompilationUnitContents()
           
 JPatternDictionary getSourcePatternDictionary()
           
 Map getSourceToTargetMap()
           
 JCompilationUnit getTargetCompilationUnit()
           
 String getTargetCompilationUnitContents()
           
 JPatternDictionary getTargetPatternDictionary()
           
protected  JNode insertClone(JNode sourceNode)
           
 boolean isFixInterfaceBrace()
           
protected  void map(JNode sourceNode, JNode targetNode)
           
protected  void mapChildren(JNode sourceNode, JNode targetNode)
           
 void merge()
           
protected  void pullTargetCompilationUnit()
           
protected  void pullTargetField(JField targetField)
           
protected  void pullTargetImport(JImport targetImport)
           
protected  void pullTargetInitializer(JInitializer targetInitializer)
           
protected  void pullTargetMethod(JMethod targetMethod)
           
protected  void pullTargetPackage(JPackage targetPackage)
           
protected  void pullTargetType(JType targetType)
           
protected  void pushSourceCompilationUnit()
           
protected  void pushSourceField(JField sourceField)
           
protected  void pushSourceImport(JImport sourceImport)
           
protected  void pushSourceInitializer(JInitializer sourceInitializer)
           
protected  void pushSourceMethod(JMethod sourceMethod)
           
protected  void pushSourcePackage(JPackage sourcePackage)
           
protected  void pushSourceType(JType sourceType)
           
 void remerge()
           
 Object run(Object object)
          This is called with the command line arguments of a headless workbench invocation.
 void setFixInterfaceBrace(boolean fixInterfaceBrace)
           
 void setSourceCompilationUnit(JCompilationUnit sourceCompilationUnit)
           
 void setSourcePatternDictionary(JPatternDictionary sourcePatternDictionary)
           
 void setSourceToTargetMap(Map sourceToTargetMap)
           
 void setTargetCompilationUnit(JCompilationUnit targetCompilationUnit)
           
 void setTargetPatternDictionary(JPatternDictionary targetPatternDictionary)
           
protected  void sortTargetCompilationUnit()
           
protected  void sweepTargetCompilationUnit()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FACADE_HELPER_CLASS

public static final String DEFAULT_FACADE_HELPER_CLASS

sourceCompilationUnit

protected JCompilationUnit sourceCompilationUnit

targetCompilationUnit

protected JCompilationUnit targetCompilationUnit

sourcePatternDictionary

protected JPatternDictionary sourcePatternDictionary

targetPatternDictionary

protected JPatternDictionary targetPatternDictionary

sourceToTargetMap

protected Map sourceToTargetMap

targetToSourceMap

protected Map targetToSourceMap

orderedSourceChildrenMap

protected Map orderedSourceChildrenMap

isBlocked

protected boolean isBlocked

fixInterfaceBrace

protected boolean fixInterfaceBrace

controlModel

protected JControlModel controlModel

INTERFACE_BRACE_PATTERN

protected static final Pattern INTERFACE_BRACE_PATTERN

noArguments

protected static Object[] noArguments
Constructor Detail

JMerger

public JMerger()
This creates an empty instances, an when used as a runnable.


JMerger

public JMerger(JControlModel controlModel)
Method Detail

merge

public void merge()

remerge

public void remerge()

isFixInterfaceBrace

public boolean isFixInterfaceBrace()

setFixInterfaceBrace

public void setFixInterfaceBrace(boolean fixInterfaceBrace)

getSourceCompilationUnitContents

public String getSourceCompilationUnitContents()

getSourceCompilationUnit

public JCompilationUnit getSourceCompilationUnit()

getControlModel

public JControlModel getControlModel()

setSourceCompilationUnit

public void setSourceCompilationUnit(JCompilationUnit sourceCompilationUnit)

getTargetCompilationUnitContents

public String getTargetCompilationUnitContents()

getTargetCompilationUnit

public JCompilationUnit getTargetCompilationUnit()

setTargetCompilationUnit

public void setTargetCompilationUnit(JCompilationUnit targetCompilationUnit)

getSourcePatternDictionary

public JPatternDictionary getSourcePatternDictionary()

setSourcePatternDictionary

public void setSourcePatternDictionary(JPatternDictionary sourcePatternDictionary)

getTargetPatternDictionary

public JPatternDictionary getTargetPatternDictionary()

setTargetPatternDictionary

public void setTargetPatternDictionary(JPatternDictionary targetPatternDictionary)

getSourceToTargetMap

public Map getSourceToTargetMap()

setSourceToTargetMap

public void setSourceToTargetMap(Map sourceToTargetMap)

createCompilationUnitForURI

public JCompilationUnit createCompilationUnitForURI(String uri)
Create a JDOM from a URI.


createCompilationUnitForURI

public JCompilationUnit createCompilationUnitForURI(String uri,
                                                    String encoding)
Create a JDOM from a URI.


createCompilationUnitForInputStream

public JCompilationUnit createCompilationUnitForInputStream(InputStream inputStream)

createCompilationUnitForInputStream

public JCompilationUnit createCompilationUnitForInputStream(InputStream inputStream,
                                                            String encoding)

createCompilationUnitForContents

public JCompilationUnit createCompilationUnitForContents(String contents)
Create a JDOM from contents.


pullTargetCompilationUnit

protected void pullTargetCompilationUnit()

pullTargetPackage

protected void pullTargetPackage(JPackage targetPackage)

pullTargetImport

protected void pullTargetImport(JImport targetImport)

pullTargetType

protected void pullTargetType(JType targetType)

pullTargetInitializer

protected void pullTargetInitializer(JInitializer targetInitializer)

pullTargetField

protected void pullTargetField(JField targetField)

pullTargetMethod

protected void pullTargetMethod(JMethod targetMethod)

applyPullRules

protected void applyPullRules(JNode sourceNode,
                              JNode targetNode)

pushSourceCompilationUnit

protected void pushSourceCompilationUnit()

pushSourcePackage

protected void pushSourcePackage(JPackage sourcePackage)

pushSourceImport

protected void pushSourceImport(JImport sourceImport)

pushSourceType

protected void pushSourceType(JType sourceType)

pushSourceInitializer

protected void pushSourceInitializer(JInitializer sourceInitializer)

pushSourceField

protected void pushSourceField(JField sourceField)

pushSourceMethod

protected void pushSourceMethod(JMethod sourceMethod)

applySortRules

public void applySortRules(JNode sourceNode)

sweepTargetCompilationUnit

protected void sweepTargetCompilationUnit()

applySweepRules

protected void applySweepRules(JNode targetNode)

sortTargetCompilationUnit

protected void sortTargetCompilationUnit()

insertClone

protected JNode insertClone(JNode sourceNode)

mapChildren

protected void mapChildren(JNode sourceNode,
                           JNode targetNode)

map

protected void map(JNode sourceNode,
                   JNode targetNode)

run

public Object run(Object object)
This is called with the command line arguments of a headless workbench invocation.


execute

public String execute(Monitor monitor,
                      String[] arguments)
Utilitiy for headless operations.

Returns:
the merged content

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.