org.eclipse.emf.codegen.merge.java
Class JControlModel.SweepRule
java.lang.Object
org.eclipse.emf.codegen.merge.java.JControlModel.SweepRule
- Direct Known Subclasses:
- JControlModel.SweepRule
- Enclosing class:
- JControlModel
public static class JControlModel.SweepRule
- extends java.lang.Object
A sweep rule removes elements from the target if they are NOT available
in the source. It can work on available Dictionary Patterns or be used to
filter out import statements as follows:
<merge:sweep markup="^gen$" select="Member"/>
<merge:sweep markup="^org.eclipse.emf.ecore.EMetaObject$" select="Import"/>
The first line removes all "members" (attribute, method, ...) that matches
the expression defined by the "^gen$" Dictionary Pattern. The second
removes the "org.eclipse.emf.ecore.EMetaObject" import.
The action
attribute defines what the sweep rule does with the
node to be sweep. Besides removing the node (which is the default action), you can use this
attribute to also rename the node or comment it out. The "rename" action
requires the newName
attribute to be set. This attribute is the name that
the node is renamed to and can be expressed as "deleted_{0}"
, where
{0}
is presents the current name.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
name
protected java.lang.String name
selector
protected java.lang.Class<?> selector
markup
protected java.util.regex.Pattern markup
parentMarkup
protected java.util.regex.Pattern parentMarkup
action
protected JControlModel.SweepRule.Action action
newName
protected java.lang.String newName
classPrefix
protected java.lang.String classPrefix
JControlModel.SweepRule
public JControlModel.SweepRule(java.lang.String classPrefix)
JControlModel.SweepRule
public JControlModel.SweepRule(java.lang.String classPrefix,
org.w3c.dom.Element element)
initialize
public void initialize(org.w3c.dom.Element element)
getName
public java.lang.String getName()
setName
public void setName(java.lang.String name)
getSelector
public java.lang.Class<?> getSelector()
setSelector
public void setSelector(java.lang.Class<?> selector)
getMarkup
public java.util.regex.Pattern getMarkup()
setMarkup
public void setMarkup(java.util.regex.Pattern markup)
getParentMarkup
public java.util.regex.Pattern getParentMarkup()
setParentMarkup
public void setParentMarkup(java.util.regex.Pattern parentMarkup)
getAction
public JControlModel.SweepRule.Action getAction()
setAction
public void setAction(JControlModel.SweepRule.Action action)
getNewName
public java.lang.String getNewName()
setNewName
public void setNewName(java.lang.String newName)
setClassPrefix
protected void setClassPrefix(java.lang.String classPrefix)
getClassPrefix
public java.lang.String getClassPrefix()