org.apache.aries.blueprint.reflect
Class BeanMetadataImpl

java.lang.Object
  extended by org.apache.aries.blueprint.reflect.ComponentMetadataImpl
      extended by org.apache.aries.blueprint.reflect.BeanMetadataImpl
All Implemented Interfaces:
ExtendedBeanMetadata, MutableBeanMetadata, MutableComponentMetadata, BeanMetadata, ComponentMetadata, Metadata, NonNullMetadata, Target

public class BeanMetadataImpl
extends ComponentMetadataImpl
implements MutableBeanMetadata

Implementation of BeanMetadata

Version:
$Rev: 910448 $, $Date: 2010-02-16 09:50:18 +0000 (Tue, 16 Feb 2010) $

Field Summary
 
Fields inherited from class org.apache.aries.blueprint.reflect.ComponentMetadataImpl
activation, dependsOn, id
 
Fields inherited from interface org.osgi.service.blueprint.reflect.BeanMetadata
SCOPE_PROTOTYPE, SCOPE_SINGLETON
 
Fields inherited from interface org.osgi.service.blueprint.reflect.ComponentMetadata
ACTIVATION_EAGER, ACTIVATION_LAZY
 
Constructor Summary
BeanMetadataImpl()
           
BeanMetadataImpl(BeanMetadata source)
           
 
Method Summary
 void addArgument(BeanArgument argument)
           
 BeanArgument addArgument(Metadata value, java.lang.String valueType, int index)
           
 void addProperty(BeanProperty property)
           
 BeanProperty addProperty(java.lang.String name, Metadata value)
           
 java.util.List<BeanArgument> getArguments()
          Return the arguments for the factory method or constructor of the bean.
 java.lang.String getClassName()
          Return the name of the class specified for the bean.
 java.lang.String getDestroyMethod()
          Return the name of the destroy method specified for the bean.
 Target getFactoryComponent()
          Return the Metadata for the factory component on which to invoke the factory method for the bean.
 java.lang.String getFactoryMethod()
          Return the name of the factory method for the bean.
 boolean getFieldInjection()
          Whether the bean allows properties to be injected directly into its fields in the case where an appropriate setter method is not available.
 java.lang.String getInitMethod()
          Return the name of the init method specified for the bean.
 java.util.List<BeanProperty> getProperties()
          Return the properties for the bean.
 java.lang.Class getRuntimeClass()
          Provide an actual class, this overrides the class name if set.
 java.lang.String getScope()
          Return the scope for the bean.
 boolean isProcessor()
           
 void removeArgument(BeanArgument argument)
           
 void removeProperty(BeanProperty property)
           
 void setArguments(java.util.List<BeanArgument> arguments)
           
 void setClassName(java.lang.String className)
           
 void setDestroyMethod(java.lang.String destroyMethodName)
           
 void setFactoryComponent(Target factoryComponent)
           
 void setFactoryMethod(java.lang.String factoryMethodName)
           
 void setFieldInjection(boolean fieldInjection)
           
 void setInitMethod(java.lang.String initMethodName)
           
 void setProcessor(boolean processor)
           
 void setProperties(java.util.List<BeanProperty> properties)
           
 void setRuntimeClass(java.lang.Class runtimeClass)
           
 void setScope(java.lang.String scope)
           
 java.lang.String toString()
           
 
Methods inherited from class org.apache.aries.blueprint.reflect.ComponentMetadataImpl
addDependsOn, getActivation, getDependsOn, getId, removeDependsOn, setActivation, setDependsOn, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.osgi.service.blueprint.reflect.ComponentMetadata
getActivation, getDependsOn, getId
 
Methods inherited from interface org.apache.aries.blueprint.mutable.MutableComponentMetadata
addDependsOn, removeDependsOn, setActivation, setDependsOn, setId
 

Constructor Detail

BeanMetadataImpl

public BeanMetadataImpl()

BeanMetadataImpl

public BeanMetadataImpl(BeanMetadata source)
Method Detail

getClassName

public java.lang.String getClassName()
Description copied from interface: BeanMetadata
Return the name of the class specified for the bean. This is specified by the class attribute of the bean definition.

Specified by:
getClassName in interface BeanMetadata
Returns:
The name of the class specified for the bean. If no class is specified in the bean definition, because the a factory component is used instead, then this method will return null.

setClassName

public void setClassName(java.lang.String className)
Specified by:
setClassName in interface MutableBeanMetadata

getInitMethod

public java.lang.String getInitMethod()
Description copied from interface: BeanMetadata
Return the name of the init method specified for the bean. This is specified by the init-method attribute of the bean definition.

Specified by:
getInitMethod in interface BeanMetadata
Returns:
The name of the init method specified for the bean, or null if no init method is specified.

setInitMethod

public void setInitMethod(java.lang.String initMethodName)
Specified by:
setInitMethod in interface MutableBeanMetadata

getDestroyMethod

