|
|||||||||
| 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
public abstract class AbstractPropertyClassMapping
Abstract base class for mappings that deal with properties. Serves as a common base class
for AnonymousClassMapping and BeanClassMapping. Contains the IO logic
for reading/writing properties from AMF3 binary data. Subclasses only need to implement
the logic for writing/reading these properties from/to the mapped instances.
| Constructor Summary | |
|---|---|
protected |
AbstractPropertyClassMapping(String alias,
String actionScriptClass,
Class<?> javaClass,
Class<?> javaFactory,
ObjectEncoding encoding)
Creates a new ClassMapping instance. |
| Method Summary | |
|---|---|
protected abstract Object |
getProperty(Object instance,
String propertyName)
Reads the property with the given name from the specified target instance. |
void |
readObject(Object instance,
AMFInput input,
ObjectEncoding encoding,
String[] propertyNames)
Restores the content of the given object from the AMFInput instance. |
protected abstract void |
setProperty(Object instance,
String propertyName,
Object value)
Sets the property on the given target instance to the specified value. |
void |
writeObject(Object instance,
AMFOutput output)
Writes the content of the specified object to the given AMFOutput. |
| Methods inherited from class org.spicefactory.cinnamon.io.mapping.AbstractClassMapping |
|---|
getActionScriptClass, getAlias, getEncoding, getJavaClass, getJavaFactory, getPropertyNames, setPropertyNames, toString, writeClassDescriptor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.spicefactory.cinnamon.io.mapping.ClassMapping |
|---|
init, newJavaInstance |
| Constructor Detail |
|---|
protected AbstractPropertyClassMapping(String alias,
String actionScriptClass,
Class<?> javaClass,
Class<?> javaFactory,
ObjectEncoding encoding)
alias - the alias for this mappingactionScriptClass - the fully qualified ActionScript class namejavaClass - the Java classjavaFactory - the (optional) Java factoryencoding - the object encoding for this mapping| Method Detail |
|---|
public void readObject(Object instance,
AMFInput input,
ObjectEncoding encoding,
String[] propertyNames)
ClassMapping
instance - the object to be restoredinput - the AMF3 data to read fromencoding - the type of object encoding to usepropertyNames - the names of the properties of the object (may be empty for some kinds of mappings)
public void writeObject(Object instance,
AMFOutput output)
ClassMapping
instance - the object to be serializedoutput - the output to write to
protected abstract void setProperty(Object instance,
String propertyName,
Object value)
instance - the instance to set the property onpropertyName - the name of the propertyvalue - the new value of the property
protected abstract Object getProperty(Object instance,
String propertyName)
instance - the instance to read the property frompropertyName - the name of the property
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||