Examples of StringLengthValidator


Examples of org.jboss.as.controller.operations.validation.StringLengthValidator

    public static final GetInstalledDriverOperationHandler INSTANCE = new GetInstalledDriverOperationHandler();

    private final ParametersValidator validator = new ParametersValidator();

    private GetInstalledDriverOperationHandler() {
        validator.registerValidator(DRIVER_NAME.getName(), new StringLengthValidator(1));
    }
View Full Code Here

Examples of org.jboss.as.controller.operations.validation.StringLengthValidator

        /**
         * Creates a WriteAttributeOperationHandler that users the given {@code valueValidator}
         * to validate values before applying them to the model.
         */
        protected WriteAttributeOperationHandler(ParameterValidator valueValidator) {
            this.nameValidator.registerValidator(NAME, new StringLengthValidator(1));
            this.valueValidator = valueValidator;
        }
View Full Code Here

Examples of org.jboss.as.controller.operations.validation.StringLengthValidator

     *
     * @param contentRepository the master content repository. If {@code null} this handler will function as a slave handler would.
     */
    public DeploymentAddHandler(final ContentRepository contentRepository) {
        this.contentRepository = contentRepository;
        this.validator.registerValidator(RUNTIME_NAME, new StringLengthValidator(1, Integer.MAX_VALUE, true, false));
        final ParametersValidator contentValidator = new ParametersValidator();
        // existing managed content
        contentValidator.registerValidator(HASH, new ModelTypeValidator(ModelType.BYTES, true));
        // existing unmanaged content
        contentValidator.registerValidator(ARCHIVE, new ModelTypeValidator(ModelType.BOOLEAN, true));
        contentValidator.registerValidator(PATH, new StringLengthValidator(1, true));
        contentValidator.registerValidator(RELATIVE_TO, new ModelTypeValidator(ModelType.STRING, true));
        // content additions
        contentValidator.registerValidator(INPUT_STREAM_INDEX, new ModelTypeValidator(ModelType.INT, true));
        contentValidator.registerValidator(BYTES, new ModelTypeValidator(ModelType.BYTES, true));
        contentValidator.registerValidator(URL, new StringLengthValidator(1, true));
        this.validator.registerValidator(CONTENT, chain(new ListValidator(new ParametersOfValidator(contentValidator)),
                new AbstractParameterValidator() {
                    @Override
                    public void validateParameter(String parameterName, ModelNode value) throws OperationFailedException {
                        validateOnePieceOfContent(value);
                    }
                }));
        this.managedContentValidator.registerValidator(HASH, new ModelTypeValidator(ModelType.BYTES));
        this.unmanagedContentValidator.registerValidator(ARCHIVE, new ModelTypeValidator(ModelType.BOOLEAN));
        this.unmanagedContentValidator.registerValidator(PATH, new StringLengthValidator(1));
    }
View Full Code Here

Examples of org.jboss.as.controller.operations.validation.StringLengthValidator

        public StringLengthValidatingHandler(final int min, final boolean nullable, final boolean allowExpressions) {
            this(min, Integer.MAX_VALUE, nullable, allowExpressions);
        }

        public StringLengthValidatingHandler(final int min, final int max, final boolean nullable, final boolean allowExpressions) {
            super(new StringLengthValidator(min, max, nullable, allowExpressions));
        }
View Full Code Here

Examples of org.jboss.as.controller.operations.validation.StringLengthValidator

    public static class ReadChildrenNamesOperationHandler implements OperationStepHandler {

        private final ParametersValidator validator = new ParametersValidator();

        public ReadChildrenNamesOperationHandler() {
            validator.registerValidator(CHILD_TYPE, new StringLengthValidator(1));
        }
View Full Code Here

Examples of org.jboss.as.controller.operations.validation.StringLengthValidator

    public static class ReadChildrenResourcesOperationHandler implements OperationStepHandler {

        private final ParametersValidator validator = new ParametersValidator();

        public ReadChildrenResourcesOperationHandler() {
            validator.registerValidator(CHILD_TYPE, new StringLengthValidator(1));
            validator.registerValidator(RECURSIVE, new ModelTypeValidator(ModelType.BOOLEAN, true));
            validator.registerValidator(RECURSIVE_DEPTH, new ModelTypeValidator(ModelType.INT, true));
            validator.registerValidator(INCLUDE_RUNTIME, new ModelTypeValidator(ModelType.BOOLEAN, true));
            validator.registerValidator(PROXIES, new ModelTypeValidator(ModelType.BOOLEAN, true));
            validator.registerValidator(INCLUDE_DEFAULTS, new ModelTypeValidator(ModelType.BOOLEAN, true));
View Full Code Here

Examples of org.jboss.as.controller.operations.validation.StringLengthValidator

    public ServerGroupDeploymentReplaceHandler(final HostFileRepository fileRepository) {
        if (fileRepository == null) {
            throw MESSAGES.nullVar("fileRepository");
        }
        this.fileRepository = fileRepository;
        this.validator.registerValidator(NAME, new StringLengthValidator(1));
        this.validator.registerValidator(TO_REPLACE, new StringLengthValidator(1));
    }
View Full Code Here

Examples of org.jboss.as.controller.operations.validation.StringLengthValidator

     * @param useBoottime {@code true} if the system property resource should support the "boot-time" attribute
     */
    public SystemPropertyAddHandler(ProcessEnvironment processEnvironment, boolean useBoottime) {
        this.processEnvironment = processEnvironment;
        this.useBoottime = useBoottime;
        validator.registerValidator(VALUE, new StringLengthValidator(0, true));
        if (useBoottime) {
            validator.registerValidator(BOOT_TIME, new ModelTypeValidator(ModelType.BOOLEAN, true));
        }
    }
View Full Code Here

Examples of org.jboss.as.controller.operations.validation.StringLengthValidator

    private static ParameterValidator createParameterValidator(final ParameterValidator existing, final ModelType type,final boolean allowNull, final boolean allowExpression) {
        if (existing != null) {
            return existing;
        } else if (type == ModelType.STRING) {
            return new StringLengthValidator(1, Integer.MAX_VALUE, allowNull, allowExpression);
        } else {
            return new ModelTypeValidator(type, allowNull, allowExpression);
        }
    }
View Full Code Here

Examples of org.jboss.as.controller.operations.validation.StringLengthValidator

        this.resolvedValueValidator = null;
    }

    protected AbstractWriteAttributeHandler(final ParameterValidator unresolvedValidator, final ParameterValidator resolvedValidator) {

        this.nameValidator.registerValidator(NAME, new StringLengthValidator(1));
        this.unresolvedValueValidator = unresolvedValidator;
        this.resolvedValueValidator = resolvedValidator;
        this.attributeDefinitions = null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.