flex.messaging.io
Class BeanProxy

java.lang.Object
  extended by flex.messaging.io.AbstractProxy
      extended by flex.messaging.io.BeanProxy
All Implemented Interfaces:
PropertyProxy, Serializable, Cloneable
Direct Known Subclasses:
DictionaryProxy, MapProxy, ThrowableProxy

public class BeanProxy
extends AbstractProxy

Uses Bean introspection to collect the properties for a given instance.

See Also:
Serialized Form

Constructor Summary
BeanProxy()
          Constructor
BeanProxy(Object defaultInstance)
          Construct a new BeanProxy with the provided default instance.
 
Method Summary
static void addIgnoreProperty(Class c, String propertyName)
          Add a property to the ignore list for this class.
static void clear()
          Clears all static caches.
 Object clone()
          Returns a copy of the PropertyProxy so that it can be used as a template without modifying/creating global references to instances, descriptors etc.
 String getAlias(Object instance)
          The class name alias for the given instance.
 List getPropertyNames(Object instance)
          The List of property names as Strings that make up the traits of the given instance.
 Class getType(Object instance, String propertyName)
          Looks up the Class type of the property by name on the given instance.
 Object getValue(Object instance, String propertyName)
          Looks up the value of a property by name for the given instance.
static boolean isPropertyIgnored(Class c, String propertyName)
          Is this property on the ignore list for this class?
static boolean isPublicAccessor(int modifiers)
          Do the provided modifiers indicate that this is public?
static boolean isPublicField(int modifiers)
          Do the provided modifiers indicate that this is public?
 void setValue(Object instance, String propertyName, Object value)
          Updates the value of a property by name for the given instance.
 
Methods inherited from class flex.messaging.io.AbstractProxy
createInstance, createInstanceFromClassName, getAlias, getClassFromClassName, getClassFromClassName, getDefaultInstance, getDescriptor, getIncludeReadOnly, getInstanceToSerialize, getPropertyNames, getSerializationContext, getType, getValue, instanceComplete, isDynamic, isExternalizable, isExternalizable, setAlias, setDefaultInstance, setDescriptor, setDynamic, setExternalizable, setIncludeReadOnly, setSerializationContext, setValue, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanProxy

public BeanProxy()
Constructor


BeanProxy

public BeanProxy(Object defaultInstance)
Construct a new BeanProxy with the provided default instance.

Parameters:
defaultInstance - defines the alias if provided
Method Detail

getAlias

public String getAlias(Object instance)
The class name alias for the given instance.

Parameters:
instance - the object to get the alias of.
Returns:
The class name alias to be used in serializing the type traits.

getPropertyNames

public List getPropertyNames(Object instance)
The List of property names as Strings that make up the traits of the given instance. These traits determine which properties are to be serialized.

Parameters:
instance - the object to examine
Returns:
List of property names as Strings to be serialized.

getType

public Class getType(Object instance,
                     String propertyName)
Looks up the Class type of the property by name on the given instance.

Parameters:
instance - The instance that possesses the property.
propertyName - The name of the property.
Returns:
The property type.

getValue

public Object getValue(Object instance,
                       String propertyName)
Looks up the value of a property by name for the given instance.

Parameters:
instance - The instance that possesses the requested property.
propertyName - The name of the property.
Returns:
The value of the given property.

setValue

public void setValue(Object instance,
                     String propertyName,
                     Object value)
Updates the value of a property by name for the given instance.

Parameters:
instance - The instance that possesses the requested property.
propertyName - The name of the property to update.
value - The updated value for the property.

isPropertyIgnored

public static boolean isPropertyIgnored(Class c,
                                        String propertyName)
Is this property on the ignore list for this class?

Parameters:
c - the class.
propertyName - the property name.
Returns:
true if we should ignore this property.

addIgnoreProperty

public static void addIgnoreProperty(Class c,
                                     String propertyName)
Add a property to the ignore list for this class.

Parameters:
c - the class.
propertyName - the property to ignore.

isPublicField

public static boolean isPublicField(int modifiers)
Do the provided modifiers indicate that this is public?

Parameters:
modifiers - the flags to check
Returns:
true if public but not final, static or transient.

isPublicAccessor

public static boolean isPublicAccessor(int modifiers)
Do the provided modifiers indicate that this is public?

Parameters:
modifiers - the flags to check
Returns:
true if public but not static.

clone

public Object clone()
Returns a copy of the PropertyProxy so that it can be used as a template without modifying/creating global references to instances, descriptors etc.

Specified by:
clone in interface PropertyProxy
Overrides:
clone in class AbstractProxy
Returns:
A copy of the PropertyProxy.

clear

public static void clear()
Clears all static caches.



Copyright © 2008 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/blazeds/1/javadoc/flex/messaging/io/BeanProxy.html