获取配置项 Item

@param confForm

@return
484352
@NoAuth
    @RequestMapping(value = "/item", method = RequestMethod.GET)
    @ResponseBody
    public ValueVo getItem(ConfForm confForm) {

        LOG.info(confForm.toString());

        //
        // 校验
        //
        ConfigFullModel configModel = null;
        try {
            configModel = configValidator4Fetch.verifyConfForm(confForm, false);
        } catch (Exception e) {
            LOG.warn(e.toString());
            return ConfigUtils.getErrorVo(e.getMessage());
        }

        return configFetchMgr.getConfItemByParameter(configModel.getApp().getId(), configModel.getEnv().getId(),
                configModel.getVersion(), configModel.getKey());
    }
946193
public String getStringOf(final String param, final List<String> possibleValues) {
    checkNotNull(possibleValues);
    checkArgument(!possibleValues.isEmpty());

    final String value = getString(param);

    if (possibleValues.contains(value)) {
      return value;
    } else {
      throw new InvalidEnumeratedPropertyException(fullString(param), value, possibleValues);
    }
  }
1240495
private static void loadConf(String confFile) {
        InputStream in = WordConfTools.class.getClassLoader().getResourceAsStream(confFile);
        if(in == null){
            LOGGER.info("未找到配置文件："+confFile);
            return;
        }
        LOGGER.info("加载配置文件："+confFile);
        loadConf(in);
    }
345245
function getConstraintsFunction(constraints) {
  var s = [];
  constraints.forEach(function (item) {
    if (item.type !== 1) { //1为系统类型，这里需要过滤出系统内置类型，只返回用户定义的规则函数
      // 在函数体直接调用系统预置的方法, 在最前面追加两个参数, 值都为 null
      var body = item.function;
      s.push('var ' + item.name + ' = function(){' + body + '};');
    }
  });
  return s;
}
135368
function(item)
	{
		var items = conbo.toArray(arguments);
		
		if (items.length)
		{
			this.source.push.apply(this.source, this.__applyItemClass(items));
			this.__updateBindings(items);
			this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.ADD));
			this.dispatchChange('length');
		}
		
		return this.length;
	}
1154232
private List<WComponent> getComponentsForTerm(final String term) {
		List<WComponent> childList = content.getComponentModel().getChildren();
		List<WComponent> result = new ArrayList<>();

		if (childList != null) {
			for (int i = 0; i < childList.size(); i++) {
				WComponent child = childList.get(i);

				if (term.equals(child.getTag())) {
					result.add(child);
				}
			}
		}

		return result;
	}
1067910
@SuppressWarnings("unchecked")
    private static Object putIfNotExist(Object data, Map<String, Object> resultMap) {
        LOG.info("[RuleController]补全信息时:data = " + data);
        if (data == null) {
            return resultMap;
        } else if (!(data instanceof Collection) && !(data instanceof Map)) {//既不是map也不是list,需要显示地配置出最后一个unit的返回结果列表
            return resultMap;
        } else if (data instanceof Map) {
            putToMap((Map) data, resultMap);
            return data;
        } else/* if (data instanceof Collection)*/ {
            Collection newCollection = new ArrayList<>();
            Collection listData = (Collection) data;
            for (Object o : listData) {
                newCollection.add(putIfNotExist(o, resultMap));
            }
            return newCollection;
        }
    }
