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

com.simpligility.maven.plugins.android.configuration.SimpleVersionElementParser Maven / Gradle / Ivy

There is a newer version: 4.6.0
Show newest version
package com.simpligility.maven.plugins.android.configuration;

import org.apache.maven.plugin.MojoExecutionException;

/**
 * VersionElementParser implementing the old version generator behavior.
 *
 * @author Wang Xuerui 
 *
 */
public class SimpleVersionElementParser implements VersionElementParser
{

    @Override
    public int[] parseVersionElements( final String versionName ) throws MojoExecutionException
    {
        final String[] versionNameElements = versionName.replaceAll( "[^0-9.]", "" ).split( "\\." );
        int[] result = new int[versionNameElements.length];

        for ( int i = 0; i < versionNameElements.length; i++ )
        {
            result[i] = Integer.valueOf( versionNameElements[i] );
        }

        return result;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy