Gets the renderer of items in the comboboxes presenting the enum values.

@param enumConstants
@param mappedEnumComboBoxes
@param inputColumn

@return
324393
protected ListCellRenderer<? super EnumerationValue> getComboBoxRenderer(final InputColumn<?> inputColumn,
            final Map<InputColumn<?>, DCComboBox<EnumerationValue>> mappedEnumComboBoxes,
            final EnumerationValue[] enumConstants) {
        return new EnumComboBoxListRenderer();
    }
961485
public AnnotationValueBuilder<T> member(String name, @Nullable Enum<?>... enumObjs) {
        if (enumObjs != null) {
            values.put(name, enumObjs);
        }
        return this;
    }
97880
public static <E extends Enum<E>> List<E> computeEnum(List<EnumItem<E>> roleTagList, TransformMatrixDictionary<E> transformMatrixDictionary)
    {
        int length = roleTagList.size() - 1;
        List<E> tagList = new ArrayList<E>(roleTagList.size());
        double[][] cost = new double[2][];  // 滚动数组
        Iterator<EnumItem<E>> iterator = roleTagList.iterator();
        EnumItem<E> start = iterator.next();
        E pre = start.labelMap.entrySet().iterator().next().getKey();
        // 第一个是确定的
        tagList.add(pre);
        // 第二个也可以简单地算出来
        Set<E> preTagSet;
        {
            EnumItem<E> item = iterator.next();
            cost[0] = new double[item.labelMap.size()];
            int j = 0;
            for (E cur : item.labelMap.keySet())
            {
                cost[0][j] = transformMatrixDictionary.transititon_probability[pre.ordinal()][cur.ordinal()] - Math.log((item.getFrequency(cur) + 1e-8) / transformMatrixDictionary.getTotalFrequency(cur));
                ++j;
            }
            preTagSet = item.labelMap.keySet();
        }
        // 第三个开始复杂一些
        for (int i = 1; i < length; ++i)
        {
            int index_i = i & 1;
            int index_i_1 = 1 - index_i;
            EnumItem<E> item = iterator.next();
            cost[index_i] = new double[item.labelMap.size()];
            double perfect_cost_line = Double.MAX_VALUE;
            int k = 0;
            Set<E> curTagSet = item.labelMap.keySet();
            for (E cur : curTagSet)
            {
                cost[index_i][k] = Double.MAX_VALUE;
                int j = 0;
                for (E p : preTagSet)
                {
                    double now = cost[index_i_1][j] + transformMatrixDictionary.transititon_probability[p.ordinal()][cur.ordinal()] - Math.log((item.getFrequency(cur) + 1e-8) / transformMatrixDictionary.getTotalFrequency(cur));
                    if (now < cost[index_i][k])
                    {
                        cost[index_i][k] = now;
                        if (now < perfect_cost_line)
                        {
                            perfect_cost_line = now;
                            pre = p;
                        }
                    }
                    ++j;
                }
                ++k;
            }
            tagList.add(pre);
            preTagSet = curTagSet;
        }
        tagList.add(tagList.get(0));    // 对于最后一个##末##
        return tagList;
    }
1262715
public void setAvailableInputColumns(final Collection<InputColumn<?>> inputColumns) {
        final InputColumn<?>[] items = new InputColumn<?>[inputColumns.size() + 1];
        int index = 1;
        for (final InputColumn<?> inputColumn : inputColumns) {
            items[index] = inputColumn;
            index++;
        }
        final DefaultComboBoxModel<InputColumn<?>> model = new DefaultComboBoxModel<>(items);
        _comboBox.setModel(model);
    }
210288
protected EnumerationValue getSuggestedValue(final InputColumn<?> inputColumn) {
        final EnumMatcher<EnumerationValue> matcher = _enumMatcherRef.get();
        if (matcher == null) {
            return null;
        }
        return matcher.suggestMatch(inputColumn.getName());
    }
394331
public List<InputColumn<?>> getAvailableInputColumns(final Class<?> dataType) {
        final SourceColumnFinder finder = new SourceColumnFinder();
        finder.addSources(this);
        return finder.findInputColumns(dataType);
    }
