fipaos.parser.datamapping.script
Class AbstractScriptBinder

java.lang.Object
  |
  +--fipaos.parser.datamapping.script.AbstractScriptBinder
Direct Known Subclasses:
BATBinder, SHBinder

public abstract class AbstractScriptBinder
extends java.lang.Object

Abstract class to enable binding between a OS-specific scripting language & objects.

All properties (i.e. matching get/set pairs) in the object to be marshalled to/from should be of type String

Property names are determined by capitalising the first letter of a variable name, and setting the rest of the characters to lowercase

If the objects populated have the following methods defined, they will be used:

NOTE: The implementation of this class doesn't allow multiple lines which set the same variable to be edited.


Constructor Summary
AbstractScriptBinder()
           
 
Method Summary
protected abstract  boolean canDealWith(java.lang.String filename)
          Return true if an instance of this can deal with the contents of the given filename
protected abstract  java.lang.String convertFromScriptToName(java.lang.String line)
          Returns the name of the varible being set on the given line - returns null if no variable is defined on this line
protected abstract  java.lang.String convertFromScriptToValue(java.lang.String line)
          Returns the value of the varible being set on the given line - returns null if no variable is defined on this line
protected abstract  java.lang.String convertToScript(java.lang.String variable, java.lang.String value)
          Returns a line of script that will set the given variable to the given value
protected abstract  java.lang.String getTypeOf(java.lang.String filename)
          Return the type of class to populate for the given filename
protected static java.util.Map loadBindings(java.lang.String filename)
          Loads binding from the given filename (relative to package this is in)
protected static void registerWithDataMapperFactory(AbstractScriptBinder instance)
          Registers with the DataMapperFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractScriptBinder

public AbstractScriptBinder()
Method Detail

canDealWith

protected abstract boolean canDealWith(java.lang.String filename)
Return true if an instance of this can deal with the contents of the given filename

getTypeOf

protected abstract java.lang.String getTypeOf(java.lang.String filename)
Return the type of class to populate for the given filename

convertToScript

protected abstract java.lang.String convertToScript(java.lang.String variable,
                                                    java.lang.String value)
Returns a line of script that will set the given variable to the given value

convertFromScriptToName

protected abstract java.lang.String convertFromScriptToName(java.lang.String line)
Returns the name of the varible being set on the given line - returns null if no variable is defined on this line

convertFromScriptToValue

protected abstract java.lang.String convertFromScriptToValue(java.lang.String line)
Returns the value of the varible being set on the given line - returns null if no variable is defined on this line

loadBindings

protected static java.util.Map loadBindings(java.lang.String filename)
Loads binding from the given filename (relative to package this is in)

registerWithDataMapperFactory

protected static void registerWithDataMapperFactory(AbstractScriptBinder instance)
Registers with the DataMapperFactory