1 package org.andromda.cartridges.support.webservice.client;
2
3 /**
4 * Used to for mapping types to and from objects.
5 *
6 * @author Chad Brandon
7 */
8 public interface TypeMapper
9 {
10 /**
11 * Gets the object for the given type.
12 *
13 * @param type the type from which to construct the object.
14 *
15 * @return the object.
16 */
17 Object getObject(Class type);
18
19 /**
20 * Gets the object for the given type optionally using the value
21 * on the returned object.
22 *
23 * @param type the type to construct
24 * @param value the optional value used to construct or retrieve the object.
25 * @return the object.
26 */
27 Object getObject(Class type, String value);
28
29 /**
30 * Gets the appropriate string value of the given <code>object</code>.
31 *
32 * @param object the object to convert to a string.
33 * @return the string value.
34 */
35 String getStringValue(Object object);
36
37 /**
38 * Indicates whether or not the given type is considered "simple".
39 *
40 * @param type the type to consider.
41 * @return true/false
42 */
43 boolean isSimpleType(Class type);
44 }