1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.betwixt.digester;
18
19 import java.util.Set;
20
21 import org.apache.commons.betwixt.XMLIntrospector;
22 import org.apache.commons.digester.Rule;
23 import org.apache.commons.logging.Log;
24 import org.apache.commons.logging.LogFactory;
25
26 /*** <p><code>RuleSupport</code> is an abstract base class containing useful
27 * helper methods.</p>
28 *
29 * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
30 * @version $Revision: 438373 $
31 */
32 public class RuleSupport extends Rule {
33
34 /*** Logger */
35 private static final Log log = LogFactory.getLog( RuleSupport.class );
36 /*** Base constructor */
37 public RuleSupport() {
38 }
39
40
41
42
43
44 /***
45 * Gets <code>XMLBeanInfoDigester</code> using this rule.
46 *
47 * @return <code>XMLBeanInfoDigester</code> for this rule
48 */
49 protected XMLBeanInfoDigester getXMLInfoDigester() {
50 return (XMLBeanInfoDigester) getDigester();
51 }
52
53 /***
54 * Gets <code>XMLIntrospector</code> to be used for introspection
55 *
56 * @return <code>XMLIntrospector</code> to use
57 */
58 protected XMLIntrospector getXMLIntrospector() {
59 return getXMLInfoDigester().getXMLIntrospector();
60 }
61
62 /***
63 * Gets the class of the bean whose .betwixt file is being digested
64 *
65 * @return the <code>Class</code> of the bean being processed
66 */
67 protected Class getBeanClass() {
68 return getXMLInfoDigester().getBeanClass();
69 }
70
71 /***
72 * Gets the property names already processed
73 *
74 * @return the set of property names that have been processed so far
75 */
76 protected Set getProcessedPropertyNameSet() {
77 return getXMLInfoDigester().getProcessedPropertyNameSet();
78 }
79 }