Revision 44023
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/impl/DefaultDataManager.java | ||
---|---|---|
10 | 10 |
import java.util.Map; |
11 | 11 |
import org.apache.commons.lang3.StringUtils; |
12 | 12 |
import org.gvsig.expressionevaluator.Expression; |
13 |
import org.gvsig.expressionevaluator.ExpressionEvaluatorLocator; |
|
13 | 14 |
|
14 | 15 |
import org.gvsig.fmap.dal.DataFactory; |
15 | 16 |
import org.gvsig.fmap.dal.DataManager; |
... | ... | |
52 | 53 |
import org.gvsig.fmap.dal.feature.spi.cache.FeatureCacheProviderFactory; |
53 | 54 |
import org.gvsig.fmap.dal.feature.spi.index.FeatureIndexProvider; |
54 | 55 |
import org.gvsig.fmap.dal.feature.spi.index.FeatureIndexProviderServices; |
55 |
import org.gvsig.fmap.dal.impl.expressionevaluator.DefaultEvaluatorFactory; |
|
56 | 56 |
import org.gvsig.fmap.dal.impl.expressionevaluator.DefaultExpressionEvaluator; |
57 | 57 |
import org.gvsig.fmap.dal.impl.expressionevaluator.DefaultFeatureAttributeEmulatorExpression; |
58 | 58 |
import org.gvsig.fmap.dal.impl.expressionevaluator.DefaultFeatureSymbolTable; |
... | ... | |
73 | 73 |
import org.gvsig.tools.dynobject.DynStruct_v2; |
74 | 74 |
import org.gvsig.tools.dynobject.Tags; |
75 | 75 |
import org.gvsig.tools.evaluator.Evaluator; |
76 |
import org.gvsig.tools.evaluator.EvaluatorFactory; |
|
77 | 76 |
import org.gvsig.tools.exception.BaseException; |
78 | 77 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
79 | 78 |
import org.gvsig.tools.folders.FoldersManager; |
... | ... | |
86 | 85 |
public class DefaultDataManager |
87 | 86 |
implements DataManager, DataManagerProviderServices, Services { |
88 | 87 |
|
89 |
private static final Logger logger = LoggerFactory.getLogger(DefaultDataManager.class);
|
|
88 |
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultDataManager.class);
|
|
90 | 89 |
|
91 | 90 |
final static private String DATA_MANAGER_CACHE = "Data.manager.caches"; |
92 | 91 |
final static private String DATA_MANAGER_CACHE_DESCRIPTION = |
... | ... | |
129 | 128 |
|
130 | 129 |
private final Map<Integer, String> defaultDataIndexProviders; |
131 | 130 |
|
132 |
private EvaluatorFactory defaultEvaluatorFactory = null; |
|
133 |
|
|
134 | 131 |
private OpenErrorHandler openErrorHandler = null; |
135 | 132 |
|
136 | 133 |
private DataServerExplorerPool dataServerExplorerPool = null; |
... | ... | |
278 | 275 |
public DataStoreParameters createStoreParameters(String providerName) throws InitializeException, ProviderNotRegisteredException { |
279 | 276 |
if( providerName == null ) { |
280 | 277 |
String msg = "Provider name can't be null."; |
281 |
logger.warn(msg);
|
|
278 |
LOGGER.warn(msg);
|
|
282 | 279 |
throw new IllegalArgumentException(msg); |
283 | 280 |
} |
284 | 281 |
DataFactory providerFactory = this.getStoreProviderRegister().getFactory(providerName); |
285 | 282 |
if( providerFactory == null ) { |
286 | 283 |
String msg = "Can't locate provider factory for '"+providerName+"'."; |
287 |
logger.warn(msg);
|
|
284 |
LOGGER.warn(msg);
|
|
288 | 285 |
throw new IllegalArgumentException(msg); |
289 | 286 |
} |
290 | 287 |
return (DataStoreParameters) providerFactory.createParameters(); |
... | ... | |
304 | 301 |
public DataServerExplorerParameters createServerExplorerParameters(String explorerName) throws InitializeException, ProviderNotRegisteredException { |
305 | 302 |
if( explorerName == null ) { |
306 | 303 |
String msg = "Explorer name can't be null."; |
307 |
logger.warn(msg);
|
|
304 |
LOGGER.warn(msg);
|
|
308 | 305 |
throw new IllegalArgumentException(msg); |
309 | 306 |
} |
310 | 307 |
DataFactory explorerFactory = this.getServerExplorerRegister().getFactory(explorerName); |
311 | 308 |
if( explorerFactory == null ) { |
312 | 309 |
String msg = "Can't locate server explorer factory for '"+explorerName+"'."; |
313 |
logger.warn(msg);
|
|
310 |
LOGGER.warn(msg);
|
|
314 | 311 |
throw new IllegalArgumentException(msg); |
315 | 312 |
} |
316 | 313 |
DataServerExplorerParameters params = (DataServerExplorerParameters) explorerFactory.createParameters(); |
... | ... | |
336 | 333 |
public DataServerExplorer openServerExplorer(String explorerName, DataServerExplorerParameters parameters) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException { |
337 | 334 |
if( explorerName == null ) { |
338 | 335 |
String msg = "Explorer name can't be null."; |
339 |
logger.warn(msg);
|
|
336 |
LOGGER.warn(msg);
|
|
340 | 337 |
throw new IllegalArgumentException(msg); |
341 | 338 |
} |
342 | 339 |
DataFactory explorerFactory = this.getServerExplorerRegister().getFactory(explorerName); |
343 | 340 |
if( explorerFactory == null ) { |
344 | 341 |
String msg = "Can't locate server explorer factory for '"+explorerName+"'."; |
345 |
logger.warn(msg);
|
|
342 |
LOGGER.warn(msg);
|
|
346 | 343 |
throw new IllegalArgumentException(msg); |
347 | 344 |
} |
348 | 345 |
if (parameters == null) { |
... | ... | |
365 | 362 |
} |
366 | 363 |
if( explorerName == null ) { |
367 | 364 |
String msg = "Explorer name can't be null."; |
368 |
logger.warn(msg);
|
|
365 |
LOGGER.warn(msg);
|
|
369 | 366 |
throw new IllegalArgumentException(msg); |
370 | 367 |
} |
371 | 368 |
if( (arguments.length % 2)!= 0 ) { |
... | ... | |
416 | 413 |
public DataStore openStore(String providerName, DataStoreParameters parameters) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException { |
417 | 414 |
if( providerName == null ) { |
418 | 415 |
String msg = "Provider name can't be null."; |
419 |
logger.warn(msg);
|
|
416 |
LOGGER.warn(msg);
|
|
420 | 417 |
throw new IllegalArgumentException(msg); |
421 | 418 |
} |
422 | 419 |
SimpleIdentityManager identityManager = ToolsLocator.getIdentityManager(); |
... | ... | |
429 | 426 |
String storeName = this.getStoreName(parameters); |
430 | 427 |
if( StringUtils.isEmpty(storeName) ) { |
431 | 428 |
String msg = "Can't locate the store name from the parameters. parameters=" + parameters.toString(); |
432 |
logger.warn(msg);
|
|
429 |
LOGGER.warn(msg);
|
|
433 | 430 |
throw new IllegalArgumentException(msg); |
434 | 431 |
} |
435 | 432 |
|
436 | 433 |
DataStoreFactory_v2_4 storeFactory = (DataStoreFactory_v2_4) this.getStoreRegister().getFactory(storeName); |
437 | 434 |
if( storeFactory == null ) { |
438 | 435 |
String msg = "Can't locate store factory for '"+storeName+"'."; |
439 |
logger.warn(msg);
|
|
436 |
LOGGER.warn(msg);
|
|
440 | 437 |
throw new IllegalArgumentException(msg); |
441 | 438 |
} |
442 | 439 |
DataFactory providerFactory = this.getStoreProviderRegister().getFactory(providerName); |
443 | 440 |
if( providerFactory == null ) { |
444 | 441 |
String msg = "Can't locate provider factory for '"+providerName+"'."; |
445 |
logger.warn(msg);
|
|
442 |
LOGGER.warn(msg);
|
|
446 | 443 |
throw new IllegalArgumentException(msg); |
447 | 444 |
} |
448 | 445 |
|
... | ... | |
476 | 473 |
} |
477 | 474 |
if( providerName == null ) { |
478 | 475 |
String msg = "Provider name can't be null."; |
479 |
logger.warn(msg);
|
|
476 |
LOGGER.warn(msg);
|
|
480 | 477 |
throw new IllegalArgumentException(msg); |
481 | 478 |
} |
482 | 479 |
DataFactory providerFactory = this.getStoreProviderRegister().getFactory(providerName); |
... | ... | |
504 | 501 |
public DataStoreProviderFactory getStoreProviderFactory(String providerName) { |
505 | 502 |
if( providerName == null ) { |
506 | 503 |
String msg = "Provider name can't be null."; |
507 |
logger.warn(msg);
|
|
504 |
LOGGER.warn(msg);
|
|
508 | 505 |
throw new IllegalArgumentException(msg); |
509 | 506 |
} |
510 | 507 |
DataFactory providerFactory = this.getStoreProviderRegister().getFactory(providerName); |
... | ... | |
520 | 517 |
public List<String> getStoreProviders(String explorerName) { |
521 | 518 |
if( explorerName == null ) { |
522 | 519 |
String msg = "Explorer name can't be null."; |
523 |
logger.warn(msg);
|
|
520 |
LOGGER.warn(msg);
|
|
524 | 521 |
throw new IllegalArgumentException(msg); |
525 | 522 |
} |
526 | 523 |
try { |
... | ... | |
660 | 657 |
public void newStore(String explorerName, String providerName, NewDataStoreParameters parameters, boolean overwrite) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException { |
661 | 658 |
if( explorerName == null ) { |
662 | 659 |
String msg = "Explorer name can't be null."; |
663 |
logger.warn(msg);
|
|
660 |
LOGGER.warn(msg);
|
|
664 | 661 |
throw new IllegalArgumentException(msg); |
665 | 662 |
} |
666 | 663 |
if( providerName == null ) { |
667 | 664 |
String msg = "Provider name can't be null."; |
668 |
logger.warn(msg);
|
|
665 |
LOGGER.warn(msg);
|
|
669 | 666 |
throw new IllegalArgumentException(msg); |
670 | 667 |
} |
671 | 668 |
|
... | ... | |
684 | 681 |
} |
685 | 682 |
|
686 | 683 |
@Override |
687 |
public void registerDefaultEvaluator(EvaluatorFactory evaluatorFactory) { |
|
688 |
this.defaultEvaluatorFactory = evaluatorFactory; |
|
684 |
@Deprecated |
|
685 |
public Evaluator createExpresion(String expression) throws InitializeException { |
|
686 |
Expression exp = ExpressionEvaluatorLocator.getManager().createExpression(); |
|
687 |
exp.setPhrase(expression); |
|
688 |
return this.createExpresion(exp); |
|
689 | 689 |
} |
690 | 690 |
|
691 | 691 |
@Override |
692 |
public Evaluator createExpresion(String expression) throws InitializeException { |
|
693 |
return this.defaultEvaluatorFactory.createEvaluator(expression); |
|
692 |
@Deprecated |
|
693 |
public Evaluator createExpresion(Expression expression) throws InitializeException { |
|
694 |
DefaultExpressionEvaluator exp = new DefaultExpressionEvaluator(expression); |
|
695 |
return exp; |
|
694 | 696 |
} |
695 | 697 |
|
698 |
|
|
696 | 699 |
@Override |
697 |
public Evaluator createExpresion(Expression expression) throws InitializeException { |
|
700 |
public Evaluator createFilter(String expression) throws InitializeException { |
|
701 |
Expression exp = ExpressionEvaluatorLocator.getManager().createExpression(); |
|
702 |
exp.setPhrase(expression); |
|
703 |
return this.createFilter(exp); |
|
704 |
} |
|
705 |
|
|
706 |
@Override |
|
707 |
public Evaluator createFilter(Expression expression) throws InitializeException { |
|
698 | 708 |
DefaultExpressionEvaluator exp = new DefaultExpressionEvaluator(expression); |
699 | 709 |
return exp; |
700 | 710 |
} |
... | ... | |
916 | 926 |
} |
917 | 927 |
|
918 | 928 |
@Override |
919 |
public EvaluatorFactory createEvaluatorFactory() { |
|
920 |
EvaluatorFactory f = new DefaultEvaluatorFactory(); |
|
921 |
return f; |
|
922 |
} |
|
923 |
|
|
924 |
@Override |
|
925 | 929 |
public FeatureAttributeEmulatorExpression createFeatureAttributeEmulatorExpression(FeatureType type, Expression expression) { |
926 | 930 |
FeatureAttributeEmulatorExpression emulator = new DefaultFeatureAttributeEmulatorExpression(type, expression); |
927 | 931 |
return emulator; |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureStore.java | ||
---|---|---|
46 | 46 |
import org.apache.commons.io.FilenameUtils; |
47 | 47 |
import org.apache.commons.lang3.StringUtils; |
48 | 48 |
import org.cresques.cts.IProjection; |
49 |
import org.gvsig.expressionevaluator.Expression; |
|
49 | 50 |
|
50 | 51 |
import org.gvsig.fmap.dal.DALLocator; |
51 | 52 |
import org.gvsig.fmap.dal.DataManager; |
... | ... | |
1808 | 1809 |
} |
1809 | 1810 |
|
1810 | 1811 |
@Override |
1812 |
public FeatureSet getFeatureSet(Expression filter) throws DataException { |
|
1813 |
return this.getFeatureSet(filter, null, true); |
|
1814 |
} |
|
1815 |
|
|
1816 |
@Override |
|
1817 |
public FeatureSet getFeatureSet(Expression filter, String sortBy) throws DataException { |
|
1818 |
return this.getFeatureSet(filter, sortBy, true); |
|
1819 |
} |
|
1820 |
|
|
1821 |
@Override |
|
1822 |
public FeatureSet getFeatureSet(Expression filter, String sortBy, boolean asc) throws DataException { |
|
1823 |
FeatureQuery query = this.createFeatureQuery(); |
|
1824 |
if( filter!=null ) { |
|
1825 |
query.setFilter(filter); |
|
1826 |
} |
|
1827 |
if( !StringUtils.isEmpty(sortBy) ) { |
|
1828 |
query.getOrder().add(sortBy, asc); |
|
1829 |
} |
|
1830 |
return this.getFeatureSet(query); |
|
1831 |
} |
|
1832 |
|
|
1833 |
@Override |
|
1811 | 1834 |
public FeatureSet getFeatureSet(String filter, String sortBy, boolean asc) throws DataException { |
1812 | 1835 |
FeatureQuery query = this.createFeatureQuery(); |
1813 | 1836 |
if( !StringUtils.isEmpty(filter) ) { |
... | ... | |
1842 | 1865 |
} |
1843 | 1866 |
|
1844 | 1867 |
@Override |
1868 |
public List<Feature> getFeatures(Expression filter) { |
|
1869 |
return this.getFeatures(filter, null, true); |
|
1870 |
} |
|
1871 |
|
|
1872 |
@Override |
|
1873 |
public List<Feature> getFeatures(Expression filter, String sortBy) { |
|
1874 |
return this.getFeatures(filter, sortBy, true); |
|
1875 |
} |
|
1876 |
|
|
1877 |
@Override |
|
1878 |
public List<Feature> getFeatures(Expression filter, String sortBy, boolean asc) { |
|
1879 |
FeatureQuery query = this.createFeatureQuery(); |
|
1880 |
if( filter!=null ) { |
|
1881 |
query.setFilter(filter); |
|
1882 |
} |
|
1883 |
if( !StringUtils.isEmpty(sortBy) ) { |
|
1884 |
query.getOrder().add(sortBy, asc); |
|
1885 |
} |
|
1886 |
return this.getFeatures(query, 100); |
|
1887 |
} |
|
1888 |
|
|
1889 |
@Override |
|
1845 | 1890 |
public List<Feature> getFeatures(FeatureQuery query) { |
1846 | 1891 |
return this.getFeatures(query, 100); |
1847 | 1892 |
} |
... | ... | |
1884 | 1929 |
} |
1885 | 1930 |
|
1886 | 1931 |
@Override |
1932 |
public Feature findFirst(Expression filter) throws DataException { |
|
1933 |
return this.findFirst(filter, null, true); |
|
1934 |
} |
|
1935 |
|
|
1936 |
@Override |
|
1937 |
public Feature findFirst(Expression filter, String sortBy) throws DataException { |
|
1938 |
return this.findFirst(filter, sortBy, true); |
|
1939 |
} |
|
1940 |
|
|
1941 |
@Override |
|
1942 |
public Feature findFirst(Expression filter, String sortBy, boolean asc) throws DataException { |
|
1943 |
FeatureSet set = this.getFeatureSet(filter, sortBy, asc); |
|
1944 |
if( set==null || set.isEmpty() ) { |
|
1945 |
return null; |
|
1946 |
} |
|
1947 |
DisposableIterator it = set.iterator(); |
|
1948 |
Feature f = (Feature) it.next(); |
|
1949 |
it.dispose(); |
|
1950 |
return f; |
|
1951 |
} |
|
1952 |
|
|
1953 |
@Override |
|
1887 | 1954 |
public void accept(Visitor visitor) throws BaseException { |
1888 | 1955 |
FeatureSet set = getFeatureSet(); |
1889 | 1956 |
try { |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureQuery.java | ||
---|---|---|
31 | 31 |
import java.util.logging.Logger; |
32 | 32 |
import org.apache.commons.lang3.ArrayUtils; |
33 | 33 |
import org.apache.commons.lang3.StringUtils; |
34 |
import org.gvsig.expressionevaluator.Expression; |
|
34 | 35 |
import org.gvsig.fmap.dal.DALLocator; |
35 | 36 |
import org.gvsig.fmap.dal.DataTypes; |
36 | 37 |
import org.gvsig.fmap.dal.exception.DataException; |
... | ... | |
40 | 41 |
import org.gvsig.fmap.dal.feature.FeatureQueryOrder; |
41 | 42 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
42 | 43 |
import org.gvsig.fmap.dal.feature.FeatureType; |
44 |
import org.gvsig.fmap.dal.impl.expressionevaluator.DefaultExpressionEvaluator; |
|
43 | 45 |
import org.gvsig.tools.ToolsLocator; |
44 | 46 |
import org.gvsig.tools.dynobject.DynStruct; |
45 | 47 |
import org.gvsig.tools.evaluator.AndEvaluator; |
... | ... | |
329 | 331 |
} |
330 | 332 |
|
331 | 333 |
@Override |
334 |
public void setFilter(Expression filter) { |
|
335 |
Evaluator x = new DefaultExpressionEvaluator(filter); |
|
336 |
this.setFilter(x); |
|
337 |
} |
|
338 |
|
|
339 |
@Override |
|
332 | 340 |
public void setFilter(String filter) { |
333 | 341 |
if( StringUtils.isEmpty(filter) ) { |
334 | 342 |
this.clearFilter(); |
... | ... | |
364 | 372 |
} |
365 | 373 |
|
366 | 374 |
@Override |
375 |
public void addFilter(Expression filter) { |
|
376 |
Evaluator x = new DefaultExpressionEvaluator(filter); |
|
377 |
this.addFilter(x); |
|
378 |
} |
|
379 |
|
|
380 |
@Override |
|
367 | 381 |
public void addFilter(Evaluator evaluator) { |
368 | 382 |
if (evaluator == null) { |
369 | 383 |
return; |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/test/java/org/gvsig/fmap/dal/feature/DummyFetureStore.java | ||
---|---|---|
7 | 7 |
import java.util.Set; |
8 | 8 |
|
9 | 9 |
import org.cresques.cts.IProjection; |
10 |
import org.gvsig.expressionevaluator.Expression; |
|
10 | 11 |
|
11 | 12 |
import org.gvsig.fmap.dal.DataQuery; |
12 | 13 |
import org.gvsig.fmap.dal.DataServerExplorer; |
... | ... | |
649 | 650 |
|
650 | 651 |
@Override |
651 | 652 |
public List<Feature> getFeatures(FeatureQuery query) { |
652 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
|
653 |
return null;
|
|
653 | 654 |
} |
654 | 655 |
|
655 | 656 |
@Override |
656 | 657 |
public List<Feature> getFeatures(String filter) { |
657 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
|
658 |
return null;
|
|
658 | 659 |
} |
659 | 660 |
|
660 | 661 |
@Override |
661 | 662 |
public List<Feature> getFeatures(String filter, String sortBy) { |
662 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
|
663 |
return null;
|
|
663 | 664 |
} |
664 | 665 |
|
665 | 666 |
@Override |
666 | 667 |
public List<Feature> getFeatures(String filter, String sortBy, boolean asc) { |
667 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
|
668 |
return null;
|
|
668 | 669 |
} |
669 | 670 |
|
670 | 671 |
@Override |
671 | 672 |
public Feature findFirst(String filter) throws DataException { |
672 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
|
673 |
return null;
|
|
673 | 674 |
} |
674 | 675 |
|
675 | 676 |
@Override |
676 | 677 |
public Feature findFirst(String filter, String sortBy) throws DataException { |
677 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
|
678 |
return null;
|
|
678 | 679 |
} |
679 | 680 |
|
680 | 681 |
@Override |
681 | 682 |
public Feature findFirst(String filter, String sortBy, boolean asc) throws DataException { |
682 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
|
683 |
return null;
|
|
683 | 684 |
} |
684 | 685 |
|
685 | 686 |
@Override |
686 | 687 |
public FeatureReference getFeatureReference(String code) { |
687 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
|
688 |
return null;
|
|
688 | 689 |
} |
689 | 690 |
|
691 |
@Override |
|
692 |
public FeatureSet getFeatureSet(Expression filter) throws DataException { |
|
693 |
return null; |
|
694 |
} |
|
695 |
|
|
696 |
@Override |
|
697 |
public FeatureSet getFeatureSet(Expression filter, String sortBy) throws DataException { |
|
698 |
return null; |
|
699 |
} |
|
700 |
|
|
701 |
@Override |
|
702 |
public FeatureSet getFeatureSet(Expression filter, String sortBy, boolean asc) throws DataException { |
|
703 |
return null; |
|
704 |
} |
|
705 |
|
|
706 |
@Override |
|
707 |
public List<Feature> getFeatures(Expression filter) { |
|
708 |
return null; |
|
709 |
} |
|
710 |
|
|
711 |
@Override |
|
712 |
public List<Feature> getFeatures(Expression filter, String sortBy) { |
|
713 |
return null; |
|
714 |
} |
|
715 |
|
|
716 |
@Override |
|
717 |
public List<Feature> getFeatures(Expression filter, String sortBy, boolean asc) { |
|
718 |
return null; |
|
719 |
} |
|
720 |
|
|
721 |
@Override |
|
722 |
public Feature findFirst(Expression filter) throws DataException { |
|
723 |
return null; |
|
724 |
} |
|
725 |
|
|
726 |
@Override |
|
727 |
public Feature findFirst(Expression filter, String sortBy) throws DataException { |
|
728 |
return null; |
|
729 |
} |
|
730 |
|
|
731 |
@Override |
|
732 |
public Feature findFirst(Expression filter, String sortBy, boolean asc) throws DataException { |
|
733 |
return null; |
|
734 |
} |
|
735 |
|
|
690 | 736 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/DataManager.java | ||
---|---|---|
44 | 44 |
import org.gvsig.tools.dynobject.DynStruct; |
45 | 45 |
import org.gvsig.tools.dynobject.Tags; |
46 | 46 |
import org.gvsig.tools.evaluator.Evaluator; |
47 |
import org.gvsig.tools.evaluator.EvaluatorFactory; |
|
48 | 47 |
import org.gvsig.tools.exception.BaseException; |
49 | 48 |
import org.gvsig.tools.service.spi.Services; |
50 | 49 |
import org.gvsig.fmap.dal.expressionevaluator.FeatureAttributeEmulatorExpression; |
... | ... | |
281 | 280 |
*/ |
282 | 281 |
public List<String> getExplorerProviders(); |
283 | 282 |
|
284 |
/* |
|
285 |
* ====================================================================
|
|
283 |
/**
|
|
284 |
* Creates an instance of Evaluator that represents the given expression.
|
|
286 | 285 |
* |
287 |
* Expression evaluation related services |
|
286 |
* @param expression String containing a CQL expression. |
|
287 |
* @return instance of Evaluator representing the given expression. |
|
288 |
* @throws InitializeException |
|
289 |
* @deprecated use createFilter |
|
288 | 290 |
*/ |
291 |
public Evaluator createExpresion(String expression) |
|
292 |
throws InitializeException; |
|
293 |
|
|
289 | 294 |
/** |
290 |
* Registers the default expression evaluator. It is used by DAL to evaluate |
|
291 |
* and resolve query filters and expressions. |
|
295 |
* Creates an instance of Evaluator that represents the given expression. |
|
292 | 296 |
* |
293 |
* @param evaluatorFactory |
|
297 |
* @param expression a Expression with the filter |
|
298 |
* @return instance of Evaluator representing the given expression. |
|
299 |
* @throws InitializeException |
|
300 |
* @deprecated use createFilter |
|
294 | 301 |
*/ |
295 |
public void registerDefaultEvaluator(EvaluatorFactory evaluatorFactory); |
|
302 |
public Evaluator createExpresion(Expression expression) |
|
303 |
throws InitializeException; |
|
296 | 304 |
|
297 | 305 |
/** |
298 | 306 |
* Creates an instance of Evaluator that represents the given expression. |
... | ... | |
301 | 309 |
* @return instance of Evaluator representing the given expression. |
302 | 310 |
* @throws InitializeException |
303 | 311 |
*/ |
304 |
public Evaluator createExpresion(String expression)
|
|
312 |
public Evaluator createFilter(String expression)
|
|
305 | 313 |
throws InitializeException; |
306 | 314 |
|
307 |
public Evaluator createExpresion(Expression expression) |
|
315 |
/** |
|
316 |
* Creates an instance of Evaluator that represents the given expression. |
|
317 |
* |
|
318 |
* @param expression a Expression with the filter |
|
319 |
* @return instance of Evaluator representing the given expression. |
|
320 |
* @throws InitializeException |
|
321 |
*/ |
|
322 |
public Evaluator createFilter(Expression expression) |
|
308 | 323 |
throws InitializeException; |
309 | 324 |
|
310 |
public EvaluatorFactory createEvaluatorFactory(); |
|
311 |
|
|
312 | 325 |
/* |
313 | 326 |
* ==================================================================== |
314 | 327 |
* |
... | ... | |
434 | 447 |
* and is not advisable to use it. |
435 | 448 |
* |
436 | 449 |
* @return the ExpressionBuilder |
450 |
* @deprecated use ExpressionEvaluatorManager.createExpressionBuilder() |
|
437 | 451 |
*/ |
438 | 452 |
public ExpressionBuilder createExpressionBuilder(); |
439 | 453 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureStore.java | ||
---|---|---|
27 | 27 |
import java.util.List; |
28 | 28 |
|
29 | 29 |
import org.cresques.cts.IProjection; |
30 |
import org.gvsig.expressionevaluator.Expression; |
|
30 | 31 |
|
31 | 32 |
import org.gvsig.fmap.dal.DataServerExplorer; |
32 | 33 |
import org.gvsig.fmap.dal.DataStore; |
... | ... | |
211 | 212 |
|
212 | 213 |
FeatureSet getFeatureSet(String filter, String sortBy, boolean asc) throws DataException; |
213 | 214 |
|
215 |
FeatureSet getFeatureSet(Expression filter) throws DataException; |
|
216 |
|
|
217 |
FeatureSet getFeatureSet(Expression filter, String sortBy) throws DataException; |
|
218 |
|
|
219 |
FeatureSet getFeatureSet(Expression filter, String sortBy, boolean asc) throws DataException; |
|
214 | 220 |
/** |
215 | 221 |
* Returns a subset of features taking into account the properties and |
216 | 222 |
* restrictions of the FeatureQuery. |
... | ... | |
285 | 291 |
|
286 | 292 |
public List<Feature> getFeatures(String filter, String sortBy, boolean asc); |
287 | 293 |
|
294 |
public List<Feature> getFeatures(Expression filter); |
|
295 |
|
|
296 |
public List<Feature> getFeatures(Expression filter, String sortBy); |
|
297 |
|
|
298 |
public List<Feature> getFeatures(Expression filter, String sortBy, boolean asc); |
|
299 |
|
|
288 | 300 |
public Feature findFirst(String filter) throws DataException; |
289 | 301 |
|
290 | 302 |
public Feature findFirst(String filter, String sortBy) throws DataException; |
291 | 303 |
|
292 | 304 |
public Feature findFirst(String filter, String sortBy, boolean asc) throws DataException; |
293 | 305 |
|
306 |
public Feature findFirst(Expression filter) throws DataException; |
|
307 |
|
|
308 |
public Feature findFirst(Expression filter, String sortBy) throws DataException; |
|
309 |
|
|
310 |
public Feature findFirst(Expression filter, String sortBy, boolean asc) throws DataException; |
|
311 |
|
|
294 | 312 |
/** |
295 | 313 |
* Returns the feature given its reference. |
296 | 314 |
* |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureQuery.java | ||
---|---|---|
27 | 27 |
*/ |
28 | 28 |
package org.gvsig.fmap.dal.feature; |
29 | 29 |
|
30 |
import org.gvsig.expressionevaluator.Expression; |
|
30 | 31 |
import org.gvsig.fmap.dal.DataQuery; |
31 | 32 |
import org.gvsig.tools.evaluator.Evaluator; |
32 | 33 |
import org.gvsig.tools.lang.Cloneable; |
... | ... | |
183 | 184 |
*/ |
184 | 185 |
void setFilter(Evaluator filter); |
185 | 186 |
|
187 |
void setFilter(Expression filter); |
|
188 |
|
|
186 | 189 |
void setFilter(String filter); |
187 | 190 |
|
188 | 191 |
/** |
... | ... | |
196 | 199 |
*/ |
197 | 200 |
void addFilter(Evaluator filter); |
198 | 201 |
|
202 |
void addFilter(Expression filter); |
|
203 |
|
|
199 | 204 |
void addFilter(String filter); |
200 | 205 |
|
201 | 206 |
void clearFilter(); |
Also available in: Unified diff