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.
Modifier and Type | Class and Description |
---|---|
static class |
JControlModel.SweepRule.Action |
Modifier and Type | Field and Description |
---|---|
protected JControlModel.SweepRule.Action |
action |
protected java.lang.String |
classPrefix |
protected java.util.regex.Pattern |
markup |
protected java.lang.String |
name |
protected java.lang.String |
newName |
protected java.util.regex.Pattern |
parentMarkup |
protected java.lang.Class<?> |
selector |
Constructor and Description |
---|
JControlModel.SweepRule(java.lang.String classPrefix) |
JControlModel.SweepRule(java.lang.String classPrefix,
org.w3c.dom.Element element) |
Modifier and Type | Method and Description |
---|---|
JControlModel.SweepRule.Action |
getAction() |
java.lang.String |
getClassPrefix() |
java.util.regex.Pattern |
getMarkup() |
java.lang.String |
getName() |
java.lang.String |
getNewName() |
java.util.regex.Pattern |
getParentMarkup() |
java.lang.Class<?> |
getSelector() |
void |
initialize(org.w3c.dom.Element element) |
void |
setAction(JControlModel.SweepRule.Action action) |
protected void |
setClassPrefix(java.lang.String classPrefix) |
void |
setMarkup(java.util.regex.Pattern markup) |
void |
setName(java.lang.String name) |
void |
setNewName(java.lang.String newName) |
void |
setParentMarkup(java.util.regex.Pattern parentMarkup) |
void |
setSelector(java.lang.Class<?> selector) |
protected java.lang.String name
protected java.lang.Class<?> selector
protected java.util.regex.Pattern markup
protected java.util.regex.Pattern parentMarkup
protected JControlModel.SweepRule.Action action
protected java.lang.String newName
protected java.lang.String classPrefix
public JControlModel.SweepRule(java.lang.String classPrefix)
public JControlModel.SweepRule(java.lang.String classPrefix, org.w3c.dom.Element element)
public void initialize(org.w3c.dom.Element element)
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.Class<?> getSelector()
public void setSelector(java.lang.Class<?> selector)
public java.util.regex.Pattern getMarkup()
public void setMarkup(java.util.regex.Pattern markup)
public java.util.regex.Pattern getParentMarkup()
public void setParentMarkup(java.util.regex.Pattern parentMarkup)
public JControlModel.SweepRule.Action getAction()
public void setAction(JControlModel.SweepRule.Action action)
public java.lang.String getNewName()
public void setNewName(java.lang.String newName)
protected void setClassPrefix(java.lang.String classPrefix)
public java.lang.String getClassPrefix()