Example usage for java.text Format parseObject

List of usage examples for java.text Format parseObject

Introduction

In this page you can find the example usage for java.text Format parseObject.

Prototype

public abstract Object parseObject(String source, ParsePosition pos);

Source Link

Document

Parses text from a string to produce an object.

Usage

From source file:de.odysseus.calyxo.base.util.ParseUtils.java

private static Object parse(Format format, String value) throws ParseException {
        ParsePosition pos = new ParsePosition(0);
        Object result = format.parseObject(value, pos);
        if (pos.getIndex() < value.length())
            throw new ParseException("Cannot parse " + value + " (garbage suffix)!", pos.getIndex());
        return result;
    }//from  ww w  .  j  a v  a  2s  . c om