svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.expressionevaluator / org.gvsig.expressionevaluator.lib / org.gvsig.expressionevaluator.lib.impl / src / main / java / org / gvsig / expressionevaluator / impl / ExpressionEvaluatorImplLibrary.java @ 44669
History | View | Annotate | Download (2.86 KB)
1 | 43512 | jjdelcerro | package org.gvsig.expressionevaluator.impl; |
---|---|---|---|
2 | |||
3 | 43983 | jjdelcerro | import org.gvsig.expressionevaluator.DataTypes; |
4 | 43512 | jjdelcerro | import org.gvsig.expressionevaluator.ExpressionEvaluatorLibrary; |
5 | 43521 | jjdelcerro | import org.gvsig.expressionevaluator.ExpressionEvaluatorLocator; |
6 | 44139 | jjdelcerro | import org.gvsig.expressionevaluator.ExpressionEvaluatorManager; |
7 | 43983 | jjdelcerro | import org.gvsig.expressionevaluator.impl.coercion.CoerceToExpression; |
8 | import org.gvsig.expressionevaluator.impl.coercion.CoerceToString; |
||
9 | 44139 | jjdelcerro | import org.gvsig.expressionevaluator.impl.grammars.BasicGrammarFactory; |
10 | 44644 | jjdelcerro | import org.gvsig.expressionevaluator.impl.repr.ReprBoolean; |
11 | import org.gvsig.expressionevaluator.impl.repr.ReprCharSequence; |
||
12 | import org.gvsig.expressionevaluator.impl.repr.ReprDate; |
||
13 | import org.gvsig.expressionevaluator.impl.repr.ReprNumber; |
||
14 | 44139 | jjdelcerro | import org.gvsig.expressionevaluator.impl.symboltable.BasicImageSymbolTableFactory; |
15 | 44389 | jjdelcerro | import org.gvsig.expressionevaluator.impl.symboltable.FoldersSymbolTableFactory; |
16 | 44139 | jjdelcerro | import org.gvsig.expressionevaluator.impl.symboltable.ProgrammingSymbolTableFactory; |
17 | import org.gvsig.expressionevaluator.impl.symboltable.SQLSymbolTableFactory; |
||
18 | import org.gvsig.expressionevaluator.impl.symboltable.UtilsSymbolTableFactory; |
||
19 | 44006 | jjdelcerro | import org.gvsig.tools.ToolsLibrary; |
20 | 43983 | jjdelcerro | import org.gvsig.tools.ToolsLocator; |
21 | import org.gvsig.tools.dataTypes.DataTypesManager; |
||
22 | 43512 | jjdelcerro | import org.gvsig.tools.library.AbstractLibrary; |
23 | import org.gvsig.tools.library.LibraryException; |
||
24 | |||
25 | public class ExpressionEvaluatorImplLibrary extends AbstractLibrary { |
||
26 | |||
27 | @Override
|
||
28 | public void doRegistration() { |
||
29 | registerAsImplementationOf(ExpressionEvaluatorLibrary.class); |
||
30 | 44006 | jjdelcerro | require(ToolsLibrary.class); |
31 | 43512 | jjdelcerro | } |
32 | |||
33 | @Override
|
||
34 | protected void doInitialize() throws LibraryException { |
||
35 | 43521 | jjdelcerro | ExpressionEvaluatorLocator.registerManager(DefaultExpressionEvaluatorManager.class); |
36 | 43512 | jjdelcerro | } |
37 | |||
38 | @Override
|
||
39 | protected void doPostInitialize() throws LibraryException { |
||
40 | 44139 | jjdelcerro | ExpressionEvaluatorManager manager = ExpressionEvaluatorLocator.getManager(); |
41 | |||
42 | manager.registerSymbolTable(new SQLSymbolTableFactory());
|
||
43 | manager.registerSymbolTable(new UtilsSymbolTableFactory());
|
||
44 | manager.registerSymbolTable(new BasicImageSymbolTableFactory());
|
||
45 | manager.registerSymbolTable(new ProgrammingSymbolTableFactory());
|
||
46 | 44389 | jjdelcerro | manager.registerSymbolTable(new FoldersSymbolTableFactory());
|
47 | 44139 | jjdelcerro | |
48 | manager.registerGrammar(new BasicGrammarFactory());
|
||
49 | |||
50 | 43983 | jjdelcerro | DefaultExpression.registerPersistence(); |
51 | 43512 | jjdelcerro | |
52 | 43983 | jjdelcerro | DataTypesManager dataTypesManager = ToolsLocator.getDataTypesManager(); |
53 | |||
54 | 44669 | jjdelcerro | dataTypesManager.addCoercion(DataTypes.EXPRESSION, new CoerceToExpression());
|
55 | 44139 | jjdelcerro | dataTypesManager.addCoercion(DataTypes.STRING,new CoerceToString());
|
56 | 44592 | jjdelcerro | |
57 | ToolsLocator.registerScriptManager(DefaultExpressionEvaluatorManager.class); |
||
58 | 44644 | jjdelcerro | |
59 | ReprBoolean.selfRegister(); |
||
60 | ReprCharSequence.selfRegister(); |
||
61 | ReprNumber.selfRegister(); |
||
62 | ReprDate.selfRegister(); |
||
63 | |||
64 | 43512 | jjdelcerro | } |
65 | } |