1020213
function buildValueColumns(
  item,
  loadedDimensions,
  columnCombinations,
  dataSets
) {
  var thisColumnOptions = clone(item._columnOptions);
  thisColumnOptions.tableStructure = item._tableStructure;
  var columns = [];
  var hasNoConcepts = item._concepts.length === 0;
  var regionDimension = getDimensionById(
    loadedDimensions,
    item.regionDimensionId
  );
  var regionDimensionIndex = getDimensionIndexById(
    loadedDimensions,
    item.regionDimensionId
  );
  var timePeriodDimension = getDimensionById(
    loadedDimensions,
    item.timePeriodDimensionId
  );
  var timePeriodDimensionIndex = getDimensionIndexById(
    loadedDimensions,
    item.timePeriodDimensionId
  );

  var regionCount = defined(regionDimension)
    ? regionDimension.values.length
    : 1;
  var timePeriodCount = defined(timePeriodDimension)
    ? timePeriodDimension.values.length
    : 1;

  for (
    var combinationIndex = 0;
    combinationIndex < columnCombinations.ids.length;
    combinationIndex++
  ) {
    var ids = columnCombinations.ids[combinationIndex];
    var dimensionIndices = mapDimensionValueIdsToKeyValues(
      item,
      loadedDimensions,
      ids
    );
    // The name is just the joined names of all the columns involved, or 'value' if no columns still have names.
    var combinationName =
      columnCombinations.names[combinationIndex]
        .filter(function(name) {
          return !!name;
        })
        .join(" ") || "Value";
    var combinationId = ids.join(" ") || "Value";
    var values = [];
    for (
      var timePeriodIndex = 0;
      timePeriodIndex < timePeriodCount;
      timePeriodIndex++
    ) {
      for (var regionIndex = 0; regionIndex < regionCount; regionIndex++) {
        if (defined(regionDimensionIndex)) {
          dimensionIndices[regionDimensionIndex] =
            regionDimension.values[regionIndex].id;
        }
        if (defined(timePeriodDimensionIndex)) {
          dimensionIndices[timePeriodDimensionIndex] =
            timePeriodDimension.values[timePeriodIndex].id;
        }
        values.push(
          getObsValue(item, loadedDimensions, dimensionIndices, dataSets)
        );
      }
    }
    thisColumnOptions.id = combinationId; // So we can refer to the dimension in a template by a sequence of ids or names.
    var column = new TableColumn(combinationName, values, thisColumnOptions);
    if (hasNoConcepts) {
      // If there are no concepts displayed to the user, there is only one value column, and we won't add a "total" column.
      // So make this column active.
      column.isActive = true;
    }
    columns.push(column);
  }
  return columns;
}
198534
public static String getInputValueName(
            @Nullable final String inputPrefix,
            @Nonnull final BiMap<String, String> inputMapper,
            @Nonnull final String field) {
        String name = inputMapper == null ? null : inputMapper.inverse().get(field);
        if (name == null) {
            if (inputMapper != null && inputMapper.containsKey(field)) {
                throw new RuntimeException("field in keys");
            }
            final String[] defaultValues = {
                    Values.TASK_DIRECTORY_KEY, Values.CLIENT_HTTP_REQUEST_FACTORY_KEY,
                    Values.TEMPLATE_KEY, Values.PDF_CONFIG_KEY, Values.SUBREPORT_DIR_KEY,
                    Values.OUTPUT_FORMAT_KEY, Values.JOB_ID_KEY
            };
            if (inputPrefix == null || Arrays.asList(defaultValues).contains(field)) {
                name = field;
            } else {
                name = inputPrefix.trim() +
                        Character.toUpperCase(field.charAt(0)) +
                        field.substring(1);
            }
        }
        return name;
    }
260369
public static EnumConstantBuilder getInstance(Context context,
            ClassDoc classDoc, EnumConstantWriter writer) {
        return new EnumConstantBuilder(context, classDoc, writer);
    }
586853
public static MapMapping createMapMapping( List<Element> inputElements ){
        if( inputElements == null || inputElements.isEmpty() ){
            return null;
        }
        MapMapping result = new MapMapping();
        for( Element element : inputElements ){
            String name = element.getString( 1 );
            result.addEntryMapping( name, createInputMapping( element.getObject( 0 ) ) );
        }
        return result;
    }
1043977
public EnumModel findEnumModelByValue(String enumValue) {

        if (enums != null) {
            for (EnumModel enumModel : enums) {
                if (enumValue.equals(enumModel.getValue())) {
                    return enumModel;
                }
            }
        }
        return null;
    }
698891
@SuppressWarnings("unchecked")
	private JComboBox<HandleParametersOption> getComboHandleParameters() {
		if (handleParameters == null) {
			handleParameters = new JComboBox<>(new HandleParametersOption[] {
					HandleParametersOption.USE_ALL, HandleParametersOption.IGNORE_VALUE,
					HandleParametersOption.IGNORE_COMPLETELY });
			handleParameters.setRenderer(new HandleParametersOptionRenderer());
		}
		return handleParameters;
	}
210872
public static Map<String, Object> getNameFieldMap(Class<? extends Enum<?>> clazz, String fieldName) {
		final Enum<?>[] enums = clazz.getEnumConstants();
		if (null == enums) {
			return null;
		}
		final Map<String, Object> map = MapUtil.newHashMap(enums.length);
		for (Enum<?> e : enums) {
			map.put(e.name(), ReflectUtil.getFieldValue(e, fieldName));
		}
		return map;
	}
120964
public static TypeRepresentation ofEnum(final TypeIdentifier identifier, final String... enumValues) {
        return new EnumTypeRepresentation(identifier, new HashSet<>(Arrays.asList(enumValues)));
    }
