View Javadoc

1   /*
2    * Copyright 2004-2009 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.springmodules.validation.bean.conf.loader.xml.handler;
18  
19  import org.springmodules.validation.bean.rule.AbstractValidationRule;
20  import org.springmodules.validation.bean.rule.EmailValidationRule;
21  import org.w3c.dom.Element;
22  
23  /**
24   * An {@link AbstractPropertyValidationElementHandler} implementation that can handle an element that represents an email
25   * validation rule.
26   *
27   * @author Uri Boness
28   */
29  public class EmailRuleElementHandler extends AbstractPropertyValidationElementHandler {
30  
31      private static final String ELEMENT_NAME = "email";
32  
33      /**
34       * Constructs a new EmailRuleElementHandler.
35       */
36      public EmailRuleElementHandler(String namespaceUri) {
37          super(ELEMENT_NAME, namespaceUri);
38      }
39  
40      protected AbstractValidationRule createValidationRule(Element element) {
41          return new EmailValidationRule();
42      }
43  
44  }