Changeset 7103 in josm
- Timestamp:
- 2014-05-11T01:32:10+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r7099 r7103 45 45 static @interface NullableArguments {} 46 46 47 private static final List<Method> arrayFunctions; 48 private static final List<Method> parameterFunctions; 49 private static final List<Method> parameterFunctionsEnv; 47 private static final List<Method> arrayFunctions = new ArrayList<>(); 48 private static final List<Method> parameterFunctions = new ArrayList<>(); 49 private static final List<Method> parameterFunctionsEnv = new ArrayList<>(); 50 50 51 51 static { 52 arrayFunctions = new ArrayList<>();53 parameterFunctions = new ArrayList<>();54 parameterFunctionsEnv = new ArrayList<>();55 52 for (Method m : Functions.class.getDeclaredMethods()) { 56 53 Class<?>[] paramTypes = m.getParameterTypes(); 57 54 if (paramTypes.length == 1 && paramTypes[0].isArray()) { 58 55 arrayFunctions.add(m); 56 } else if (paramTypes.length >= 1 && paramTypes[0].equals(Environment.class)) { 57 parameterFunctionsEnv.add(m); 59 58 } else { 60 if (paramTypes[0].equals(Environment.class)) { 61 parameterFunctionsEnv.add(m); 62 } else { 63 parameterFunctions.add(m); 64 } 59 parameterFunctions.add(m); 65 60 } 66 61 } … … 98 93 /** 99 94 * List of functions that can be used in MapCSS expressions. 100 * 95 * 101 96 * First parameter can be of type {@link Environment} (if needed). This is 102 97 * automatically filled in by JOSM and the user only sees the remaining … … 280 275 return Utils.color_int2float(c.getAlpha()); 281 276 } 282 277 283 278 /** 284 279 * Assembles the strings to one. … … 736 731 } 737 732 } 738 733 739 734 /** 740 735 * Function that takes a certain number of argument with specific type. … … 762 757 public Object evaluate(Environment env) { 763 758 Object[] convertedArgs; 764 759 765 760 if (needsEnvironment) { 766 761 convertedArgs = new Object[args.size()+1];
Note:
See TracChangeset
for help on using the changeset viewer.