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

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


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

        long minimum = annotation.minimum();

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

        long maximum = annotation.maximum();

        if(maximum != Long.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
    {

        LongRange annotation = metaDataEntry.getValue(LongRange.class);
        LongRangeValidator longRangeValidator = (LongRangeValidator)facesContext.getApplication()
                                                    .createValidator("javax.faces.LongRange");

        if(annotation.minimum() != Long.MIN_VALUE)
        {
            longRangeValidator.setMinimum(annotation.minimum());
        }

        if(annotation.maximum() != Long.MAX_VALUE)
        {
            longRangeValidator.setMaximum(annotation.maximum());
        }

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

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

        long minimum = annotation.minimum();

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

        long maximum = annotation.maximum();

        if(maximum != Long.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
    {

        LongRange annotation = metaDataEntry.getValue(LongRange.class);
        LongRangeValidator longRangeValidator = (LongRangeValidator)facesContext.getApplication()
                                                    .createValidator("javax.faces.LongRange");

        if(annotation.minimum() != Long.MIN_VALUE)
        {
            longRangeValidator.setMinimum(annotation.minimum());
        }

        if(annotation.maximum() != Long.MAX_VALUE)
        {
            longRangeValidator.setMaximum(annotation.maximum());
        }

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

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

        LongRange annotation = metaDataEntry.getValue(LongRange.class);
        LongRangeValidator longRangeValidator = (LongRangeValidator)facesContext.getApplication()
                                                    .createValidator("javax.faces.LongRange");

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

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

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

        long 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

TOP

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

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.