org.eclipse.emf.codegen.merge.java
Class JControlModel.MatchRule
java.lang.Object
org.eclipse.emf.codegen.merge.java.JControlModel.MatchRule
- Enclosing class:
- JControlModel
public static class JControlModel.MatchRule
- extends java.lang.Object
During the merge, the current state of the nodes of a tree is applied to the nodes of
another tree. Pairing the nodes of each tree is one of the main activities of the process.
A Match Rule allows a developer to replace the default matching algorithm, based on
qualified names, to better suite the needs of an specific application. Some examples:
<merge:match markup="^gen$" get="Member/getName"/>
<merge:match get="Method/getComment" signature="\s*@\s*uuid\s*(\S*)\s*\n"/>
The first match rule is applicable to any Member marked with the expression defined
by the "^gen$" Dictionary Pattern. It defines that these members are matched
by their names. The second rule is applicable to any method that has
@uuid xyz
on its comment. In this case, the string xyz
is be used to match the nodes.
An important remark is that if there is a type conversion during the merge process,
the match rules should not be used to pair different "kinds" of elements
like fields and enumerator constants for example. See
Jmerger.convert
and NodeConverter
for further details on conversions.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
name
protected java.lang.String name
markup
protected java.util.regex.Pattern markup
getFeature
protected JControlModel.Feature getFeature
signature
protected java.util.regex.Pattern signature
stopMatching
protected boolean stopMatching
classPrefix
protected java.lang.String classPrefix
JControlModel.MatchRule
public JControlModel.MatchRule(java.lang.String classPrefix)
JControlModel.MatchRule
public JControlModel.MatchRule(java.lang.String classPrefix,
org.w3c.dom.Element element)
initialize
public void initialize(org.w3c.dom.Element element)
createFeature
protected JControlModel.Feature createFeature(java.lang.String classPrefix,
java.lang.String path,
java.lang.Class<?>[] parameterTypes)
getName
public java.lang.String getName()
setName
public void setName(java.lang.String name)
getGetFeature
public JControlModel.Feature getGetFeature()
setGetFeature
public void setGetFeature(JControlModel.Feature getFeature)
getMarkup
public java.util.regex.Pattern getMarkup()
setMarkup
public void setMarkup(java.util.regex.Pattern markup)
getSignature
public java.util.regex.Pattern getSignature()
setSignature
public void setSignature(java.util.regex.Pattern signature)
isStopMatching
public boolean isStopMatching()
setStopMatching
public void setStopMatching(boolean stopMatching)
setClassPrefix
protected void setClassPrefix(java.lang.String classPrefix)
getClassPrefix
public java.lang.String getClassPrefix()