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

io.leopard.web.editor.IntegerEditor Maven / Gradle / Ivy

There is a newer version: 0.9.12
Show newest version
package io.leopard.web.editor;

import java.beans.PropertyEditorSupport;
@Deprecated
public class IntegerEditor extends PropertyEditorSupport {

	@Override
	public Object getValue() {
		Object value = super.getValue();
		if (value == null) {
			value = new Integer(0);
		}
		return value;
	}

	@Override
	public void setAsText(String text) throws IllegalArgumentException {
		if (text == null || text.length() == 0) {
			super.setValue(0);
		}
		else {
			super.setValue(Integer.parseInt(text));
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy