com.jaspersoft.studio.editor.preview.input.array.number.IntegerElement.java Source code

Java tutorial

Introduction

Here is the source code for com.jaspersoft.studio.editor.preview.input.array.number.IntegerElement.java

Source

/*******************************************************************************
 * Copyright (C) 2005 - 2014 TIBCO Software Inc. All rights reserved.
 * http://www.jaspersoft.com.
 * 
 * Unless you have purchased  a commercial license agreement from Jaspersoft,
 * the following license terms  apply:
 * 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 ******************************************************************************/
package com.jaspersoft.studio.editor.preview.input.array.number;

import java.util.Locale;

import org.apache.commons.validator.routines.IntegerValidator;

public class IntegerElement extends ANumberElement {

    @Override
    public Class<?> getSupportedType() {
        return Integer.class;
    }

    protected boolean isValid(String number) {
        return IntegerValidator.getInstance().isValid(number, Locale.US);
    }

    @Override
    protected Object convertString(String str) {
        return new Integer(str);
    }
}