org.andromda.core.configuration
Class Filters

java.lang.Object
  extended by org.andromda.core.configuration.Filters
All Implemented Interfaces:
java.io.Serializable

public class Filters
extends java.lang.Object
implements java.io.Serializable

Stores information about all Filter instances that should or should not be applied to a model.

Author:
Chad Brandon
See Also:
Filter, Serialized Form

Constructor Summary
Filters()
           
 
Method Summary
 void addFilter(Filter filter)
          Adds the filter to the underlying filters store.
 void addFilters(Filters filters)
          Adds all Filter instances in the given filters to this instance.
 Filter[] getFilters()
          Gets the actual filters that belong to this filters instance.
 boolean isApply(java.lang.String value)
          Determines whether or not the value should be applied.
 boolean isEmpty()
          Indicates whether or not this model filters instance has any filtering defined.
 boolean match(java.lang.String value, java.lang.String pattern)
          Provides matching of simple wildcards.
 void setApplyAll(boolean applyAll)
          Sets whether or not AndroMDA should apply all filters on a model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Filters

public Filters()
Method Detail

setApplyAll

public void setApplyAll(boolean applyAll)
Sets whether or not AndroMDA should apply all filters on a model. If this is set to true, then filter values should be specified if you want to keep certain filters from being being applied. If this is set to false, then you would want to define filter elements to specify which filters SHOULD BE applied.

Parameters:
applyAll - whether or not we should apply all filters true/false

addFilter

public void addFilter(Filter filter)
Adds the filter to the underlying filters store.

Parameters:
filter - the Filter instance.

addFilters

public void addFilters(Filters filters)
Adds all Filter instances in the given filters to this instance.

Parameters:
filters - the Filters instance to add.

getFilters

public Filter[] getFilters()
Gets the actual filters that belong to this filters instance.

Returns:
the filters to retrieve.

isApply

public boolean isApply(java.lang.String value)
Determines whether or not the value should be applied. If applyAll is true, then this method will return false only if the Filter corresponding to the value has apply set to false.

Parameters:
value - the name of the model filter to check.
Returns:
true/false

isEmpty

public boolean isEmpty()
Indicates whether or not this model filters instance has any filtering defined.

Returns:
true/false

match

public boolean match(java.lang.String value,
                     java.lang.String pattern)
Provides matching of simple wildcards. (i.e. '*.java' etc.)

Parameters:
value - the value to match against.
pattern - the pattern to check if the path matches.
Returns:
true if the value matches the given pattern, false otherwise.


Copyright © 2003-2008 AndroMDA.org. All Rights Reserved.