1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.commons.betwixt.strategy;
20
21 import org.apache.commons.betwixt.IntrospectionConfiguration;
22
23 /***
24 * Binds simple types as specified by {@link IntrospectionConfiguration#isAttributesForPrimitives()}.
25 *
26 * @author <a href='http://jakarta.apache.org/'>Jakarta Commons Team</a>
27 * @version $Revision: 438373 $
28 */
29 public class StandardSimpleTypeMapper extends SimpleTypeMapper {
30
31 /***
32 * Implementation binds as per configuration
33 */
34 public Binding bind(String propertyName, Class propertyType, IntrospectionConfiguration configuration) {
35 if ( configuration.isAttributesForPrimitives() ) {
36
37 return StandardSimpleTypeMapper.Binding.ATTRIBUTE;
38
39 } else {
40
41 return StandardSimpleTypeMapper.Binding.ELEMENT;
42
43 }
44 }
45
46
47
48 }