org.joone.util
Class AbstractConverterPlugIn
- java.lang.Object
-
- org.joone.util.AbstractConverterPlugIn
-
- All Implemented Interfaces:
- java.io.Serializable, PlugInListener
- Direct Known Subclasses:
- ConverterPlugIn, OutputConverterPlugIn
public abstract class AbstractConverterPlugIn extends java.lang.Object implements java.io.Serializable, PlugInListener
This abstract class must be extended to implement plug-ins for input or output data pre- or post-processing.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description AbstractConverterPlugIn()Creates a new instance of AbstractConverterPlugInAbstractConverterPlugIn(java.lang.String anAdvancedSerieSelector)Creates a new instance of AbstractConverterPlugIn
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description booleanaddPlugIn(AbstractConverterPlugIn aNewPlugIn)Adds a plug-in at the end of the list of plug-ins.voidaddPlugInListener(PlugInListener aListener)Adds anPlugInListenerto this plug-in.java.util.TreeSetcheck(java.util.TreeSet checks)This method is called to perform a check on this converter's properties to ensure there are no errors or problems.voidconvertPatterns()Converts all the patterns contained byInputVectorand on the serie specifed by the call tosetAdvancedSerieSelector#setAdvancedSerieSelector.voiddataChanged(PlugInEvent anEvent)This method is called by plug-ins whenever data is changed.java.lang.StringgetAdvancedSerieSelector()Gets the AdvancedSerieSelector.java.lang.StringgetName()Gets the name of this plug-in object.AbstractConverterPlugIngetNextPlugIn()Gets the next converter plug-in within this cascading series of plug-ins.booleanisConnected()Getter for property connected.voidremoveAllPlugIns()Removes (and disconnects) all (cascading) plug ins.voidremovePlugInListener(PlugInListener aListener)Removes aPlugInListenerthat was previously registered to receive plugin (data changed) events.voidsetAdvancedSerieSelector(java.lang.String aNewSerieSelector)Sets the AdvancedSerieSelector for this plugin.voidsetConnected(boolean aConnected)Setter for property connected.voidsetInputVector(java.util.Vector newInputVector)Sets the input vector ofPatternsthat this converter plugin should process.voidsetName(java.lang.String aName)Sets the name of this plug-in object.booleansetNextPlugin(AbstractConverterPlugIn aNewNextPlugIn)Deprecated.voidsetNextPlugIn(AbstractConverterPlugIn newNextPlugIn)Added for XML serialization
-
-
-
Constructor Detail
-
AbstractConverterPlugIn
public AbstractConverterPlugIn()
Creates a new instance of AbstractConverterPlugIn
-
AbstractConverterPlugIn
public AbstractConverterPlugIn(java.lang.String anAdvancedSerieSelector)
Creates a new instance of AbstractConverterPlugIn- Parameters:
anAdvancedSerieSelector- the advanced serie selector to use.- See Also:
setAdvancedSerieSelector()
-
-
Method Detail
-
convertPatterns
public void convertPatterns()
Converts all the patterns contained byInputVectorand on the serie specifed by the call tosetAdvancedSerieSelector#setAdvancedSerieSelector. It cascades also the conversion to the next-plugin connected in the chain.
-
getName
public java.lang.String getName()
Gets the name of this plug-in object.- Returns:
- The name of this plug-in.
-
setName
public void setName(java.lang.String aName)
Sets the name of this plug-in object.- Parameters:
aName- New name for this object.
-
isConnected
public boolean isConnected()
Getter for property connected. This property is true when this plugin has been attached either to a StreamInputSynapse or to another plugin.- Returns:
- Value of property connected.
-
setConnected
public void setConnected(boolean aConnected)
Setter for property connected. This property is true when this plugin has been attached either to a StreamInputSynapse or to another plugin.- Parameters:
aConnected- New value of property connected.
-
addPlugInListener
public void addPlugInListener(PlugInListener aListener)
Adds anPlugInListenerto this plug-in. Usually this will be the previous plug-in in the series of cascading plug-ins or the stream input/output synapse.- Parameters:
aListener- The listener that requires notification of events from this plug-in whenever data changes.
-
removePlugInListener
public void removePlugInListener(PlugInListener aListener)
Removes aPlugInListenerthat was previously registered to receive plugin (data changed) events.- Parameters:
aListener- The listener that does not want to receive any events anymore from this plug-in.
-
dataChanged
public void dataChanged(PlugInEvent anEvent)
Description copied from interface:PlugInListenerThis method is called by plug-ins whenever data is changed.- Specified by:
dataChangedin interfacePlugInListener- Parameters:
anEvent- the event that is send, i.e. the event indicating that the data is changed.
-
getAdvancedSerieSelector
public java.lang.String getAdvancedSerieSelector()
Gets the AdvancedSerieSelector.- Returns:
- Value of property AdvancedSerieSelector.
-
setAdvancedSerieSelector
public void setAdvancedSerieSelector(java.lang.String aNewSerieSelector)
Sets the AdvancedSerieSelector for this plugin.The AdvancedSerieSelector instructs this plug-in what serie/columns it should process. The format of this specification is a common seperated list of values and ranges. E.g '1,2,5,7' will instruct the converter to convert serie 1 and 2 and 5 and 7. A range can also be used e.g '2,4,5-8,9' will instruct the converter to process serie 2 and 4 and 5 and 6 and 7 and 8 and 9. A range is specifed using a '-' character with the number of the serie on either side.
Note NO negative numbers can be used in the
AdvancedSerieSelector.- Parameters:
aNewSerieSelector- New value for theAdvancedSerieSelector.
-
addPlugIn
public boolean addPlugIn(AbstractConverterPlugIn aNewPlugIn)
Adds a plug-in at the end of the list of plug-ins.- Parameters:
aNewPlugIn- the new plug in to add at the end of plug ins.- Returns:
truewhen the plug in is added succesfully,falsewhen the plug in is not added, e.g. in case the plug in is already added / connected to another synapse / plug-in.
-
removeAllPlugIns
public void removeAllPlugIns()
Removes (and disconnects) all (cascading) plug ins.
-
setNextPlugin
public boolean setNextPlugin(AbstractConverterPlugIn aNewNextPlugIn)
Deprecated.addPlugIn(AbstractConverterPlugIn)Sets the next plug-in in a cascading series of plugins.- Parameters:
aNewNextPlugIn- The next plug-in in the series.- Returns:
truewhen the plug-in is successfully added,falseotherwise.
-
getNextPlugIn
public AbstractConverterPlugIn getNextPlugIn()
Gets the next converter plug-in within this cascading series of plug-ins.- Returns:
- the next plug-in within this cascading series of plug-ins.
-
setNextPlugIn
public void setNextPlugIn(AbstractConverterPlugIn newNextPlugIn)
Added for XML serialization**** DO NOT USE ****
-
setInputVector
public void setInputVector(java.util.Vector newInputVector)
Sets the input vector ofPatternsthat this converter plugin should process.- Parameters:
newInputVector- The vector of Pattern objects to process.
-
check
public java.util.TreeSet check(java.util.TreeSet checks)
This method is called to perform a check on this converter's properties to ensure there are no errors or problems. If there is an error or problem with one of the properties then the issues are returned in aTreeSetobject.- Parameters:
checks- ATreeSetof issues that should be added to by this plug-in.- Returns:
- A
TreeSetof errors or problems relating to the setup of this converter plug-in object. - See Also:
Synapse
-
-
DataMelt 3.0 © DataMelt by jWork.ORG