de.keepondreaming.xml
Class ProxyObjectStrategy

java.lang.Object
  extended by de.keepondreaming.xml.ProxyObjectStrategy
All Implemented Interfaces:
ObjectStrategy

public class ProxyObjectStrategy
extends java.lang.Object
implements ObjectStrategy

This strategy is based upon dynamic proxies. Created objects will be dynamic proxies and member access is handled via calls to the methods offered by the added interface ClassProxyAccess $Author: wintermond $ $Date: 2005/07/10 18:40:58 $ $Log: ProxyObjectStrategy.java,v $ Revision 1.3 2005/07/10 18:40:58 wintermond javadoc Revision 1.2 2005/07/09 10:01:34 wintermond javadoc


Constructor Summary
ProxyObjectStrategy()
          Default constructor
 
Method Summary
 java.lang.Object createInstance(java.lang.Class clazz)
          Creates an instance of the type clazz.
 java.lang.String getMethodName(java.lang.Class clazz, java.lang.String attribute, boolean set)
          Returns the get/set method name for an attribute read by the parser
 void init()
          Restore initial state
 java.lang.Class resolveInterface(java.lang.Object object)
          Determines the interfaces this object was created upon.
 void setAttribute(java.lang.Object target, java.lang.String attribute, java.lang.Object value)
          Sets the attribute on an instance returned via ObjectStrategy.createInstance(Class) target and attribute are guaranteed to be not null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyObjectStrategy

public ProxyObjectStrategy()
Default constructor

Method Detail

createInstance

public java.lang.Object createInstance(java.lang.Class clazz)
Description copied from interface: ObjectStrategy
Creates an instance of the type clazz.

clazz is never null

Specified by:
createInstance in interface ObjectStrategy
Returns:
An instance of the type clazz.

setAttribute

public void setAttribute(java.lang.Object target,
                         java.lang.String attribute,
                         java.lang.Object value)
Description copied from interface: ObjectStrategy
Sets the attribute on an instance returned via ObjectStrategy.createInstance(Class)

target and attribute are guaranteed to be not null.

value is guaranteed to be not null if called by the parser

Specified by:
setAttribute in interface ObjectStrategy
Parameters:
target - Object to set the attribute to
attribute - Attribute name
value - value to set

init

public void init()
Description copied from interface: ObjectStrategy
Restore initial state

Specified by:
init in interface ObjectStrategy

resolveInterface

public java.lang.Class resolveInterface(java.lang.Object object)
Description copied from interface: ObjectStrategy
Determines the interfaces this object was created upon.

Specified by:
resolveInterface in interface ObjectStrategy
Parameters:
object - Object created by ObjectStrategy.createInstance(Class) of this object
Returns:
Target The interfaces this object was created upon.

getMethodName

public java.lang.String getMethodName(java.lang.Class clazz,
                                      java.lang.String attribute,
                                      boolean set)
Description copied from interface: ObjectStrategy
Returns the get/set method name for an attribute read by the parser

Specified by:
getMethodName in interface ObjectStrategy
set - true if set method is requested, false if get
Returns:
Null if attribute can not be handled or strategy does not support the operation, name of method otherwise


Copyright © -2005 . All Rights Reserved.