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

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


public class DoubleRangeMetaDataTransformer extends AbstractValidationParameterAwareTransformer
{
    protected Map<String, Object> transformMetaData(MetaDataEntry metaDataEntry)
    {
        Map<String, Object> results = new HashMap<String, Object>();
        DoubleRange annotation = metaDataEntry.getValue(DoubleRange.class);

        double minimum = annotation.minimum();

        if(minimum != Double.MIN_VALUE)
        {
            results.put(CommonMetaDataKeys.RANGE_MIN, minimum);
        }
        else
        {
            results.put(CommonMetaDataKeys.RANGE_MIN_DEFAULT, minimum);
        }

        double maximum = annotation.maximum();

        if(maximum != Double.MAX_VALUE)
        {
            results.put(CommonMetaDataKeys.RANGE_MAX, maximum);
        }
View Full Code Here


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

        DoubleRange annotation = metaDataEntry.getValue(DoubleRange.class);
        DoubleRangeValidator doubleRangeValidator = (DoubleRangeValidator)facesContext.getApplication()
                                                        .createValidator("javax.faces.DoubleRange");

        if(annotation.minimum() != Double.MIN_VALUE)
        {
            doubleRangeValidator.setMinimum(annotation.minimum());
        }

        if(annotation.maximum() != Double.MAX_VALUE)
        {
            doubleRangeValidator.setMaximum(annotation.maximum());
        }

        doubleRangeValidator.validate(facesContext, uiComponent, convertedObject);
    }
View Full Code Here

public class DoubleRangeMetaDataTransformer extends AbstractValidationParameterAwareTransformer
{
    protected Map<String, Object> transformMetaData(MetaDataEntry metaDataEntry)
    {
        Map<String, Object> results = new HashMap<String, Object>();
        DoubleRange annotation = metaDataEntry.getValue(DoubleRange.class);

        double minimum = annotation.minimum();

        if(minimum != Double.MIN_VALUE)
        {
            results.put(CommonMetaDataKeys.RANGE_MIN, minimum);
        }
        else
        {
            results.put(CommonMetaDataKeys.RANGE_MIN_DEFAULT, minimum);
        }

        double maximum = annotation.maximum();

        if(maximum != Double.MAX_VALUE)
        {
            results.put(CommonMetaDataKeys.RANGE_MAX, maximum);
        }
View Full Code Here

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

        DoubleRange annotation = metaDataEntry.getValue(DoubleRange.class);
        DoubleRangeValidator doubleRangeValidator = (DoubleRangeValidator)facesContext.getApplication()
                                                        .createValidator("javax.faces.DoubleRange");

        if(annotation.minimum() != Double.MIN_VALUE)
        {
            doubleRangeValidator.setMinimum(annotation.minimum());
        }

        if(annotation.maximum() != Double.MAX_VALUE)
        {
            doubleRangeValidator.setMaximum(annotation.maximum());
        }

        doubleRangeValidator.validate(facesContext, uiComponent, convertedObject);
    }
View Full Code Here

public class DoubleRangeMetaDataTransformer implements MetaDataTransformer
{
    public Map<String, Object> convertMetaData(MetaDataEntry metaDataEntry)
    {
        Map<String, Object> results = new HashMap<String, Object>();
        DoubleRange annotation = metaDataEntry.getValue(DoubleRange.class);

        double minimum = annotation.minimum();

        results.put(CommonMetaDataKeys.RANGE_MIN, minimum);
        results.put(CommonMetaDataKeys.RANGE_MAX, annotation.maximum());

        if(minimum > 0)
        {
            results.put(CommonMetaDataKeys.WEAK_REQUIRED, true);
        }
View Full Code Here

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

        DoubleRange annotation = metaDataEntry.getValue(DoubleRange.class);
        DoubleRangeValidator doubleRangeValidator = (DoubleRangeValidator)facesContext.getApplication()
                                                        .createValidator("javax.faces.DoubleRange");

        doubleRangeValidator.setMinimum(annotation.minimum());
        doubleRangeValidator.setMaximum(annotation.maximum());

        doubleRangeValidator.validate(facesContext, uiComponent, convertedObject);
    }
View Full Code Here

TOP

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

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.