public java.lang.String getDestroyMethod()
Description copied from interface: BeanMetadata
Return the name of the destroy method specified for the bean. This is specified by the destroy-method attribute of the bean definition.

Specified by:
getDestroyMethod in interface BeanMetadata
Returns:
The name of the destroy method specified for the bean, or null if no destroy method is specified.

setDestroyMethod

public void setDestroyMethod(java.lang.String destroyMethodName)
Specified by:
setDestroyMethod in interface MutableBeanMetadata

getArguments

public java.util.List<BeanArgument> getArguments()
Description copied from interface: BeanMetadata
Return the arguments for the factory method or constructor of the bean. This is specified by the child argument elements.

Specified by:
getArguments in interface BeanMetadata
Returns:
An immutable List of BeanArgument objects for the factory method or constructor of the bean. The List is empty if no arguments are specified for the bean.

setArguments

public void setArguments(java.util.List<BeanArgument> arguments)

addArgument

public void addArgument(BeanArgument argument)
Specified by:
addArgument in interface MutableBeanMetadata

addArgument

public BeanArgument addArgument(Metadata value,
                                java.lang.String valueType,
                                int index)
Specified by:
addArgument in interface MutableBeanMetadata

removeArgument

public void removeArgument(BeanArgument argument)
Specified by:
removeArgument in interface MutableBeanMetadata

getProperties

public java.util.List<BeanProperty> getProperties()
Description copied from interface: BeanMetadata
Return the properties for the bean. This is specified by the child property elements.

Specified by:
getProperties in interface BeanMetadata
Returns:
An immutable List of BeanProperty objects, with one entry for each property to be injected in the bean. The List is empty if no property injection is specified for the bean.

setProperties

public void setProperties(java.util.List<BeanProperty> properties)

addProperty

public void addProperty(BeanProperty property)
Specified by:
addProperty in interface MutableBeanMetadata

addProperty

public BeanProperty addProperty(java.lang.String name,
                                Metadata value)
Specified by:
addProperty in interface MutableBeanMetadata

removeProperty

public void removeProperty(BeanProperty property)
Specified by:
removeProperty in interface MutableBeanMetadata

getFactoryMethod

public java.lang.String getFactoryMethod()
Description copied from interface: BeanMetadata
Return the name of the factory method for the bean. This is specified by the factory-method attribute of the bean.

Specified by:
getFactoryMethod in interface BeanMetadata
Returns:
The name of the factory method of the bean or null if no factory method is specified for the bean.

setFactoryMethod

public void setFactoryMethod(java.lang.String factoryMethodName)
Specified by:
setFactoryMethod in interface MutableBeanMetadata

getFactoryComponent

public Target getFactoryComponent()
Description copied from interface: BeanMetadata
Return the Metadata for the factory component on which to invoke the factory method for the bean. This is specified by the factory-ref attribute of the bean.

When a factory method and factory component have been specified for the bean, this method returns the factory component on which to invoke the factory method for the bean. When no factory component has been specified this method will return null. When a factory method has been specified for the bean but a factory component has not been specified, the factory method must be invoked as a static method on the bean's class.

Specified by:
getFactoryComponent in interface BeanMetadata
Returns:
The Metadata for the factory component on which to invoke the factory method for the bean or null if no factory component is specified.

setFactoryComponent

public void setFactoryComponent(Target factoryComponent)
Specified by:
setFactoryComponent in interface MutableBeanMetadata

getScope

public java.lang.String getScope()
Description copied from interface: BeanMetadata
Return the scope for the bean.

Specified by:
getScope in interface BeanMetadata
Returns:
The scope for the bean.
See Also:
BeanMetadata.SCOPE_SINGLETON, BeanMetadata.SCOPE_PROTOTYPE

setScope

public void setScope(java.lang.String scope)
Specified by:
setScope in interface MutableBeanMetadata

getRuntimeClass

public java.lang.Class getRuntimeClass()
Description copied from interface: ExtendedBeanMetadata
Provide an actual class, this overrides the class name if set. This is useful for Namespace Handler services that do not want to force the Blueprint bundle to import implementation classes.

Specified by:
getRuntimeClass in interface ExtendedBeanMetadata
Returns:
Return the class to use in runtime or null.

setRuntimeClass

public void setRuntimeClass(java.lang.Class runtimeClass)
Specified by:
setRuntimeClass in interface MutableBeanMetadata

isProcessor

public boolean isProcessor()
Specified by:
isProcessor in interface ExtendedBeanMetadata

setProcessor

public void setProcessor(boolean processor)
Specified by:
setProcessor in interface MutableBeanMetadata

getFieldInjection

public boolean getFieldInjection()
Description copied from interface: ExtendedBeanMetadata
Whether the bean allows properties to be injected directly into its fields in the case where an appropriate setter method is not available.

Specified by:
getFieldInjection in interface ExtendedBeanMetadata
Returns:
Whether field injection is allowed

setFieldInjection

public void setFieldInjection(boolean fieldInjection)
Specified by:
setFieldInjection in interface MutableBeanMetadata

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.