Package org.apache.myfaces.extensions.validator.baseval.annotation

Examples of org.apache.myfaces.extensions.validator.baseval.annotation.Pattern


{
    protected void processValidation(FacesContext facesContext,
            UIComponent uiComponent, MetaDataEntry metaDataEntry,
            Object convertedObject) throws ValidatorException
    {
        Pattern annotation = metaDataEntry.getValue(Pattern.class);

        for (String expression : annotation.value())
        {
            if (!java.util.regex.Pattern.compile(expression).matcher(convertedObject.toString()).matches())
            {
                throw new ValidatorException(new FacesMessage(
                        FacesMessage.SEVERITY_ERROR,
View Full Code Here


public class PatternMetaDataTransformer  extends AbstractValidationParameterAwareTransformer
{
    protected Map<String, Object> transformMetaData(MetaDataEntry metaDataEntry)
    {
        Map<String, Object> results = new HashMap<String, Object>();
        Pattern annotation = metaDataEntry.getValue(Pattern.class);
       
        results.put(CommonMetaDataKeys.PATTERN, (annotation).value());

        String validationErrorMsgKey = (annotation).validationErrorMsgKey();
        Locale currentLocale = FacesContext.getCurrentInstance().getViewRoot().getLocale();

        ValidationStrategy validationStrategy =
            ExtValUtils.getValidationStrategyForMetaData(annotation.annotationType().getName());

        String validationErrorMsg = ExtValUtils.getMessageResolverForValidationStrategy(validationStrategy)
            .getMessage(validationErrorMsgKey, currentLocale);

        results.put(CommonMetaDataKeys.PATTERN_VALIDATION_ERROR_MESSAGE, validationErrorMsg);
View Full Code Here

{
    protected void processValidation(FacesContext facesContext,
            UIComponent uiComponent, MetaDataEntry metaDataEntry,
            Object convertedObject) throws ValidatorException
    {
        Pattern annotation = metaDataEntry.getValue(Pattern.class);

        for (String expression : annotation.value())
        {
            if (convertedObject == null
                    || !java.util.regex.Pattern.compile(expression).matcher(
                            convertedObject.toString()).matches())
            {
View Full Code Here

public class PatternMetaDataTransformer  extends AbstractValidationParameterAwareTransformer
{
    protected Map<String, Object> transformMetaData(MetaDataEntry metaDataEntry)
    {
        Map<String, Object> results = new HashMap<String, Object>();
        Pattern annotation = metaDataEntry.getValue(Pattern.class);
       
        results.put(CommonMetaDataKeys.PATTERN, (annotation).value());

        String validationErrorMsgKey = (annotation).validationErrorMsgKey();
        Locale currentLocale = FacesContext.getCurrentInstance().getViewRoot().getLocale();

        ValidationStrategy validationStrategy =
            ExtValUtils.getValidationStrategyForMetaData(annotation.annotationType().getName());

        String validationErrorMsg = ExtValUtils.getMessageResolverForValidationStrategy(validationStrategy)
            .getMessage(validationErrorMsgKey, currentLocale);

        results.put(CommonMetaDataKeys.PATTERN_VALIDATION_ERROR_MESSAGE, validationErrorMsg);
View Full Code Here

{
    protected void processValidation(FacesContext facesContext,
            UIComponent uiComponent, MetaDataEntry metaDataEntry,
            Object convertedObject) throws ValidatorException
    {
        Pattern annotation = metaDataEntry.getValue(Pattern.class);

        for (String expression : annotation.value())
        {
            if (!java.util.regex.Pattern.compile(expression).matcher(convertedObject.toString()).matches())
            {
                throw new ValidatorException(new FacesMessage(
                        FacesMessage.SEVERITY_ERROR,
View Full Code Here

public class PatternMetaDataTransformer implements MetaDataTransformer
{
    public Map<String, Object> convertMetaData(MetaDataEntry metaDataEntry)
    {
        Map<String, Object> results = new HashMap<String, Object>();
        Pattern annotation = metaDataEntry.getValue(Pattern.class);
       
        results.put(CommonMetaDataKeys.PATTERN, (annotation).value());

        String validationErrorMsgKey = (annotation).validationErrorMsgKey();
        Locale currentLocale = FacesContext.getCurrentInstance().getViewRoot().getLocale();

        ValidationStrategy validationStrategy =
            ExtValUtils.getValidationStrategyForMetaData(annotation.annotationType().getName());

        String validationErrorMsg = ExtValUtils.getMessageResolverForValidationStrategy(validationStrategy)
            .getMessage(validationErrorMsgKey, currentLocale);

        results.put(CommonMetaDataKeys.PATTERN_VALIDATION_ERROR_MESSAGE, validationErrorMsg);
View Full Code Here

    protected void processValidation(FacesContext facesContext,
            UIComponent uiComponent, MetaDataEntry metaDataEntry,
            Object convertedObject) throws ValidatorException
    {

        Pattern annotation = metaDataEntry.getValue(Pattern.class);

        for (String expression : annotation.value())
        {
            if (convertedObject == null
                    || !java.util.regex.Pattern.compile(expression).matcher(
                            convertedObject.toString()).matches())
            {
View Full Code Here

TOP

Related Classes of org.apache.myfaces.extensions.validator.baseval.annotation.Pattern

Copyright © 2018 www.massapicom. 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.