1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.betwixt.digester;
17
18 import java.util.Set;
19
20 import org.apache.commons.logging.Log;
21 import org.apache.commons.logging.LogFactory;
22 import org.xml.sax.Attributes;
23 import org.xml.sax.SAXException;
24
25 /*** <p><code>HideRule</code> hides the property of the given name.</p>
26 *
27 * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
28 * @version $Revision: 155402 $
29 */
30 public class HideRule extends RuleSupport {
31
32 /*** Logger */
33 private static final Log log = LogFactory.getLog( HideRule.class );
34
35 /*** Base constructor */
36 public HideRule() {
37 }
38
39
40
41
42 /***
43 * Process the beginning of this element.
44 *
45 * @param attributes The attribute list of this element
46 * @throws SAXException when the mandatory 'property' attribute is missing
47 */
48 public void begin(String name, String namespace, Attributes attributes) throws SAXException {
49 String propertyAttributeValue = attributes.getValue( "property" );
50 if ( propertyAttributeValue == null || propertyAttributeValue.length() == 0 ) {
51 throw new SAXException(
52 "<hide> element is missing the mandatory attribute 'property'" );
53 }
54 Set propertySet = getProcessedPropertyNameSet();
55 propertySet.add( propertyAttributeValue );
56 }
57 }