Package com.alibaba.citrus.service.requestcontext.util

Examples of com.alibaba.citrus.service.requestcontext.util.ValueList


     * @param key ������
     * @param defaultValue Ĭ��ֵ
     * @return ����ֵ
     */
    public Object getObject(String key, Object defaultValue) {
        ValueList container = getValueList(key, false);
        return container == null ? defaultValue : container.getValue(defaultValue);
    }
View Full Code Here


     *
     * @param key ������
     * @return ����ֵ������
     */
    public Object[] getObjects(String key) {
        ValueList container = getValueList(key, false);
        return container == null ? EMPTY_OBJECT_ARRAY : container.getValues();
    }
View Full Code Here

     * @param key ������
     * @param defaultValue Ĭ��ֵ
     * @return ����ֵ������
     */
    public Object[] getObjects(String key, Object[] defaultValue) {
        ValueList container = getValueList(key, false);
        return container == null ? defaultValue : container.getValues(defaultValue);
    }
View Full Code Here

    /**
     * ȡ��ָ�����͵Ķ���
     */
    <T> T getObjectOfType(String key, Class<T> type, boolean isPrimitive, MethodParameter methodParameter,
                          Object[] defaultValues) {
        ValueList container = getValueList(key, false);

        if (container == null) {
            container = new ValueListSupport(getTypeConverter(), requestContext.isConverterQuiet());

            if (!isEmptyArray(defaultValues)) {
                for (Object value : defaultValues) {
                    container.addValue(value);
                }
            }

            defaultValues = null;
        }

        return container.getValueOfType(type, isPrimitive, methodParameter, defaultValues);
    }
View Full Code Here

    protected ValueList getValueList(String key, boolean create) {
        String originalKey = key;

        key = convert(key);

        ValueList container = (ValueList) parameters.get(key);

        if (create) {
            if (container == null) {
                container = new ValueListSupport(getTypeConverter(), requestContext.isConverterQuiet());
                parameterKeys.put(key, originalKey);
                parameters.put(key, container);
            }

            return container;
        } else {
            if (container == null || container.size() == 0) {
                return null;
            } else {
                return container;
            }
        }
View Full Code Here

     *
     * @param key 参数名
     * @return 参数值
     */
    public boolean getBoolean(String key) {
        ValueList container = getValueList(key, false);
        return container == null ? false : container.getBooleanValue();
    }
View Full Code Here

     * @param key          参数名
     * @param defaultValue 默认值
     * @return 参数值
     */
    public boolean getBoolean(String key, boolean defaultValue) {
        ValueList container = getValueList(key, false);
        return container == null ? defaultValue : container.getBooleanValue(defaultValue);
    }
View Full Code Here

     *
     * @param key 参数名
     * @return 参数值
     */
    public byte getByte(String key) {
        ValueList container = getValueList(key, false);
        return container == null ? 0 : container.getByteValue();
    }
View Full Code Here

     * @param key          参数名
     * @param defaultValue 默认值
     * @return 参数值
     */
    public byte getByte(String key, byte defaultValue) {
        ValueList container = getValueList(key, false);
        return container == null ? defaultValue : container.getByteValue(defaultValue);
    }
View Full Code Here

     * @param key 参数名
     * @return 参数值的字节数组,如果参数不存在,则返回<code>null</code>
     * @throws UnsupportedEncodingException 如果指定了错误的编码字符集
     */
    public byte[] getBytes(String key) throws UnsupportedEncodingException {
        ValueList container = getValueList(key, false);
        return container == null ? EMPTY_BYTE_ARRAY : container.getBytes(getCharacterEncoding());
    }
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.service.requestcontext.util.ValueList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.