org.apache.xbean.recipe
Class ObjectRecipe

java.lang.Object
  extended by org.apache.xbean.recipe.AbstractRecipe
      extended by org.apache.xbean.recipe.ObjectRecipe
All Implemented Interfaces:
Serializable, Recipe

public class ObjectRecipe
extends AbstractRecipe

See Also:
Serialized Form

Nested Class Summary
static class ObjectRecipe.FieldMember
           
static interface ObjectRecipe.Member
           
static class ObjectRecipe.MethodMember
           
 
Constructor Summary
ObjectRecipe(Class type)
           
ObjectRecipe(Class type, Map<String,Object> properties)
           
ObjectRecipe(Class type, String factoryMethod)
           
ObjectRecipe(Class type, String[] constructorArgNames, Class[] constructorArgTypes)
           
ObjectRecipe(Class type, String factoryMethod, String[] constructorArgNames, Class[] constructorArgTypes)
           
ObjectRecipe(String typeName)
           
ObjectRecipe(String typeName, Map<String,Object> properties)
           
ObjectRecipe(String typeName, String factoryMethod)
           
ObjectRecipe(String typeName, String[] constructorArgNames, Class[] constructorArgTypes)
           
ObjectRecipe(String typeName, String factoryMethod, String[] constructorArgNames, Class[] constructorArgTypes)
           
ObjectRecipe(String type, String factoryMethod, String[] constructorArgNames, Class[] constructorArgTypes, Map<String,Object> properties)
           
 
Method Summary
 void allow(Option option)
           
 boolean canCreate(Class type, ClassLoader classLoader)
           
 Object create(ClassLoader classLoader)
           
 void disallow(Option option)
           
 Method findFactoryMethod(Class typeClass, String factoryMethod)
           
static Field findField(Class typeClass, String propertyName, Object propertyValue, boolean allowPrivate, boolean allowStatic, boolean caseInsesnitive, ClassLoader classLoader)
           
static Field findField(Class typeClass, String propertyName, Object propertyValue, boolean allowPrivate, ClassLoader classLoader)
          Deprecated. use the method with allowStatic
static Method findSetter(Class typeClass, String propertyName, Object propertyValue, boolean allowPrivate, boolean allowStatic, boolean caseInsesnitive, ClassLoader classLoader)
           
static Method findSetter(Class typeClass, String propertyName, Object propertyValue, boolean allowPrivate, ClassLoader classLoader)
          Deprecated. use the method with allowStatic
 Object getProperty(String name)
           
 Map<String,Object> getUnsetProperties()
           
static boolean isAssignableFrom(Class[] expectedTypes, Class[] actualTypes)
           
 void setAllProperties(Map map)
           
 void setFieldProperty(String name, Object value)
           
 void setMethodProperty(String name, Object value)
           
 void setProperty(String name, Object value)
           
 Class setStaticProperties(ClassLoader classLoader)
           
 
Methods inherited from class org.apache.xbean.recipe.AbstractRecipe
create, getPriority
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectRecipe

public ObjectRecipe(Class type)

ObjectRecipe

public ObjectRecipe(Class type,
                    String factoryMethod)

ObjectRecipe

public ObjectRecipe(Class type,
                    Map<String,Object> properties)

ObjectRecipe

public ObjectRecipe(Class type,
                    String[] constructorArgNames,
                    Class[] constructorArgTypes)

ObjectRecipe

public ObjectRecipe(Class type,
                    String factoryMethod,
                    String[] constructorArgNames,
                    Class[] constructorArgTypes)

ObjectRecipe

public ObjectRecipe(String typeName)

ObjectRecipe

public ObjectRecipe(String typeName,
                    String factoryMethod)

ObjectRecipe

public ObjectRecipe(String typeName,
                    Map<String,Object> properties)

ObjectRecipe

public ObjectRecipe(String typeName,
                    String[] constructorArgNames,
                    Class[] constructorArgTypes)

ObjectRecipe

public ObjectRecipe(String typeName,
                    String factoryMethod,
                    String[] constructorArgNames,
                    Class[] constructorArgTypes)

ObjectRecipe

public ObjectRecipe(String type,
                    String factoryMethod,
                    String[] constructorArgNames,
                    Class[] constructorArgTypes,
                    Map<String,Object> properties)
Method Detail

allow

public void allow(Option option)

disallow

public void disallow(Option option)

getProperty

public Object getProperty(String name)

setProperty

public void setProperty(String name,
                        Object value)

setFieldProperty

public void setFieldProperty(String name,
                             Object value)

setMethodProperty

public void setMethodProperty(String name,
                              Object value)

setAllProperties

public void setAllProperties(Map map)

getUnsetProperties

public Map<String,Object> getUnsetProperties()

canCreate

public boolean canCreate(Class type,
                         ClassLoader classLoader)

create

public Object create(ClassLoader classLoader)
              throws ConstructionException
Throws:
ConstructionException

setStaticProperties

public Class setStaticProperties(ClassLoader classLoader)
                          throws ConstructionException
Throws:
ConstructionException

findFactoryMethod

public Method findFactoryMethod(Class typeClass,
                                String factoryMethod)

findSetter

public static Method findSetter(Class typeClass,
                                String propertyName,
                                Object propertyValue,
                                boolean allowPrivate,
                                ClassLoader classLoader)
Deprecated. use the method with allowStatic

Parameters:
typeClass -
propertyName -
propertyValue -
allowPrivate -
classLoader -
Returns:
field

findSetter

public static Method findSetter(Class typeClass,
                                String propertyName,
                                Object propertyValue,
                                boolean allowPrivate,
                                boolean allowStatic,
                                boolean caseInsesnitive,
                                ClassLoader classLoader)

findField

public static Field findField(Class typeClass,
                              String propertyName,
                              Object propertyValue,
                              boolean allowPrivate,
                              ClassLoader classLoader)
Deprecated. use the method with allowStatic

Parameters:
typeClass -
propertyName -
propertyValue -
allowPrivate -
classLoader -
Returns:
field

findField

public static Field findField(Class typeClass,
                              String propertyName,
                              Object propertyValue,
                              boolean allowPrivate,
                              boolean allowStatic,
                              boolean caseInsesnitive,
                              ClassLoader classLoader)

isAssignableFrom

public static boolean isAssignableFrom(Class[] expectedTypes,
                                       Class[] actualTypes)


Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.