
com.vaadin.ui.declarative.converters.DesignObjectConverter Maven / Gradle / Ivy
/*
* Vaadin Framework 7
*
* Copyright (C) 2000-2024 Vaadin Ltd
*
* This program is available under Vaadin Commercial License and Service Terms.
*
* See for the full
* license.
*/
package com.vaadin.ui.declarative.converters;
import java.util.Locale;
import com.vaadin.data.util.converter.Converter;
import com.vaadin.ui.declarative.DesignAttributeHandler;
/**
* An converter for Object to/from String for {@link DesignAttributeHandler} to
* use internally.
*
* @since 7.4
* @author Vaadin Ltd
*/
public class DesignObjectConverter implements Converter {
@Override
public Object convertToModel(String value,
Class extends Object> targetType, Locale locale)
throws com.vaadin.data.util.converter.Converter.ConversionException {
return value;
}
@Override
public String convertToPresentation(Object value,
Class extends String> targetType, Locale locale)
throws com.vaadin.data.util.converter.Converter.ConversionException {
if (value == null) {
return null;
}
return value.toString();
}
@Override
public Class
© 2015 - 2025 Weber Informatics LLC | Privacy Policy