// Path: inputvalidation/src/main/java/com/switchfly/inputvalidation/canonicalizer/Canonicalizer.java
// public interface Canonicalizer<O> {
// 
//     O execute(O content);
// }
// 
// Path: inputvalidation/src/main/java/com/switchfly/inputvalidation/exception/ValidatorException.java
// public class ValidatorException extends RuntimeException {
//     private static final long serialVersionUID = 1L;
//     private final String _sanitizedContent;
// 
//     public ValidatorException(String sanitizedContent) {
//         _sanitizedContent = sanitizedContent;
//     }
// 
//     public ValidatorException(String sanitizedContent, String message) {
//         super(message);
//         _sanitizedContent = sanitizedContent;
//     }
// 
//     public String getSanitizedContent() {
//         return _sanitizedContent;
//     }
// }
// 
// Path: inputvalidation/src/main/java/com/switchfly/inputvalidation/sanitizer/Sanitizer.java
// public interface Sanitizer<O> {
// 
//     O execute(O content);
// }
// 
// Path: inputvalidation/src/main/java/com/switchfly/inputvalidation/validator/Validator.java
// public abstract class Validator<O> {
// 
//     private String _errorMessage;
// 
//     public abstract boolean execute(O content);
// 
//     public String getErrorMessage() {
//         return _errorMessage;
//     }
// 
//     public void setErrorMessage(String errorMessage) {
//         _errorMessage = errorMessage;
//     }
// }


import com.switchfly.inputvalidation.canonicalizer.Canonicalizer;
import com.switchfly.inputvalidation.exception.ValidatorException;
import com.switchfly.inputvalidation.sanitizer.Sanitizer;
import com.switchfly.inputvalidation.validator.Validator;
import org.apache.commons.lang.StringUtils;
/*
 * Copyright 2012 Switchfly
 *
 * 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.switchfly.inputvalidation;


public class ValidationStrategy<O> {

    public static final ValidationStrategy<String> DEFAULT_WEB_CONTENT_VALIDATION = new WebContentValidationStrategy();
    public static final ValidationStrategy<String> CLEAN_CURRENCY_CODE = new CurrencyCodeValidationStrategy();
    public static final ValidationStrategy<String> CLEAN_LOCALE_CODE = new LocaleCodeValidationStrategy();
    public static final ValidationStrategy<String> CLEAN_URL = new UrlCleanValidationStrategy();

    public static final ValidationStrategies COBRAND_NAME = ValidationStrategyBuilder.withPattern("[\\p{L}\\p{Nd}\\-_]+");
    public static final ValidationStrategies ADDRESS_LINE = ValidationStrategyBuilder.withPattern("[\\p{L}\\p{Nd}\\.\\-\\s#&',:\\/\\\\]+");
    public static final ValidationStrategies NAME = ValidationStrategyBuilder.withPattern("[\\p{L}\\p{Nd}_\\.\\-\\s~,'`]+");
    public static final ValidationStrategies PROPERTY_NAME = ValidationStrategyBuilder.withPattern("[\\w\\d\\-\\._]+");

// Path: inputvalidation/src/main/java/com/switchfly/inputvalidation/canonicalizer/Canonicalizer.java
// public interface Canonicalizer<O> {
// 
//     O execute(O content);
// }
// 
// Path: inputvalidation/src/main/java/com/switchfly/inputvalidation/exception/ValidatorException.java
// public class ValidatorException extends RuntimeException {
//     private static final long serialVersionUID = 1L;
//     private final String _sanitizedContent;
// 
//     public ValidatorException(String sanitizedContent) {
//         _sanitizedContent = sanitizedContent;
//     }
// 
//     public ValidatorException(String sanitizedContent, String message) {
//         super(message);
//         _sanitizedContent = sanitizedContent;
//     }
// 
//     public String getSanitizedContent() {
//         return _sanitizedContent;
//     }
// }
// 
// Path: inputvalidation/src/main/java/com/switchfly/inputvalidation/sanitizer/Sanitizer.java
// public interface Sanitizer<O> {
// 
//     O execute(O content);
// }
// 
// Path: inputvalidation/src/main/java/com/switchfly/inputvalidation/validator/Validator.java
// public abstract class Validator<O> {
// 
//     private String _errorMessage;
// 
//     public abstract boolean execute(O content);
// 
//     public String getErrorMessage() {
//         return _errorMessage;
//     }
// 
//     public void setErrorMessage(String errorMessage) {
//         _errorMessage = errorMessage;
//     }
// }


// Path: inputvalidation/src/main/java/com/switchfly/inputvalidation/ValidationStrategy.java
import com.switchfly.inputvalidation.canonicalizer.Canonicalizer;
import com.switchfly.inputvalidation.exception.ValidatorException;
import com.switchfly.inputvalidation.sanitizer.Sanitizer;
import com.switchfly.inputvalidation.validator.Validator;
import org.apache.commons.lang.StringUtils;

/*
 * Copyright 2012 Switchfly
 *
 * 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.switchfly.inputvalidation;


public class ValidationStrategy<O> {

    public static final ValidationStrategy<String> DEFAULT_WEB_CONTENT_VALIDATION = new WebContentValidationStrategy();
    public static final ValidationStrategy<String> CLEAN_CURRENCY_CODE = new CurrencyCodeValidationStrategy();
    public static final ValidationStrategy<String> CLEAN_LOCALE_CODE = new LocaleCodeValidationStrategy();
    public static final ValidationStrategy<String> CLEAN_URL = new UrlCleanValidationStrategy();

    public static final ValidationStrategies COBRAND_NAME = ValidationStrategyBuilder.withPattern("[\\p{L}\\p{Nd}\\-_]+");
    public static final ValidationStrategies ADDRESS_LINE = ValidationStrategyBuilder.withPattern("[\\p{L}\\p{Nd}\\.\\-\\s#&',:\\/\\\\]+");
    public static final ValidationStrategies NAME = ValidationStrategyBuilder.withPattern("[\\p{L}\\p{Nd}_\\.\\-\\s~,'`]+");
    public static final ValidationStrategies PROPERTY_NAME = ValidationStrategyBuilder.withPattern("[\\w\\d\\-\\._]+");

    private final Canonicalizer<O> _canonicalizer;