当前位置: 首页>>代码示例>>Java>>正文


Java ConversionException类代码示例

本文整理汇总了Java中org.apache.wicket.util.convert.ConversionException的典型用法代码示例。如果您正苦于以下问题:Java ConversionException类的具体用法?Java ConversionException怎么用?Java ConversionException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ConversionException类属于org.apache.wicket.util.convert包,在下文中一共展示了ConversionException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convertInputToValue

import org.apache.wicket.util.convert.ConversionException; //导入依赖的package包/类
@Override
protected Serializable convertInputToValue() throws ConversionException {
	final Serializable bean = (Serializable) getBeanDescriptor().newBeanInstance();
	
	visitChildren(PropertyEditor.class, new IVisitor<PropertyEditor<Serializable>, PropertyEditor<Serializable>>() {

		@Override
		public void component(PropertyEditor<Serializable> object, IVisit<PropertyEditor<Serializable>> visit) {
			object.getPropertyDescriptor().setPropertyValue(bean, object.getConvertedInput());
			visit.dontGoDeeper();
		}
		
	});
	
	return bean;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:17,代码来源:ReflectionBeanEditor.java

示例2: convertInputToValue

import org.apache.wicket.util.convert.ConversionException; //导入依赖的package包/类
@Override
protected List<Serializable> convertInputToValue() throws ConversionException {
	if (get("listEditor").isVisible()) {
		List<Serializable> newList = newList();
		
		RepeatingView rows = (RepeatingView) get("listEditor").get("elements");
		for (Component row: rows) {
			Serializable element = newElement();
			newList.add(element);
			
			RepeatingView columns = (RepeatingView) row.get("properties");
			for (Component column: columns) {
				@SuppressWarnings("unchecked")
				PropertyEditor<Serializable> propertyEditor = (PropertyEditor<Serializable>) column.get("propertyEditor");

				propertyEditor.getPropertyDescriptor().setPropertyValue(element, propertyEditor.getConvertedInput());
			}
		}
		return newList;
	} else {
		return null;
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:24,代码来源:ConcreteListPropertyEditor.java

示例3: getConvertedValue

import org.apache.wicket.util.convert.ConversionException; //导入依赖的package包/类
@Override
public String getConvertedValue(String fieldValue, Locale locale) throws ConversionException {
    final LanguageInfo languageInfo = languageCodeUtils.decodeLanguageCodeString(fieldValue);

    if (languageInfo == null) {
        return null;
    } else {
        switch (languageInfo.getType()) {
            case CODE:
                return languageCodeUtils.getLanguageNameForLanguageCode(languageInfo.getValue());
            case NAME:
                return languageInfo.getValue();
            default:
                return null;
        }
    }
}
 
开发者ID:acdh-oeaw,项目名称:vlo-curation,代码行数:18,代码来源:FieldValueConverterProviderImpl.java

示例4: convertToObject

import org.apache.wicket.util.convert.ConversionException; //导入依赖的package包/类
@Override
public Map<String, String> convertToObject(String s, Locale locale) throws ConversionException {
    if (null == s) {
        return null;
    }
    Map<String, String> map = new HashMap<>();
    String[] kvList = s.trim().split(ListConverter.LIST_SPLIT_PATTERN);
    for (String kvString : kvList) {
        String[] kv = kvString.split(KEY_VALUE_SPLIT_PATTERN);
        if (2 == kv.length) {
            map.put(kv[0], kv[1]);
        } else if (1 != kv.length || !kv[0].isEmpty()) { // skip ;;
            throw new ConversionException("'" + kvString + "' is not a valid Map entry.");
        }
    }
    return map;
}
 
开发者ID:citlab,项目名称:Intercloud,代码行数:18,代码来源:MapConverter.java

示例5: convertValue

import org.apache.wicket.util.convert.ConversionException; //导入依赖的package包/类
@Override
protected List<F> convertValue(String[] values) throws ConversionException {
	if (values == null) {
		return Lists.newArrayList();
	} else {
		List<F> convertedValues = Lists.newArrayList();
		for (String value : values) {
			try {
				J convertedValue = OBJECT_MAPPER.readValue(value, getJsonType());
				convertedValues.add(convertValue(convertedValue));
			} catch (Exception e) {
				throw new ConversionException(e);
			}
		}
		return convertedValues;
	}
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:18,代码来源:ItemItField.java

示例6: convertToObject

import org.apache.wicket.util.convert.ConversionException; //导入依赖的package包/类
@Override
public CustomerProjectPartDto convertToObject(String value, Locale locale) throws ConversionException {
    if (value == null) {
        return null;
    }

    List<CustomerProjectPartDto> list = projects.getObject();
    for (CustomerProjectPartDto dto : list) {
        if (value.equals(convertToString(dto, locale))) {
            return dto;
        }
    }

    throw new ConversionException("DashboardProjectConverter.cantConvert").setSourceValue(value)
            .setTargetType(CustomerProjectPartDto.class)
            .setConverter(this)
            .setLocale(locale);
}
 
开发者ID:Evolveum,项目名称:gizmo-v3,代码行数:19,代码来源:PartAutoCompleteConverter.java

示例7: convertInputToValue

import org.apache.wicket.util.convert.ConversionException; //导入依赖的package包/类
@Override
protected List<String> convertInputToValue() throws ConversionException {
	List<String> userNames = new ArrayList<>();
	Collection<UserFacade> users = input.getConvertedInput();
	if (users != null) {
		for (UserFacade user: users)
			userNames.add(user.getName());
	} 
	return userNames;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:11,代码来源:UserMultiChoiceEditor.java

示例8: convertInputToValue

import org.apache.wicket.util.convert.ConversionException; //导入依赖的package包/类
@Override
protected String convertInputToValue() throws ConversionException {
	UserFacade user = input.getConvertedInput();
	if (user != null)
		return user.getName();
	else
		return null;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:9,代码来源:UserSingleChoiceEditor.java

示例9: convertInputToValue

import org.apache.wicket.util.convert.ConversionException; //导入依赖的package包/类
@Override
protected Boolean convertInputToValue() throws ConversionException {
	String stringValue = input.getConvertedInput();
	if ("yes".equals(stringValue))
		return true;
	else if ("no".equals(stringValue))
		return false;
	else
		return null;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:11,代码来源:NullableBooleanPropertyEditor.java

示例10: convertInputToValue

import org.apache.wicket.util.convert.ConversionException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected Serializable convertInputToValue() throws ConversionException {
	Component beanEditor = get(BEAN_EDITOR_ID);
	if (beanEditor.isVisible())
		return ((BeanEditor<Serializable>) beanEditor).getConvertedInput();
	else
		return null;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:10,代码来源:ReflectionPropertyEditor.java

示例11: convertInputToValue

import org.apache.wicket.util.convert.ConversionException; //导入依赖的package包/类
@Override
protected List<String> convertInputToValue() throws ConversionException {
	List<String> values = new ArrayList<>();
	for (String each: input.getConvertedInput())
		values.add(each);
	return values;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:8,代码来源:StringListPropertyEditor.java

示例12: convertInputToValue

import org.apache.wicket.util.convert.ConversionException; //导入依赖的package包/类
@Override
protected List<Serializable> convertInputToValue() throws ConversionException {
	if (get("listEditor").isVisible()) {
		List<Serializable> newList = newList();
		RepeatingView rows = (RepeatingView) get("listEditor").get("elements");
		for (Component row: rows) {
			@SuppressWarnings("unchecked")
			BeanEditor<Serializable> elementEditor = (BeanEditor<Serializable>) row.get("elementEditor");
			newList.add(elementEditor.getConvertedInput());
		}
		return newList;
	} else {
		return null;
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:16,代码来源:PolymorphicListPropertyEditor.java

示例13: convertInputToValue

import org.apache.wicket.util.convert.ConversionException; //导入依赖的package包/类
@Override
protected List<Enum<?>> convertInputToValue() throws ConversionException {
	List<Enum<?>> values = new ArrayList<>();
	
	for (String stringValue: input.getConvertedInput()) {
        for (Iterator<?> it = EnumSet.allOf(enumClass).iterator(); it.hasNext();) {
            Enum<?> value = (Enum<?>) it.next();
            if (value.toString().equals(stringValue)) { 
            	values.add(value);
            	break;
            }
        }
	}
       return values;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:16,代码来源:EnumListPropertyEditor.java

示例14: convertInputToValue

import org.apache.wicket.util.convert.ConversionException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected Serializable convertInputToValue() throws ConversionException {
	Component beanEditor = fragment.get(BEAN_EDITOR_ID);
	if (beanEditor instanceof BeanEditor) {
		return ((BeanEditor<Serializable>) beanEditor).getConvertedInput();
	} else {
		return null;
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:11,代码来源:PolymorphicPropertyEditor.java

示例15: convertInputToValue

import org.apache.wicket.util.convert.ConversionException; //导入依赖的package包/类
@Override
protected String convertInputToValue() throws ConversionException {
	if (input.getConvertedInput() != null) {
		if (inputAgain.getConvertedInput() == null)
			throw new ConversionException("Please confirm the password.");
		else if (!input.getConvertedInput().equals(inputAgain.getConvertedInput()))
			throw new ConversionException("Password and its confirmation should be identical.");
		else
			return input.getConvertedInput();
	} else if (inputAgain.getConvertedInput() != null) {
		throw new ConversionException("Password and its confirmation should be identical.");
	} else {
		return input.getConvertedInput();
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:16,代码来源:ConfirmativePasswordPropertyEditor.java


注:本文中的org.apache.wicket.util.convert.ConversionException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。