本文整理了Java中javax.faces.convert.Converter.getAsObject()
方法的一些代码示例,展示了Converter.getAsObject()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Converter.getAsObject()
方法的具体详情如下:
包路径:javax.faces.convert.Converter
类名称:Converter
方法名:getAsObject
[英]Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Process Validations phase of the request processing lifecycle.
[中]将与指定UIComponent关联的指定字符串值转换为适合在请求处理生命周期的流程验证阶段存储的模型数据对象。
代码示例来源:origin: primefaces/primefaces
@Override
public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException {
Editor editor = (Editor) component;
String value = (String) submittedValue;
Converter converter = ComponentUtils.getConverter(context, component);
if (converter != null) {
return converter.getAsObject(context, editor, value);
}
return value;
}
}
代码示例来源:origin: primefaces/primefaces
@Override
public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException {
Converter converter = ComponentUtils.getConverter(context, component);
if (converter != null) {
String convertableValue = submittedValue == null ? null : submittedValue.toString();
return converter.getAsObject(context, component, convertableValue);
}
else {
return submittedValue;
}
}
代码示例来源:origin: primefaces/primefaces
private Object convertValue(FacesContext context, String submittedItemValue) {
Converter converter = ComponentUtils.getConverter(context, this);
if (converter == null) {
return submittedItemValue;
}
else {
return converter.getAsObject(context, this, submittedItemValue);
}
}
代码示例来源:origin: primefaces/primefaces
@Override
public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException {
TextEditor editor = (TextEditor) component;
String value = (String) submittedValue;
Converter converter = ComponentUtils.getConverter(context, component);
if (converter != null) {
return converter.getAsObject(context, editor, value);
}
return value;
}
}
代码示例来源:origin: primefaces/primefaces
private Object convertValue(FacesContext context, String submittedItemValue) {
Converter converter = ComponentUtils.getConverter(context, this);
if (converter == null) {
return submittedItemValue;
}
else {
return converter.getAsObject(context, this, submittedItemValue);
}
}
}
代码示例来源:origin: primefaces/primefaces
@SuppressWarnings("unchecked")
public void populateModel(FacesContext context, String[] values, List model) {
Converter converter = getConverter();
if (values != null) {
for (String item : values) {
if (LangUtils.isValueBlank(item)) {
continue;
}
Object convertedValue = converter != null ? converter.getAsObject(context, this, item) : item;
if (convertedValue != null) {
model.add(convertedValue);
}
}
}
}
}
代码示例来源:origin: primefaces/primefaces
@Override
public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException {
Chips chips = (Chips) component;
if (submittedValue == null || submittedValue.equals("")) {
return null;
}
Converter converter = ComponentUtils.getConverter(context, component);
String[] values = (String[]) submittedValue;
List list = new ArrayList();
for (String value : values) {
if (isValueBlank(value)) {
continue;
}
Object convertedValue = converter != null ? converter.getAsObject(context, chips, value) : value;
if (convertedValue != null) {
list.add(convertedValue);
}
}
return list;
}
}
代码示例来源:origin: primefaces/primefaces
compareValue = converter.getAsObject(context, component, (String) compareValue);
代码示例来源:origin: primefaces/primefaces
@Override
public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue)
throws ConverterException {
String submittedValueString = (String) submittedValue;
if (LangUtils.isValueBlank(submittedValueString)) {
return null;
}
Converter converter = ComponentUtils.getConverter(context, component);
if (converter != null) {
return converter.getAsObject(context, component, submittedValueString);
}
return submittedValue;
}
代码示例来源:origin: primefaces/primefaces
@Override
public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException {
AutoComplete ac = (AutoComplete) component;
if (submittedValue == null || submittedValue.equals("") || ac.isMoreTextRequest(context)) {
return null;
}
Converter converter = ComponentUtils.getConverter(context, component);
if (ac.isMultiple()) {
String[] values = (String[]) submittedValue;
List list = new ArrayList();
for (String value : values) {
if (isValueBlank(value)) {
continue;
}
Object convertedValue = converter != null ? converter.getAsObject(context, ac, value) : value;
if (convertedValue != null) {
list.add(convertedValue);
}
}
return list;
}
else {
if (converter != null) {
return converter.getAsObject(context, component, (String) submittedValue);
}
else {
return submittedValue;
}
}
}
代码示例来源:origin: primefaces/primefaces
@Override
@SuppressWarnings("unchecked")
public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException {
try {
OrderList ol = (OrderList) component;
List orderedList = new ArrayList();
Converter converter = ol.getConverter();
String[] values = (String[]) submittedValue;
for (String item : values) {
if (isValueBlank(item)) {
continue;
}
Object convertedValue = converter != null ? converter.getAsObject(context, ol, item) : item;
if (convertedValue != null) {
orderedList.add(convertedValue);
}
}
return orderedList;
}
catch (Exception exception) {
throw new ConverterException(exception);
}
}
代码示例来源:origin: primefaces/primefaces
Object obj = calendar.getConverter().getAsObject(context, calendar, value.toString());
if (obj instanceof Date) {
return (Date) obj;
Object obj = converter.getAsObject(context, calendar, value.toString());
if (obj instanceof Date) {
return (Date) obj;
代码示例来源:origin: primefaces/primefaces
@Override
public void decode(FacesContext context, UIComponent component) {
ColorPicker colorPicker = (ColorPicker) component;
if (!shouldDecode(colorPicker)) {
return;
}
String paramName = colorPicker.getClientId(context) + "_input";
Map<String, String> params = context.getExternalContext().getRequestParameterMap();
if (params.containsKey(paramName)) {
String submittedValue = params.get(paramName);
if (!COLOR_HEX_PATTERN.matcher(submittedValue).matches()) {
return;
}
Converter converter = colorPicker.getConverter();
if (converter != null) {
colorPicker.setSubmittedValue(
converter.getAsObject(context, component, submittedValue));
}
else {
colorPicker.setSubmittedValue(submittedValue);
}
}
}
代码示例来源:origin: primefaces/primefaces
Converter converter = uicalendar.getConverter();
if (converter != null) {
return converter.getAsObject(context, uicalendar, submittedValue);
Converter converter = context.getApplication().createConverter(type);
if (converter != null) {
return converter.getAsObject(context, uicalendar, submittedValue);
代码示例来源:origin: org.apache.myfaces.core/myfaces-impl
public Object getAsObject(FacesContext context, UIComponent component,
String value) throws ConverterException
{
return converter.getAsObject(context, component, value);
}
代码示例来源:origin: org.primefaces/primefaces
private Object convertValue(FacesContext context, String submittedItemValue) {
Converter converter = ComponentUtils.getConverter(context, this);
if(converter == null)
return submittedItemValue;
else
return converter.getAsObject(context, this, submittedItemValue);
}
代码示例来源:origin: org.primefaces/primefaces
@Override
public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException {
TextEditor editor = (TextEditor) component;
String value = (String) submittedValue;
Converter converter = ComponentUtils.getConverter(context, component);
if (converter != null) {
return converter.getAsObject(context, editor, value);
}
return value;
}
}
代码示例来源:origin: org.primefaces/primefaces
private Object convertValue(FacesContext context, String submittedItemValue) {
Converter converter = ComponentUtils.getConverter(context, this);
if(converter == null)
return submittedItemValue;
else
return converter.getAsObject(context, this, submittedItemValue);
}
public String resolveWidgetVar() {
代码示例来源:origin: TheCoder4eu/BootsFaces-OSP
@Override
public Object getConvertedValue(FacesContext fc, UIComponent c, Object sval) throws ConverterException {
Converter cnv = resolveConverter(fc, c, sval);
if (cnv != null) {
return cnv.getAsObject(fc, c, (String) sval);
} else {
cnv = new DoubleConverter();
return cnv.getAsObject(fc, c, (String) sval);
}
}
代码示例来源:origin: org.apache.myfaces.core/myfaces-impl
public Object getAsObject(FacesContext facesContext, UIComponent component,
String value)
{
return _getDelegate().getAsObject(facesContext, component, value);
}
内容来源于网络,如有侵权,请联系作者删除!