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

org.nuiton.io.xpp3.DefaultDataConverter Maven / Gradle / Ivy

The newest version!
/*
 * #%L
 * Maven helper plugin
 * 
 * $Id: DefaultDataConverter.java 814 2011-05-10 22:07:16Z tchemit $
 * $HeadURL: http://svn.nuiton.org/svn/maven-helper-plugin/tags/maven-helper-plugin-1.3/src/main/java/org/nuiton/io/xpp3/DefaultDataConverter.java $
 * %%
 * Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as 
 * published by the Free Software Foundation, either version 3 of the 
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Lesser Public License for more details.
 * 
 * You should have received a copy of the GNU General Lesser Public 
 * License along with this program.  If not, see
 * .
 * #L%
 */

package org.nuiton.io.xpp3;

/**
 * A enumaration to convert some data from a string representation.
 * 

* * @author tchemit * @since 1.0.0 */ public enum DefaultDataConverter implements DataConverter { Boolean { @Override public Object convert(String t) throws Exception { Object r = java.lang.Boolean.valueOf(t); return r; } }, Short { @Override public Object convert(String t) throws Exception { Object r = java.lang.Short.valueOf(t); return r; } }, Integer { @Override public Object convert(String t) throws Exception { Object r = java.lang.Integer.valueOf(t); return r; } }, Long { @Override public Object convert(String t) throws Exception { Object r = java.lang.Long.valueOf(t); return r; } }, Float { @Override public Object convert(String t) throws Exception { Object r = java.lang.Float.valueOf(t); return r; } }, Double { @Override public Object convert(String t) throws Exception { Object r = java.lang.Double.valueOf(t); return r; } }, Text { @Override public Object convert(String t) throws Exception { return t; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy