public abstract class MBExpression extends FunctionImpl
Expressions are represented as JSON arrays. The first element of an expression array is a string naming the expression operator, e.g. "*"or "case". Subsequent elements (if any) are the arguments to the expression. Each argument is either a literal value (a string, number, boolean, or null), or another expression array.
Modifier and Type | Field and Description |
---|---|
static List<String> |
colors |
static List<String> |
decisions |
static List |
featureData |
protected FilterFactory2 |
ff |
static List |
heatMap |
protected JSONArray |
json |
static List |
lookUp |
static List |
math |
protected String |
name |
protected MBObjectParser |
parse |
static List |
ramps |
static List |
string |
protected MBStyleTransformer |
transformer |
static List |
types |
static List |
variableBindings |
static List |
zoom |
functionName
NIL
Modifier | Constructor and Description |
---|---|
protected |
MBExpression(JSONArray json)
Please use factory method
create(JSONArray) |
Modifier and Type | Method and Description |
---|---|
static boolean |
canCreate(String name) |
static MBExpression |
create(JSONArray json)
Factory method used to produce the correct MBExpression subclass for the provided JSONArray.
|
abstract Expression |
getExpression()
Determines which expression to use.
|
String |
getName()
Gets the name of this function.
|
protected void |
throwInsufficientArgumentCount(String expression,
int argCount) |
protected void |
throwUnexpectedArgumentCount(String expression,
int argCount) |
static Expression |
transformExpression(JSONArray json)
Creates an MBExpression and calls the associated function.
|
Expression |
transformLiteral(Expression ex)
A function to evaluate a given parameter as an expression and use the MBStyleTransformer to
transform Mapbox tokens into CQL expressions.
|
accept, dispatchArguments, equals, evaluate, functionName, getFallbackValue, getFunctionName, getParameters, getParameterValue, getParameterValue, hashCode, setFallbackValue, setName, setParameters, toString
evaluate
evaluate
protected final JSONArray json
protected final String name
protected final FilterFactory2 ff
protected final MBObjectParser parse
protected final MBStyleTransformer transformer
public static final List featureData
public static final List heatMap
public static final List lookUp
public static final List math
public static final List ramps
public static final List string
public static final List types
public static final List variableBindings
public static final List zoom
protected MBExpression(JSONArray json)
create(JSONArray)
json
- definitionpublic String getName()
FunctionImpl
getName
in interface Function
getName
in class FunctionImpl
public static MBExpression create(JSONArray json)
json
- definitionpublic static boolean canCreate(String name)
public abstract Expression getExpression()
public Expression transformLiteral(Expression ex)
public static Expression transformExpression(JSONArray json)
protected void throwUnexpectedArgumentCount(String expression, int argCount) throws MBFormatException
MBFormatException
protected void throwInsufficientArgumentCount(String expression, int argCount) throws MBFormatException
MBFormatException
Copyright © 1996–2022 Geotools. All rights reserved.