de.keepondreaming.xml
Interface ObjectStrategy

All Known Implementing Classes:
ClassNameMappingObjectStrategy, ProxyObjectStrategy

public interface ObjectStrategy

Strategy pattern to create instances needed by XmlConverter $Author: wintermond $ $Date: 2005/07/10 18:40:13 $ $Log: ObjectStrategy.java,v $ Revision 1.3 2005/07/10 18:40:13 wintermond javadoc init() Revision 1.2 2005/07/09 09:56:51 wintermond javadoc


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 createInstance(Class) target and attribute are guaranteed to be not null.
 

Method Detail

createInstance

java.lang.Object createInstance(java.lang.Class clazz)
Creates an instance of the type clazz.

clazz is never null

Parameters:
clazz -
Returns:
An instance of the type clazz.

setAttribute

void setAttribute(java.lang.Object target,
                  java.lang.String attribute,
                  java.lang.Object value)
Sets the attribute on an instance returned via createInstance(Class)

target and attribute are guaranteed to be not null.

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

Parameters:
target - Object to set the attribute to
attribute - Attribute name
value - value to set

init

void init()
Restore initial state


resolveInterface

java.lang.Class resolveInterface(java.lang.Object object)
Determines the interfaces this object was created upon.

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

getMethodName

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

Parameters:
clazz -
attribute -
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.