1
|
package eu.dnetlib.springutils.condbean.parser.ast;
|
2
|
|
3
|
import eu.dnetlib.springutils.condbean.PropertyFinder;
|
4
|
|
5
|
public class SysProperty extends AbstractUnaryExpression {
|
6
|
|
7
|
private PropertyFinder propertyFinder;
|
8
|
|
9
|
public SysProperty(final PropertyFinder propertyFinder, final LiteralNode expression) {
|
10
|
super(expression);
|
11
|
this.propertyFinder = propertyFinder;
|
12
|
}
|
13
|
|
14
|
@Override
|
15
|
public Object evaluate() {
|
16
|
if (propertyFinder == null)
|
17
|
return System.getProperty(((LiteralNode) getExpression()).getData());
|
18
|
|
19
|
return propertyFinder.getProperty(((LiteralNode) getExpression()).getData());
|
20
|
}
|
21
|
|
22
|
}
|