public class Util extends Object
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static AnchorPoint |
anchor(Object value,
Factory factory)
Parses an anchor tuple.
|
static Expression |
color(Object value,
Factory factory)
Parses a color from string representation.
|
static <T> T |
defaultForNull(T... options)
Returns the first non-null parameter or null.
|
static Displacement |
displacement(Object value,
Factory factory)
Parses an displacement tuple.
|
static Expression |
expression(String value,
boolean safe,
Factory factory)
Parses an expression from its string representation.
|
static Expression |
expression(String value,
Factory factory)
Parses an expression from its string representation.
|
static float[] |
floatArray(String value)
Parses a float array from a space delimited list.
|
static <T> T |
forceDefaultForNull(T... options)
Returns the first non-null parameter or throws NullPointerException.
|
static ZoomContext |
getNamedZoomContext(String name,
List<ZoomContextFinder> zCtxtFinders)
Finds an applicable
ZoomContext based on a name |
static Object |
makeNumberIfPossible(String str) |
static String |
removeExpressionBrackets(String s)
Removes up to one set of ${ } expression brackets from a YSLD string.
|
static String |
serializeColor(Color c)
Serializes a Java
Color to a String representation of the format "#RRGGBB" |
static List<Expression> |
splitConcatenates(Expression expr)
Splits an
Expression into a list of expressions by removing ConcatenateFunction and FilterFunction_strConcat Functions, and listing the children
of those functions. |
static String |
stripQuotes(String str) |
static Expression |
unwrapConcatenates(Expression expr,
Factory factory)
Simplifies an
Expression which may contain multiple ConcatenateFunction into
a single top-level ConcatenateFunction with a flat list of parameters. |
static Map<String,String> |
vendorOptions(YamlMap sourceMap)
Parse all vendor options (keys starting with 'x-')
|
public static Expression expression(String value, Factory factory)
public static Expression unwrapConcatenates(Expression expr, Factory factory)
Expression
which may contain multiple ConcatenateFunction
into
a single top-level ConcatenateFunction
with a flat list of parameters.
If the passed Expression
performs no concatenation, it is returned as-is. If the
passed Expression
represents an empty value, a Literal
expression with value
null is returned.
expr
- factory
- Function factorypublic static List<Expression> splitConcatenates(Expression expr)
Expression
into a list of expressions by removing ConcatenateFunction
and FilterFunction_strConcat
Functions, and listing the children
of those functions. This is applied recursively, so nested Expressions are also handled.
Null-valued or empty Literal
Expressions are removed.expr
- public static Expression expression(String value, boolean safe, Factory factory)
The safe parameter when set to true will cause null to be returned when the string can not be parsed as a ECQL expression. When false it will result in an exception thrown back.
public static AnchorPoint anchor(Object value, Factory factory)
public static Displacement displacement(Object value, Factory factory)
public static Expression color(Object value, Factory factory)
public static float[] floatArray(String value)
@SafeVarargs @Nullable public static <T> T defaultForNull(@Nullable T... options)
@SafeVarargs public static <T> T forceDefaultForNull(@Nullable T... options)
@Nullable public static ZoomContext getNamedZoomContext(String name, List<ZoomContextFinder> zCtxtFinders)
ZoomContext
based on a namename
- Name of the ZoomContext.zCtxtFinders
- List of finders for the ZoomContext
ZoomContext
matching the name.IllegalArgumentException
- If name is "EPSG:4326", "EPSG:3857", or "EPSG:900913" (These
names cause ambiguities).public static String removeExpressionBrackets(String s)
s
- public static Object makeNumberIfPossible(String str)
public static String serializeColor(Color c)
Color
to a String representation of the format "#RRGGBB"c
- Colorpublic static String stripQuotes(String str)
Copyright © 1996–2019 Geotools. All rights reserved.