All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.fhframework.docs.converter.model.UserFormatter Maven / Gradle / Ivy

The newest version!
package pl.fhframework.docs.converter.model;

import org.springframework.beans.factory.annotation.Autowired;

import pl.fhframework.docs.converter.service.UserService;
import pl.fhframework.format.AutoRegisteredFormatter;
import pl.fhframework.format.FhFormatter;

import java.text.ParseException;
import java.util.Locale;

@FhFormatter
public class UserFormatter extends AutoRegisteredFormatter {

    @Autowired
    private UserService userService;

    @Override
    public User parse(String s, Locale locale) throws ParseException {
        return userService.findByLastName(s);
    }

    @Override
    public String print(User user, Locale locale) {
        return user.getLastName();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy