src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundlerParamInfo.java
branchJDK-8200758-branch
changeset 57181 d10b861e8d62
parent 57106 ea870b9ce89a
child 57256 d7c27451f759
equal deleted inserted replaced
57180:1d6f8a7c6d5a 57181:d10b861e8d62
    49      * The command line and hashmap name of the parameter
    49      * The command line and hashmap name of the parameter
    50      */
    50      */
    51     String id;
    51     String id;
    52 
    52 
    53     /**
    53     /**
    54      * Type of the parameter.
    54      * Type of the parameter
    55      */
    55      */
    56     Class<T> valueType;
    56     Class<T> valueType;
       
    57 
       
    58     /**
       
    59      * Indicates if value was set using default value function
       
    60      */
       
    61     boolean isDefaultValue;
    57 
    62 
    58     /**
    63     /**
    59      * If the value is not set, and no fallback value is found,
    64      * If the value is not set, and no fallback value is found,
    60      * the parameter uses the value returned by the producer.
    65      * the parameter uses the value returned by the producer.
    61      */
    66      */
    90         return valueType;
    95         return valueType;
    91     }
    96     }
    92 
    97 
    93     void setValueType(Class<T> valueType) {
    98     void setValueType(Class<T> valueType) {
    94         this.valueType = valueType;
    99         this.valueType = valueType;
       
   100     }
       
   101 
       
   102     boolean getIsDefaultValue() {
       
   103         return isDefaultValue;
    95     }
   104     }
    96 
   105 
    97     Function<Map<String, ? super Object>, T> getDefaultValueFunction() {
   106     Function<Map<String, ? super Object>, T> getDefaultValueFunction() {
    98         return defaultValueFunction;
   107         return defaultValueFunction;
    99     }
   108     }
   142 
   151 
   143         if (invokeDefault && (getDefaultValueFunction() != null)) {
   152         if (invokeDefault && (getDefaultValueFunction() != null)) {
   144             T result =  getDefaultValueFunction().apply(params);
   153             T result =  getDefaultValueFunction().apply(params);
   145             if (result != null) {
   154             if (result != null) {
   146                 params.put(getID(), result);
   155                 params.put(getID(), result);
       
   156                 isDefaultValue = true;
   147             }
   157             }
   148             return result;
   158             return result;
   149         }
   159         }
   150 
   160 
   151         // ultimate fallback
   161         // ultimate fallback