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

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


{
    protected void processValidation(FacesContext facesContext,
            UIComponent uiComponent, MetaDataEntry metaDataEntry,
            Object convertedObject) throws ValidatorException
    {
        Length annotation = metaDataEntry.getValue(Length.class);
        LengthValidator lengthValidator = (LengthValidator)facesContext.getApplication()
                                            .createValidator("javax.faces.Length");

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

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


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

        int minimum = annotation.minimum();

        if(minimum != 0)
        {
            results.put(CommonMetaDataKeys.MIN_LENGTH, minimum);
        }
        else
        {
            results.put(CommonMetaDataKeys.MIN_LENGTH_DEFAULT, minimum);
        }

        int maximum = annotation.maximum();
        if(maximum != Integer.MAX_VALUE)
        {
            results.put(CommonMetaDataKeys.MAX_LENGTH, maximum);
        }
        else
View Full Code Here

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

        int minimum = annotation.minimum();

        if(minimum != 0)
        {
            results.put(CommonMetaDataKeys.MIN_LENGTH, minimum);
        }
        else
        {
            results.put(CommonMetaDataKeys.MIN_LENGTH_DEFAULT, minimum);
        }

        int maximum = annotation.maximum();
        if(maximum != Integer.MAX_VALUE)
        {
            results.put(CommonMetaDataKeys.MAX_LENGTH, maximum);
        }
        else
View Full Code Here

{
    protected void processValidation(FacesContext facesContext,
            UIComponent uiComponent, MetaDataEntry metaDataEntry,
            Object convertedObject) throws ValidatorException
    {
        Length annotation = metaDataEntry.getValue(Length.class);
        LengthValidator lengthValidator = (LengthValidator)facesContext.getApplication()
                                            .createValidator("javax.faces.Length");

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

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

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

        int minimum = annotation.minimum();

        results.put(CommonMetaDataKeys.MIN_LENGTH, minimum);
        results.put(CommonMetaDataKeys.MAX_LENGTH, 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.Length

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.