827594
@SuppressWarnings("all")
    private static <T> T toNonCollectionType(Object data, Class<T> nonCollectionType) {
        if (Collection.class.isAssignableFrom(nonCollectionType)) {
            throw new RuntimeException("API使用错误，本方法不支持将目标对象转为非集合类型");
        }
        if (data == null) {
            return Defaults.defaultValue(nonCollectionType);
        }
        if (data.getClass().isArray()) {
            data = ArrayUtil.toList(data);
        }
        if (data instanceof Collection) {
            Collection collection = (Collection) data;
            if (nonCollectionType == String.class) {
                return (T) JSON.toJSONString(collection);
            }
            if (collection.isEmpty()) {
                return null;
            }
            if (collection.size() >= 2) {
                LOG.warn(new Throwable(String.format("集合 【 %s 】  的元素个数不只一个,我们只取出第一个做转换", data)));
            }
            for (Object element : collection) {
                LOG.debug("集合的第一个元素会被转为目标类型");
                return transferNonCollection(element, nonCollectionType);
            }
        } else {
            return transferNonCollection(data, nonCollectionType);
        }
        throw castFailedException(data, nonCollectionType);
    }
725919
static TypedConstant getConstant(Object value) {
        if (value == null) {
            return CstKnownNull.THE_ONE;
        } else if (value instanceof Boolean) {
            return CstBoolean.make((Boolean) value);
        } else if (value instanceof Byte) {
            return CstByte.make((Byte) value);
        } else if (value instanceof Character) {
            return CstChar.make((Character) value);
        } else if (value instanceof Double) {
            return CstDouble.make(Double.doubleToLongBits((Double) value));
        } else if (value instanceof Float) {
            return CstFloat.make(Float.floatToIntBits((Float) value));
        } else if (value instanceof Integer) {
            return CstInteger.make((Integer) value);
        } else if (value instanceof Long) {
            return CstLong.make((Long) value);
        } else if (value instanceof Short) {
            return CstShort.make((Short) value);
        } else if (value instanceof String) {
            return new CstString((String) value);
        } else if (value instanceof Class) {
            return new CstType(TypeId.get((Class<?>) value).ropType);
        } else if (value instanceof TypeId) {
            return new CstType(((TypeId) value).ropType);
        } else {
            throw new UnsupportedOperationException("Not a constant: " + value);
        }
    }
895543
public List<Product> searchFor(final Optional<String> searchTerm) {
        if (searchTerm.isPresent()) {
            return products
                    .stream()
                    .filter(matchingProductsFor(searchTerm.get()))
                    .collect(toList());
        } else {
            return products;
        }

    }
709357
function( config ) {
		
		for( var key in lm.config.itemDefaultConfig ) {
			if( config[ key ] === undefined ) {
				config[ key ] = lm.config.itemDefaultConfig[ key ];
			}
		}
		
		return config;
	}
113688
public static boolean hasDefaultConstructor(TypeRef item) {
        DefinitionRepository repository =  DefinitionRepository.getRepository();
        TypeDef def = repository.getDefinition(item);
        if (def == null && item instanceof ClassRef) {
            def = ((ClassRef)item).getDefinition();
        }
        return hasDefaultConstructor(def);
    }
282057
@SuppressWarnings("unchecked")
    static <T> T[] getEnumConstants(Class<T> enm) {
        return Stream.of(enm.getFields())
                .filter(f -> f.getType() == enm)
                .map(f -> {
            try {
                return f.get(null);
            } catch (Exception e) {
                return null;
            }
        })
        .filter(Objects::nonNull)
        .toArray(len -> (T[]) Array.newInstance(enm, len));
    }
649129
public static <A extends ModelAdapter<Model, Item>, Model, Item extends IItem> DiffUtil.DiffResult calculateDiff(final A adapter, final List<Item> items, final DiffCallback<Item> callback) {
        return calculateDiff(adapter, items, callback, true);
    }
1301060
public ConfigurationItem getConfigurationItem(final String key) {
    if(key==null || key.trim().isEmpty()) throw new IllegalArgumentException("The passed key was null or empty");
    return getConfigurationItemByKey(configItemsByKey, key);
  }
308791
public static Factor product(List<Factor> factors) {
    return product(factors.toArray(new Factor[factors.size()]));
  }
784750
function()
	{
		if (!this.length) return;
		
		var item = this.source.pop();
		
		this.__updateBindings(item, false);
		this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.REMOVE));
		this.dispatchChange('length');
		
		return item;
	}