## 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.

Nested Class Summary
`static class` `JControlModel.SweepRule.Action`

Field Summary
`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 Summary
`JControlModel.SweepRule(java.lang.String classPrefix)`
`JControlModel.SweepRule(java.lang.String classPrefix, org.w3c.dom.Element element)`

Method Summary
`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)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### 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

Constructor Detail

### JControlModel.SweepRule

    public JControlModel.SweepRule(java.lang.String classPrefix)

### JControlModel.SweepRule

    public JControlModel.SweepRule(java.lang.String classPrefix,
                                   org.w3c.dom.Element element)

Method Detail

### 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()

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