summaryrefslogtreecommitdiff
path: root/src/plugins/preflighting.samplechecker.androidlabel/src/com/motorolamobility/preflighting/samplechecker/androidlabel/implementation/AndroidLabelChecker.java
blob: 3998a32ca9b475469c6cafe0b4c13300df188267 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.motorolamobility.preflighting.samplechecker.androidlabel.implementation;

import java.util.List;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;

import com.motorolamobility.preflighting.core.checker.Checker;
import com.motorolamobility.preflighting.core.checker.IChecker;
import com.motorolamobility.preflighting.core.checker.condition.CanExecuteConditionStatus;
import com.motorolamobility.preflighting.core.validation.Parameter;

/**
 * This Checker is responsible for verify Android Label issues. In
 * order to see more details, see its Conditions.
 * <br><br>
 * This checker is intended to be used as an sample so App Validator
 * users can create their own checkers, using this as a reference.
 *
 */
public class AndroidLabelChecker extends Checker implements IChecker
{
    /**
     * Defines the command line parameter
     */
    public static final String PARAMETER_LABEL_TEXT = "labelText"; //$NON-NLS-1$

    /* (non-Javadoc)
     * @see com.motorolamobility.preflighting.core.checker.Checker#validateInputParams(java.util.List)
     */
    @Override
    public IStatus validateInputParams(List<Parameter> parameters)
    {
        CanExecuteConditionStatus status =
                (CanExecuteConditionStatus) super.validateInputParams(parameters);

        if (status.getSeverity() == Status.ERROR)
        {
            status.setStatusSeverity(Status.INFO);
        }
        return status;
    }
}