1261985
@SuppressWarnings("unchecked")
    public static InputComponent createUIInput(UIProvider provider, InputComponentFactory factory, ConverterFactory converterFactory, String parentName, String name,
                                               Class inputClazz, String required, String currentValue, String defaultValue, String enums, String description,
                                               boolean promptInInteractiveMode, boolean multiValue, String prefix) {

        // is the current value a property placeholder, then we need to use a regular text based UI
        if (currentValue != null && currentValue.startsWith("{{") && currentValue.endsWith("}}")) {
            // switch over to plain string
            inputClazz = String.class;
            enums = null;
        }

        InputComponent input;
        if (enums != null) {
            UISelectOne ui = factory.createSelectOne(name, inputClazz);
            // the enums are comma separated
            List<String> enumValues = new ArrayList<>();
            String[] values = enums.split(",");
            for (String v : values) {
                enumValues.add(v.trim());
            }
            ui.setValueChoices(enumValues);
            if (defaultValue != null) {
                Object value = defaultValue;
                Converter converter = converterFactory.getConverter(String.class, inputClazz);
                if (converter != null) {
                    value = converter.convert(defaultValue);
                }
                ui.setDefaultValue(value);
            }
            if (currentValue != null) {
                Object value = currentValue;
                Converter converter = converterFactory.getConverter(String.class, inputClazz);
                if (converter != null) {
                    value = converter.convert(currentValue);
                }
                // set the value from the enum choices so the UI can indicate this correctly in the UI
                for (String v : enumValues) {
                    if (v.equalsIgnoreCase((String) value)) {
                        value = v;
                        break;
                    }
                }
                ui.setValue(value);
            }

            if ("true".equals(required) || promptInInteractiveMode) {
                // This will always prompt, regardless if there is a value set
                Iterator it = ui.getFacets().iterator();
                while (it.hasNext()) {
                    Object facet = it.next();
                    if (facet instanceof HintsFacet) {
                        ((HintsFacet) facet).setPromptInInteractiveMode(true);
                    }
                }
            }

            input = ui;
        } else {
            UIInput ui = factory.createInput(name, inputClazz);
            if (defaultValue != null) {
                Object value = defaultValue;
                Converter converter = converterFactory.getConverter(String.class, inputClazz);
                if (converter != null) {
                    value = converter.convert(defaultValue);
                }
                ui.setDefaultValue(value);
            }
            if (currentValue != null) {
                Object value = currentValue;
                Converter converter = converterFactory.getConverter(String.class, inputClazz);
                if (converter != null) {
                    value = converter.convert(currentValue);
                }
                ui.setValue(value);
            }

            if ("true".equals(required) || promptInInteractiveMode) {
                // This will always prompt, regardless if there is a value set
                Iterator it = ui.getFacets().iterator();
                while (it.hasNext()) {
                    Object facet = it.next();
                    if (facet instanceof HintsFacet) {
                        ((HintsFacet) facet).setPromptInInteractiveMode(true);
                    }
                }
            }

            input = ui;
        }

        if (Objects.equals("true", required)) {
            input.setRequired(true);
        }

        // if the name is "expression" then its a placeholder for the parent name to be used instead as label
        String label;
        if (name.equals("expression") && parentName != null) {
            label = asTitleCase(parentName + "Language");
        } else if (name.startsWith("expression_") && parentName != null) {
            // the expression may have a number of extra inputs we need to show as well
            String namePostfix = name.substring(11);
            // upper case the first char
            namePostfix = Character.toTitleCase(namePostfix.charAt(0)) + namePostfix.substring(1);
            label = asTitleCase(parentName + namePostfix);
        } else {
            label = asTitleCase(name);
        }
        if (multiValue) {
            label += " (multivalued)";
        }
        input.setLabel(label);

        if (!provider.isGUI()) {
            // no description in CLI/embedded as that clutters the shell
            input.setDescription("");
        } else {
            if (multiValue) {
                String extra = "This option is multi valued, which means you can provide multiple key/value pairs"
                        + " prefixed with " + prefix + " and separated with &, eg " + prefix + "foo=123&" + prefix + "bar=456";
                if (description == null) {
                    description = extra;
                } else {
                    if (description.endsWith(".")) {
                        description += " " + extra;
                    } else {
                        description += ". " + extra;
                    }
                }
            }
            // must use an empty description otherwise the GUI prints null
            input.setDescription(description != null ? description : "");
        }

        return input;
    }
277700
protected EnumMatcher<EnumerationValue> createEnumMatcher() {
        if (_mappedEnumsProperty instanceof EnumerationProvider) {
            return new DefaultEnumMatcher((EnumerationProvider) _mappedEnumsProperty);
        } else {
            @SuppressWarnings("unchecked") final Class<? extends Enum<?>> baseType =
                    (Class<? extends Enum<?>>) _mappedEnumsProperty.getBaseType();
            final EnumerationProvider prov = EnumerationValue.providerFromEnumClass(baseType);
            return new DefaultEnumMatcher(prov);
        }
    }
325510
static Class<?> getKeyTypeFromEnumMap(Object enumMap)
    {
        if (__keyTypeFromEnumMap == null)
        {
            throw new RuntimeException(
                    "Could not access (reflection) the private "
                            + "field *keyType* (enumClass) from: class java.util.EnumMap");
        }

        try
        {
            return (Class<?>) __keyTypeFromEnumMap.get(enumMap);
        }
        catch (Exception e)
        {
            throw new RuntimeException(e);
        }
    }