Autopsy 4.22.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
DefaultToEmptyNumberFormatter.java
Go to the documentation of this file.
1/*
2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
5 */
6package org.sleuthkit.autopsy.logicalimager.configuration;
7
8import java.text.NumberFormat;
9import java.text.ParseException;
10import javax.swing.text.NumberFormatter;
11
16final class DefaultToEmptyNumberFormatter extends NumberFormatter {
17
18 private static final long serialVersionUID = 1L;
19
25 DefaultToEmptyNumberFormatter(NumberFormat format) {
26 super(format);
27 }
28
29 @Override
30 public Object stringToValue(String string)
31 throws ParseException {
32 Object returnValue = null;
33 try {
34 returnValue = super.stringToValue(string);
35 } catch (ParseException ignored) {
36 //reset value to being empty since invalid value was entered
37 }
38 return returnValue;
39 }
40}

Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.