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