Package br.com.caelum.stella

Examples of br.com.caelum.stella.ResourceBundleMessageProducer


    public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
      if (value == null || "".equals(value)) return;
     
        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(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
      if (value == null || "".equals(value)) return;
     
        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(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
      if (value == null || "".equals(value)) return;
     
        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

public class CoreExample {
    public static void main(String[] args) {
        String cnpj = "26.637.142/0001-48";
        ResourceBundle resourceBundle = ResourceBundle.getBundle("StellaValidationMessages", new Locale("pt", "BR"));
        MessageProducer messageProducer = new ResourceBundleMessageProducer(resourceBundle);
        boolean isFormatted = true;
        CNPJValidator validator = new CNPJValidator(messageProducer, isFormatted);
        try {
            // lógica de negócio ...
            validator.assertValid(cnpj);
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.