Mp3dings 
20100427

net.sourceforge.mp3dings.filter
Class BeanShellFilter

java.lang.Object
  extended by net.sourceforge.mp3dings.utils.Bean
      extended by net.sourceforge.mp3dings.filter.FilterBean
          extended by net.sourceforge.mp3dings.filter.BeanShellFilter
All Implemented Interfaces:
Serializable, Filter

public class BeanShellFilter
extends FilterBean

A filter that is based on a bean-shell script.

Version:
$Revision: 67 $ ($Date: 2007-10-23 10:45:08 +0200 (Di, 23 Okt 2007) $)
Author:
Moritz Ringler
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.mp3dings.utils.Bean
L_NO_ID, NO_ID, PROPERTY_ID, PROPERTY_NAME
 
Constructor Summary
BeanShellFilter()
           
BeanShellFilter(String filterMethodBody)
           
 
Method Summary
 boolean equals(Object o)
           
 Object filter(Object val)
          Filters the Object val.
 Exception getCompileError()
           
 String getMethodBody()
           
 int hashCode()
           
 boolean isSavable()
           
 void save(Preferences pref, String key)
           
 void setMethodBody(String filterMethodBody)
           
 
Methods inherited from class net.sourceforge.mp3dings.utils.Bean
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getConstraints, getId, getName, getPropertyChangeListeners, getPropertyChangeListeners, load, load, removePropertyChangeListener, removePropertyChangeListener, save, setId, setName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanShellFilter

public BeanShellFilter()

BeanShellFilter

public BeanShellFilter(String filterMethodBody)
Method Detail

setMethodBody

public void setMethodBody(String filterMethodBody)

getCompileError

public Exception getCompileError()

isSavable

public boolean isSavable()
Overrides:
isSavable in class Bean

save

public void save(Preferences pref,
                 String key)
Overrides:
save in class Bean
key - the key under which this bean is to be saved. This key must be a valid filename, so you should keep it as simple as possible.

getMethodBody

public String getMethodBody()

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

filter

public Object filter(Object val)
Filters the Object val.

Specified by:
filter in interface Filter
Specified by:
filter in class FilterBean
Parameters:
val - the object to filter
Returns:
the filtered object. It must be an instance of the class of val. Implementations should assure this with an assert statement such as

assert returnval == null || val == null || val.getClass().isInstance(returnval);


Mp3dings 
20100427