Package br.com.caelum.stella

Examples of br.com.caelum.stella.ResourceBundleMessageProducer


        this.formatted = formatted;
    }

    public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
        ResourceBundle bundle = resourceBundleFinder.getForCurrentLocale(facesContext);
        ResourceBundleMessageProducer producer = new ResourceBundleMessageProducer(bundle);
        CNPJValidator validator = new CNPJValidator(producer, formatted);

        try {
            validator.assertValid(value.toString());
        } catch (InvalidStateException e) {
View Full Code Here


    public void validate(final FacesContext facesContext, final UIComponent uiComponent, final Object value)
            throws ValidatorException {

        ResourceBundle bundle = resourceBundleFinder.getForCurrentLocale(facesContext);
        ResourceBundleMessageProducer producer = new ResourceBundleMessageProducer(bundle);
        try {
            br.com.caelum.stella.validation.Validator<String> validator;
            try {
                String estadoValue;
                if (estado == null) {
View Full Code Here

    private boolean transientValue = false;

    public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
        ResourceBundle bundle = resourceBundleFinder.getForCurrentLocale(facesContext);
        ResourceBundleMessageProducer producer = new ResourceBundleMessageProducer(bundle);
        TituloEleitoralValidator validator = new TituloEleitoralValidator(producer);

        try {
            validator.assertValid(value.toString());
        } catch (InvalidStateException e) {
View Full Code Here

        this.formatted = formatted;
    }

    public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
        ResourceBundle bundle = resourceBundleFinder.getForCurrentLocale(facesContext);
        ResourceBundleMessageProducer producer = new ResourceBundleMessageProducer(bundle);
        CPFValidator validator = new CPFValidator(producer, formatted);

        try {
            validator.assertValid(value.toString());
        } catch (InvalidStateException e) {
View Full Code Here

        this.formatted = formatted;
    }

    public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
        ResourceBundle bundle = resourceBundleFinder.getForCurrentLocale(facesContext);
        ResourceBundleMessageProducer producer = new ResourceBundleMessageProducer(bundle);
        NITValidator validator = new NITValidator(producer, formatted);

        try {
            validator.assertValid(value.toString());
        } catch (InvalidStateException e) {
View Full Code Here

        this.formatted = formatted;
    }

    public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
        ResourceBundle bundle = resourceBundleFinder.getForCurrentLocale(facesContext);
        ResourceBundleMessageProducer producer = new ResourceBundleMessageProducer(bundle);
        CPFValidator validator = new CPFValidator(producer, formatted);

        try {
            validator.assertValid(value.toString());
        } catch (InvalidStateException e) {
View Full Code Here

        this.formatted = formatted;
    }

    public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
        ResourceBundle bundle = resourceBundleFinder.getForCurrentLocale(facesContext);
        ResourceBundleMessageProducer producer = new ResourceBundleMessageProducer(bundle);
        CNPJValidator validator = new CNPJValidator(producer, formatted);

        try {
            validator.assertValid(value.toString());
        } catch (InvalidStateException e) {
View Full Code Here

    public void validate(final FacesContext facesContext, final UIComponent uiComponent, final Object value)
            throws ValidatorException {

        ResourceBundle bundle = resourceBundleFinder.getForCurrentLocale(facesContext);
        ResourceBundleMessageProducer producer = new ResourceBundleMessageProducer(bundle);
        try {
            br.com.caelum.stella.validation.Validator<String> validator;
            try {
                String estadoValue;
                if (estado == null) {
View Full Code Here

    private boolean transientValue = false;

    public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
        ResourceBundle bundle = resourceBundleFinder.getForCurrentLocale(facesContext);
        ResourceBundleMessageProducer producer = new ResourceBundleMessageProducer(bundle);
        TituloEleitoralValidator validator = new TituloEleitoralValidator(producer);

        try {
            validator.assertValid(value.toString());
        } catch (InvalidStateException e) {
View Full Code Here

    @Test
    public void deveConterMensagensPadraoParaTodosOsErrosPossiveis() throws Exception {
        Locale locale = new Locale("pt", "BR");
        ResourceBundle messages = ResourceBundle.getBundle("StellaMessages", locale);
        ResourceBundleMessageProducer producer = new ResourceBundleMessageProducer(messages);
       
        for (Class c : ERROR_CLASSES) {
      InvalidValue[] errors = (InvalidValue[]) c.getMethod("values").invoke(null);
            for (InvalidValue error : errors) {
                String errorKey = producer.messageKeyFor(locale, c, error);
                assertNotNull(messages.getString(errorKey));
            }
        }
    }
View Full Code Here

TOP

Related Classes of br.com.caelum.stella.ResourceBundleMessageProducer

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.