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