private boolean checkField()

in spring-quartz/src/main/java/org/apache/archiva/redback/components/scheduler/CronExpressionValidator.java [221:261]


    private boolean checkField( String secondsField, int minimal, int maximal )
    {
        if ( secondsField.indexOf( '-' ) > -1 )
        {
            String startValue = secondsField.substring( 0, secondsField.indexOf( "-" ) );
            String endValue = secondsField.substring( secondsField.indexOf( "-" ) + 1 );

            if ( !( checkIntValue( startValue, minimal, maximal ) && checkIntValue( endValue, minimal, maximal ) ) )
            {
                return false;
            }
            try
            {
                int startVal = Integer.parseInt( startValue );
                int endVal = Integer.parseInt( endValue );

                return endVal > startVal;

            }
            catch ( NumberFormatException e )
            {
                return false;
            }
        }
        else if ( secondsField.indexOf( ',' ) > -1 )
        {
            return checkListField( secondsField, minimal, maximal );
        }
        else if ( secondsField.indexOf( '/' ) > -1 )
        {
            return checkIncrementField( secondsField, minimal, maximal );
        }
        else if ( secondsField.indexOf( '*' ) != -1 )
        {
            return true;
        }
        else
        {
            return checkIntValue( secondsField, minimal, maximal );
        }
    }