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

com.blazebit.text.ClassFormat Maven / Gradle / Ivy

There is a newer version: 1.6.11
Show newest version
/*
 * Copyright 2011 Blazebit
 */
package com.blazebit.text;

/**
 * @author Christian Beikov
 * @since 0.1.2
 */
public class ClassFormat extends AbstractFormat> {

    private static final long serialVersionUID = 1L;

    @SuppressWarnings("unchecked")
    public ClassFormat() {
        super((Class>) (Class) Class.class);
    }

    public Class parse(String value, ParserContext context) {
        try {
            return Class.forName(value);
        } catch (ClassNotFoundException ex) {
            throw new IllegalArgumentException(ex);
        }
    }

    @Override
    public String format(Class value, ParserContext context) {
        return value.getName();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy