Revision 44154 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/expressionevaluator/DefaultFeatureAttributeEmulatorExpression.java
DefaultFeatureAttributeEmulatorExpression.java | ||
---|---|---|
46 | 46 |
private boolean valid; |
47 | 47 |
private String errorMessage; |
48 | 48 |
|
49 |
private boolean enableExceptions; |
|
50 |
|
|
49 | 51 |
private FilteredLogger logger; |
50 | 52 |
|
51 | 53 |
public DefaultFeatureAttributeEmulatorExpression() { |
... | ... | |
54 | 56 |
public DefaultFeatureAttributeEmulatorExpression(FeatureType featureType, Expression expression) { |
55 | 57 |
this.expression = expression; |
56 | 58 |
this.checkVars(featureType); |
59 |
this.enableExceptions = false; |
|
57 | 60 |
} |
58 | 61 |
|
59 | 62 |
private FilteredLogger getLogger() { |
... | ... | |
95 | 98 |
this.requiredFields = theUsedFields.toArray(new String[theUsedFields.size()]); |
96 | 99 |
} |
97 | 100 |
|
101 |
public boolean isEnableExceptions() { |
|
102 |
return enableExceptions; |
|
103 |
} |
|
104 |
|
|
105 |
public void setEnableExceptions(boolean enableExceptions) { |
|
106 |
this.enableExceptions = enableExceptions; |
|
107 |
} |
|
108 |
|
|
98 | 109 |
@Override |
99 | 110 |
public SymbolTable getSymbolTable() { |
100 | 111 |
if (this.symbolTable == null) { |
... | ... | |
130 | 141 |
Object result = this.expression.execute(this.getSymbolTable()); |
131 | 142 |
return result; |
132 | 143 |
} catch(Exception ex) { |
144 |
if( this.enableExceptions ) { |
|
145 |
throw ex; |
|
146 |
} |
|
133 | 147 |
this.getLogger().warn("Problems evaluating expression '"+this.expression.getPhrase()+"' with feature '"+feature.getReference().toString()+"'.", ex); |
134 | 148 |
return null; |
135 | 149 |
} |
Also available in: Unified diff