public class BasicUtils extends Object
Modifier and Type | Field and Description |
---|---|
static DecimalFormat |
df |
Constructor and Description |
---|
BasicUtils() |
Modifier and Type | Method and Description |
---|---|
static ISymbol |
combineSymbols(List<ISymbol> gsyms,
int geotype) |
static DataTypesManager |
datMan() |
static Integer |
getAlphaValue(SLDParameterValue valu)
Returns null if no data found
|
static Color |
getColor(SLDExpression valu) |
static Color |
getColor(SLDParameterValue valu)
Returns null if no data found
|
static List<SLDLiteral> |
getComparisonLiterals(List<SLDRule> rules) |
static Double |
getDouble(SLDParameterValue valu)
Returns null if no data found
|
static ISymbol |
getElseSymbol(List<SLDRule> rules) |
static String |
getFirstPropertyName(List<SLDRule> rules) |
static SLDUserStyle |
getFirstUserStyle(SLDLayer layer) |
static String |
getFormat(URL u) |
static int |
getGeometryTypeForSymbols(List<SLDSymbol> list)
Geometry.TYPES.POINT
Geometry.TYPES.CURVE
Geometry.TYPES.SURFACE
or
Geometry.TYPES.NULL if there is not consistency in the list
|
static SLDLiteral |
getLiteral(List<SLDExpression> exps) |
static Object |
getValue(SLDLiteral lit,
DataType dt)
Coerces literal value using the dataType
Returns null if coercion was not possible
|
static Map<Object,ISymbol> |
getValueToSymbol(List<SLDRule> rules,
DataType dt,
String pname)
Translates rules to a value-symbol correspondence.
|
static DataType |
guessDataType(List<SLDLiteral> lits)
Gets data type from literals.
|
static boolean |
isElse(SLDRule rule) |
static boolean |
isNumeric(SLDLiteral lit) |
static MapContextManager |
mapMan() |
static Color |
parseColor(String colorStr)
Input must be like "#fa5e02", "0x000", etc
|
static SLDConverterManager |
sldMan() |
static SLDSupportManager |
supMan() |
static SymbolManager |
syMan() |
static SymbologyManager |
symMan() |
static Color |
toColor(SLDExpression color) |
static Double |
toDouble(SLDExpression width) |
static String |
toHexadecimal(Color co,
int length,
String prefix)
Examples:
#ff0000
0x000000cd9983
Returns null is color is null
|
static String |
valueToString(Object val) |
public static DecimalFormat df
public static SLDConverterManager sldMan()
public static SLDSupportManager supMan()
public static SymbologyManager symMan()
public static SymbolManager syMan()
public static MapContextManager mapMan()
public static DataTypesManager datMan()
public static DataType guessDataType(List<SLDLiteral> lits)
lits
- public static Object getValue(SLDLiteral lit, DataType dt)
lit
- dt
- public static List<SLDLiteral> getComparisonLiterals(List<SLDRule> rules)
public static boolean isElse(SLDRule rule)
public static boolean isNumeric(SLDLiteral lit)
public static SLDUserStyle getFirstUserStyle(SLDLayer layer)
public static int getGeometryTypeForSymbols(List<SLDSymbol> list)
public static Double toDouble(SLDExpression width) throws UnsupportedSLDObjectException
UnsupportedSLDObjectException
public static Color parseColor(String colorStr)
hex
- public static String toHexadecimal(Color co, int length, String prefix)
co
- length
- prefix
- public static Color getColor(SLDParameterValue valu)
valu
- UnsupportedSLDObjectException
public static Color getColor(SLDExpression valu)
public static Double getDouble(SLDParameterValue valu) throws UnsupportedSLDObjectException
valu
- UnsupportedSLDObjectException
public static Integer getAlphaValue(SLDParameterValue valu) throws UnsupportedSLDObjectException
valu
- UnsupportedSLDObjectException
public static Color toColor(SLDExpression color) throws UnsupportedSLDObjectException
UnsupportedSLDObjectException
public static ISymbol getElseSymbol(List<SLDRule> rules) throws UnsupportedSLDObjectException
UnsupportedSLDObjectException
public static Map<Object,ISymbol> getValueToSymbol(List<SLDRule> rules, DataType dt, String pname) throws UnsupportedSLDObjectException
rules
- dt
- UnsupportedSLDObjectException
CoercionException
public static SLDLiteral getLiteral(List<SLDExpression> exps)