|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.spicefactory.cinnamon.io.mapping.AbstractClassMapping
org.spicefactory.cinnamon.io.mapping.AbstractPropertyClassMapping
org.spicefactory.cinnamon.io.mapping.BeanClassMapping
public class BeanClassMapping
ClassMapping implementation that is responsible for mapping the properties of ActionScript
classes to bean properties of Java classes following standard Java bean conventions.
The mapped ActionScript class must have an alias registered in
ActionScript with flash.net.registerClassAlias or the [RemoteClass] metadata tag
(which only works in Flex Applications).
Implementation note: For reflection on the properties of a Java bean this class does not use the standard Introspector built into Java SE since that class does not work properly with generic properties. The Spicelib reflection library will be used instead.
| Constructor Summary | |
|---|---|
BeanClassMapping(String alias,
String actionScriptClass,
Class<?> javaClass,
Class<?> javaFactory,
Set<String> omittedProperties,
ReflectionFactory factory)
Creates a new BeanClassMapping instance. |
|
| Method Summary | |
|---|---|
protected Object |
getProperty(Object instance,
String propertyName)
Reads the property with the given name from the specified target instance. |
void |
init(CinnamonConfig config)
Initialization method that will be called once for each ClassMapping instance at application startup. |
Object |
newJavaInstance()
Creates a new instance of the mapped Java class. |
protected void |
setProperty(Object instance,
String propertyName,
Object value)
Sets the property on the given target instance to the specified value. |
void |
setReflectionFactory(ReflectionFactory reflectionFactory)
Sets the factory to use for reflecting on bean properties. |
String |
toString()
|
| Methods inherited from class org.spicefactory.cinnamon.io.mapping.AbstractPropertyClassMapping |
|---|
readObject, writeObject |
| Methods inherited from class org.spicefactory.cinnamon.io.mapping.AbstractClassMapping |
|---|
getActionScriptClass, getAlias, getEncoding, getJavaClass, getJavaFactory, getPropertyNames, setPropertyNames, writeClassDescriptor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BeanClassMapping(String alias,
String actionScriptClass,
Class<?> javaClass,
Class<?> javaFactory,
Set<String> omittedProperties,
ReflectionFactory factory)
alias - the alias for this mappingactionScriptClass - the fully qualified ActionScript class namejavaClass - the Java classjavaFactory - the (optional) Java factoryomittedProperties - a set of property names to exclude from this mappingfactory - the factory to use for reflecting on bean properties| Method Detail |
|---|
public void init(CinnamonConfig config)
ClassMapping
config - the Cinnamon configuration instancepublic Object newJavaInstance()
ClassMapping
protected Object getProperty(Object instance,
String propertyName)
AbstractPropertyClassMapping
getProperty in class AbstractPropertyClassMappinginstance - the instance to read the property frompropertyName - the name of the property
protected void setProperty(Object instance,
String propertyName,
Object value)
AbstractPropertyClassMapping
setProperty in class AbstractPropertyClassMappinginstance - the instance to set the property onpropertyName - the name of the propertyvalue - the new value of the propertypublic void setReflectionFactory(ReflectionFactory reflectionFactory)
reflectionFactory - the factory to use for reflecting on bean propertiespublic String toString()
toString in class AbstractClassMapping
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||