|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.formulacompiler.runtime.FormulaRuntime org.formulacompiler.compiler.FormulaCompiler org.formulacompiler.spreadsheet.SpreadsheetCompiler
public class SpreadsheetCompiler
Static class defining factory methods for the various elements of AFC. This class is extends by
FormulaCompiler
which provides factory methods for the base
model-compiler-only elements. You normally use
newEngineBuilder()
to get an engine
builder with which to compile a new engine from a spreadsheet.
Field Summary |
---|
Fields inherited from class org.formulacompiler.compiler.FormulaCompiler |
---|
BIGDECIMAL_SCALE8, BIGDECIMAL_SCALE9, BIGDECIMAL128, BIGDECIMAL32, BIGDECIMAL64, DEFAULT_NUMERIC_TYPE, DOUBLE, LONG, LONG_SCALE4, LONG_SCALE6 |
Fields inherited from class org.formulacompiler.runtime.FormulaRuntime |
---|
UNDEFINED_SCALE |
Constructor Summary | |
---|---|
SpreadsheetCompiler()
|
Method Summary | |
---|---|
static SaveableEngine |
compileEngine(SpreadsheetBinding _binding,
NumericType _numericType,
boolean _fullCaching)
Same as compileEngine(SpreadsheetBinding, NumericType, Class, Method, boolean) ,
leaving the factory class and method unspecified. |
static SaveableEngine |
compileEngine(SpreadsheetBinding _binding,
NumericType _numericType,
java.lang.Class _factoryClass,
java.lang.reflect.Method _factoryMethod,
boolean _fullCaching)
Returns a new instance of a spreadsheet compiler, which is used to compile a spreadsheet representation, together with a binding associating cells with input and output methods, to an excecutable computation engine. |
static Spreadsheet |
loadSpreadsheet(java.io.File _file)
Loads a spreadsheet from a file and constructs an internal representation of it. |
static Spreadsheet |
loadSpreadsheet(java.io.File _file,
SpreadsheetLoader.Config _config)
Loads a spreadsheet from a file and constructs an internal representation of it. |
static Spreadsheet |
loadSpreadsheet(java.lang.String _originalFileName,
java.io.InputStream _stream)
Loads a spreadsheet from a file and constructs an internal representation of it. |
static Spreadsheet |
loadSpreadsheet(java.lang.String _originalFileName,
java.io.InputStream _stream,
SpreadsheetLoader.Config _config)
Loads a spreadsheet from a file and constructs an internal representation of it. |
static EngineBuilder |
newEngineBuilder()
Returns a new instance of an engine builder, which handles the most typical use-cases for compiling a spreadsheet to an computation engine. |
static SpreadsheetBinder |
newSpreadsheetBinder(SpreadsheetBinder.Config _config)
Returns a new instance of a spreadsheet binder, which is used to associate input and output cells of a spreadsheet with Java methods. |
static SpreadsheetBinder |
newSpreadsheetBinder(Spreadsheet _spreadsheet,
java.lang.Class _inputClass,
java.lang.Class _outputClass)
Returns a new instance of a spreadsheet binder, which is used to associate input and output cells of a spreadsheet with Java methods. |
static SpreadsheetBuilder |
newSpreadsheetBuilder()
Returns a new instance of a spreadsheet builder, which can be used to build a spreadsheet representation in memory from scratch. |
static SpreadsheetByNameBinder |
newSpreadsheetByNameBinder(SpreadsheetBinder _binder)
Returns a new instance of a spreadsheet binder utility class, which uses reflection and cell names defined in the spreadsheet to associate cells with methods. |
static SpreadsheetByNameBinder |
newSpreadsheetByNameBinder(SpreadsheetByNameBinder.Config _config)
Returns a new instance of a spreadsheet binder utility class, which uses reflection and cell names defined in the spreadsheet to associate cells with methods. |
static SpreadsheetNameCreator |
newSpreadsheetCellNameCreator(Spreadsheet.Sheet _sheet)
Returns a new instance of a spreadsheet cell name creator utility class, which names spreadsheet cells according to their row titles. |
static SpreadsheetToEngineCompiler |
newSpreadsheetCompiler(SpreadsheetToEngineCompiler.Config _config)
Returns a new instance of a spreadsheet compiler, which is used to compile a spreadsheet representation, together with a binding associating cells with input and output methods, to an excecutable computation engine. |
static SpreadsheetSaver |
newSpreadsheetSaver(SpreadsheetSaver.Config _config)
Returns a new instance of a spreadsheet saver, which is used to save a spreadsheet representation to a spreadsheet file (to give users a something to start with). |
static void |
saveSpreadsheet(Spreadsheet _model,
java.io.File _outputFile,
java.io.File _templateFileOrNull)
Saves a spreadsheet model to a new spreadsheet file. |
Methods inherited from class org.formulacompiler.compiler.FormulaCompiler |
---|
getNumericType, getNumericType, getNumericType, getNumericType, newCallFrame |
Methods inherited from class org.formulacompiler.runtime.FormulaRuntime |
---|
loadEngine, loadEngine |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpreadsheetCompiler()
Method Detail |
---|
public static EngineBuilder newEngineBuilder()
public static Spreadsheet loadSpreadsheet(java.io.File _file) throws java.io.FileNotFoundException, java.io.IOException, SpreadsheetException
_file
- is the file to load.
java.io.FileNotFoundException
java.io.IOException
SpreadsheetException
public static Spreadsheet loadSpreadsheet(java.io.File _file, SpreadsheetLoader.Config _config) throws java.io.FileNotFoundException, java.io.IOException, SpreadsheetException
_file
- is the file to load._config
- configures the loader; can be set to null
.
java.io.FileNotFoundException
java.io.IOException
SpreadsheetException
public static Spreadsheet loadSpreadsheet(java.lang.String _originalFileName, java.io.InputStream _stream) throws java.io.IOException, SpreadsheetException
loadSpreadsheet(String, InputStream, org.formulacompiler.spreadsheet.SpreadsheetLoader.Config)
with _config
set to null
.
_originalFileName
- is the name of the spreadsheet file to which the input stream
corresponds._stream
- is the stream from which to load the spreadsheet.
java.io.IOException
SpreadsheetException
public static Spreadsheet loadSpreadsheet(java.lang.String _originalFileName, java.io.InputStream _stream, SpreadsheetLoader.Config _config) throws java.io.IOException, SpreadsheetException
_originalFileName
- is the name of the spreadsheet file to which the input stream
corresponds._stream
- is the stream from which to load the spreadsheet._config
- configures the loader; can be set to null
.
java.io.IOException
SpreadsheetException
public static SpreadsheetBuilder newSpreadsheetBuilder()
public static void saveSpreadsheet(Spreadsheet _model, java.io.File _outputFile, java.io.File _templateFileOrNull) throws java.io.IOException, SpreadsheetException
_model
- is the internal spreadsheet model that defines the file to be written. Use
newSpreadsheetBuilder()
to build this model._outputFile
- is the spreadsheet file to be written. Its extension is used to determine
the file format to write (.xls for Excel, etc.)._templateFileOrNull
- is an optional template file. If not null, AFC uses it to format
the generated cells (again, see the tutorial for details).
java.io.IOException
SpreadsheetException
public static SpreadsheetSaver newSpreadsheetSaver(SpreadsheetSaver.Config _config)
_config
- contains the configuration for the new instance.
public static SpreadsheetBinder newSpreadsheetBinder(Spreadsheet _spreadsheet, java.lang.Class _inputClass, java.lang.Class _outputClass)
_spreadsheet
- see
SpreadsheetBinder.Config.spreadsheet
._inputClass
- see
SpreadsheetBinder.Config.inputClass
._outputClass
- see
SpreadsheetBinder.Config.outputClass
.
newSpreadsheetByNameBinder(SpreadsheetBinder)
public static SpreadsheetBinder newSpreadsheetBinder(SpreadsheetBinder.Config _config)
_config
- contains the configuration data for the new instance.
newSpreadsheetByNameBinder(org.formulacompiler.spreadsheet.SpreadsheetByNameBinder.Config)
public static SpreadsheetByNameBinder newSpreadsheetByNameBinder(SpreadsheetBinder _binder)
_binder
- see
SpreadsheetByNameBinder.Config.binder
.
public static SpreadsheetByNameBinder newSpreadsheetByNameBinder(SpreadsheetByNameBinder.Config _config)
_config
- contains the configuration for the new instance.
public static SpreadsheetNameCreator newSpreadsheetCellNameCreator(Spreadsheet.Sheet _sheet)
SpreadsheetByNameBinder
.
_sheet
- is the single sheet of a spreadsheet representation in which to name cells.
public static SaveableEngine compileEngine(SpreadsheetBinding _binding, NumericType _numericType, java.lang.Class _factoryClass, java.lang.reflect.Method _factoryMethod, boolean _fullCaching) throws CompilerException, EngineException
_binding
- see
SpreadsheetToEngineCompiler.Config.binding
._numericType
- see
SpreadsheetToEngineCompiler.Config.numericType
._factoryClass
- see
SpreadsheetToEngineCompiler.Config.factoryClass
._factoryMethod
- see
SpreadsheetToEngineCompiler.Config.factoryMethod
._fullCaching
- see
SpreadsheetToEngineCompiler.Config.fullCaching
.
CompilerException
EngineException
public static SaveableEngine compileEngine(SpreadsheetBinding _binding, NumericType _numericType, boolean _fullCaching) throws CompilerException, EngineException
compileEngine(SpreadsheetBinding, NumericType, Class, Method, boolean)
,
leaving the factory class and method unspecified.
CompilerException
EngineException
public static SpreadsheetToEngineCompiler newSpreadsheetCompiler(SpreadsheetToEngineCompiler.Config _config)
_config
- contains the configuration for the new instance.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |