//# 1 errors, 28 messages
//#
/*
    //#CommandNameValidator.java:1:1: class: com.dmdirc.config.prefs.validator.CommandNameValidator
    //#CommandNameValidator.java:1:1: method: com.dmdirc.config.prefs.validator.CommandNameValidator.com.dmdirc.config.prefs.validator.CommandNameValidator__static_init
 * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package com.dmdirc.config.prefs.validator;

import com.dmdirc.commandparser.CommandManager;
import java.util.regex.Pattern;

/**
 * Validates command names.
 *
 * @since 0.6.3m1rc3
 */
public class CommandNameValidator extends ValidatorChain<String> {

    /**
     * Instantiates a new command name validator.
     */
    @SuppressWarnings("unchecked")
    public CommandNameValidator() {
        super(new RegexStringValidator("^[^\\s]*$", "Cannot contain spaces"),
    //#CommandNameValidator.java:40: method: void com.dmdirc.config.prefs.validator.CommandNameValidator.com.dmdirc.config.prefs.validator.CommandNameValidator()
    //#CommandNameValidator.java:40: ?precondition failure
    //#    com/dmdirc/config/prefs/validator/ValidatorChain.com.dmdirc.config.prefs.validator.ValidatorChain: (soft) init'ed(validators[0..4_294_967_295])
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.config.prefs.validator.CommandNameValidator
    //#    method: void com.dmdirc.config.prefs.validator.CommandNameValidator()
    //#    basic block: Entry_BB_1
    //#    assertion: (soft) init'ed(com.dmdirc.config.prefs.validator.ValidatorChain.Param_1[0..4_294_967_295])
    //#    callee: void com/dmdirc/config/prefs/validator/ValidatorChain.com.dmdirc.config.prefs.validator.ValidatorChain(Validator[])
    //#    callee assertion: (soft) init'ed(validators[0..4_294_967_295])
    //#    callee file: ValidatorChain.java
    //#    callee precondition index: [4]
    //#    callee srcpos: 45
    //#    VN: com.dmdirc.config.prefs.validator.ValidatorChain.Param_1[0..4_294_967_295]
    //#    Expected: Univ-VN-Set
    //#    Bad: {Invalid}
    //#    Attribs:  Ptr  Soft  Bad only invalid
    //#input(void com.dmdirc.config.prefs.validator.CommandNameValidator()): "Cannot start with a "._tainted
    //#input(void com.dmdirc.config.prefs.validator.CommandNameValidator()): "].*$"._tainted
    //#input(void com.dmdirc.config.prefs.validator.CommandNameValidator()): "^[^"._tainted
    //#input(void com.dmdirc.config.prefs.validator.CommandNameValidator()): com/dmdirc/commandparser/CommandManager.commandChar
    //#input(void com.dmdirc.config.prefs.validator.CommandNameValidator()): this
    //#output(void com.dmdirc.config.prefs.validator.CommandNameValidator()): new ArrayList(ValidatorChain#1) num objects
    //#output(void com.dmdirc.config.prefs.validator.CommandNameValidator()): this.validatorList
    //#new obj(void com.dmdirc.config.prefs.validator.CommandNameValidator()): new ArrayList(ValidatorChain#1)
    //#pre[1] (void com.dmdirc.config.prefs.validator.CommandNameValidator()): init'ed(com/dmdirc/commandparser/CommandManager.commandChar)
    //#post(void com.dmdirc.config.prefs.validator.CommandNameValidator()): this.validatorList == &new ArrayList(ValidatorChain#1)
    //#post(void com.dmdirc.config.prefs.validator.CommandNameValidator()): new ArrayList(ValidatorChain#1) num objects == 1
    //#unanalyzed(void com.dmdirc.config.prefs.validator.CommandNameValidator()): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(void com.dmdirc.config.prefs.validator.CommandNameValidator()): Effects-of-calling:java.util.List:add
                new RegexStringValidator("^[^"
                + Pattern.quote(String.valueOf(CommandManager.getCommandChar()))
                + "].*$", "Cannot start with a " + CommandManager.getCommandChar()));
    }
    //#CommandNameValidator.java:44: end of method: void com.dmdirc.config.prefs.validator.CommandNameValidator.com.dmdirc.config.prefs.validator.CommandNameValidator()

}
    //#output(com.dmdirc.config.prefs.validator.CommandNameValidator__static_init): __Descendant_Table[com/dmdirc/config/prefs/validator/CommandNameValidator]
    //#output(com.dmdirc.config.prefs.validator.CommandNameValidator__static_init): __Dispatch_Table.validate(Ljava/lang/Object;)Lcom/dmdirc/config/prefs/validator/ValidationResponse;
    //#output(com.dmdirc.config.prefs.validator.CommandNameValidator__static_init): com/dmdirc/config/prefs/validator/Validator.__Descendant_Table[com/dmdirc/config/prefs/validator/CommandNameValidator]
    //#output(com.dmdirc.config.prefs.validator.CommandNameValidator__static_init): com/dmdirc/config/prefs/validator/ValidatorChain.__Descendant_Table[com/dmdirc/config/prefs/validator/CommandNameValidator]
    //#post(com.dmdirc.config.prefs.validator.CommandNameValidator__static_init): __Descendant_Table[com/dmdirc/config/prefs/validator/CommandNameValidator] == &__Dispatch_Table
    //#post(com.dmdirc.config.prefs.validator.CommandNameValidator__static_init): com/dmdirc/config/prefs/validator/Validator.__Descendant_Table[com/dmdirc/config/prefs/validator/CommandNameValidator] == &__Dispatch_Table
    //#post(com.dmdirc.config.prefs.validator.CommandNameValidator__static_init): com/dmdirc/config/prefs/validator/ValidatorChain.__Descendant_Table[com/dmdirc/config/prefs/validator/CommandNameValidator] == &__Dispatch_Table
    //#post(com.dmdirc.config.prefs.validator.CommandNameValidator__static_init): __Dispatch_Table.validate(Ljava/lang/Object;)Lcom/dmdirc/config/prefs/validator/ValidationResponse; == &com/dmdirc/config/prefs/validator/ValidatorChain.validate
    //#CommandNameValidator.java:: end of method: com.dmdirc.config.prefs.validator.CommandNameValidator.com.dmdirc.config.prefs.validator.CommandNameValidator__static_init
    //#CommandNameValidator.java:: end of class: com.dmdirc.config.prefs.validator.CommandNameValidator
