001 package org.andromda.cartridges.support.webservice.client;
002
003 /**
004 * Used to for mapping types to and from objects.
005 *
006 * @author Chad Brandon
007 */
008 public interface TypeMapper
009 {
010 /**
011 * Gets the object for the given type.
012 *
013 * @param type the type from which to construct the object.
014 *
015 * @return the object.
016 */
017 Object getObject(Class type);
018
019 /**
020 * Gets the object for the given type optionally using the value
021 * on the returned object.
022 *
023 * @param type the type to construct
024 * @param value the optional value used to construct or retrieve the object.
025 * @return the object.
026 */
027 Object getObject(Class type, String value);
028
029 /**
030 * Gets the appropriate string value of the given <code>object</code>.
031 *
032 * @param object the object to convert to a string.
033 * @return the string value.
034 */
035 String getStringValue(Object object);
036
037 /**
038 * Indicates whether or not the given type is considered "simple".
039 *
040 * @param type the type to consider.
041 * @return true/false
042 */
043 boolean isSimpleType(Class type);
044 }