com.editor.EducationEditor.java Source code

Java tutorial

Introduction

Here is the source code for com.editor.EducationEditor.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.editor;

import com.model.Education;
import com.service.EducationService;
import java.beans.PropertyEditorSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 *
 * @author Dries
 */
@Component
public class EducationEditor extends PropertyEditorSupport {

    @Autowired
    private EducationService educationService;

    @Override
    public void setAsText(String text) {
        Education education = this.educationService.getEducation(Integer.valueOf(text));
        this.setValue(education);
    }
}