org.jboss.system.metadata
Class ServiceValueFactoryValueMetaData

java.lang.Object
  extended by org.jboss.system.metadata.AbstractMetaDataVisitorNode
      extended by org.jboss.system.metadata.ServiceValueFactoryValueMetaData
All Implemented Interfaces:
Serializable, ServiceMetaDataVisitorNode, ServiceValueMetaData

public class ServiceValueFactoryValueMetaData
extends AbstractMetaDataVisitorNode
implements ServiceValueMetaData, Serializable

ServiceInjectionValueMetaData.

Version:
$Revision: 85945 $
Author:
Brian Stansberry
See Also:
Serialized Form

Constructor Summary
ServiceValueFactoryValueMetaData(Object dependency, String method, List<ServiceValueFactoryParameterMetaData> parameters, org.jboss.dependency.spi.ControllerState dependentState, ServiceTextValueMetaData defaultValue)
          Create a new ServiceInjectionValueMetaData.
 
Method Summary
 ServiceTextValueMetaData getDefaultValue()
           
 Object getDependency()
          Get the dependency.
 org.jboss.dependency.spi.ControllerState getDependentState()
          Get the dependentState.
 String getMethod()
          Get the method.
 List<ServiceValueFactoryParameterMetaData> getParameterMetaData()
           
 Object getValue(ServiceValueContext valueContext)
          Get the value
static void populateParameterTypes(Set<org.jboss.reflect.spi.MethodInfo> allMethods, String methodName, List<ServiceValueFactoryParameterMetaData> parameterMetaData)
          Attempts to find a method in allMethods whose name and parameters match the given arguments.
 void visit(ServiceMetaDataVisitor visitor)
          Visit the node
 
Methods inherited from class org.jboss.system.metadata.AbstractMetaDataVisitorNode
addChildren, getChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.metadata.ServiceMetaDataVisitorNode
getChildren
 

Constructor Detail

ServiceValueFactoryValueMetaData

public ServiceValueFactoryValueMetaData(Object dependency,
                                        String method,
                                        List<ServiceValueFactoryParameterMetaData> parameters,
                                        org.jboss.dependency.spi.ControllerState dependentState,
                                        ServiceTextValueMetaData defaultValue)
Create a new ServiceInjectionValueMetaData.

Parameters:
dependency - the dependency
method - the property name
dependentState - the dependent state
Method Detail

getDependency

public Object getDependency()
Get the dependency.

Returns:
the dependency.

getMethod

public String getMethod()
Get the method.

Returns:
the method.

getParameterMetaData

public List<ServiceValueFactoryParameterMetaData> getParameterMetaData()

getDependentState

public org.jboss.dependency.spi.ControllerState getDependentState()
Get the dependentState.

Returns:
the dependentState.

getDefaultValue

public ServiceTextValueMetaData getDefaultValue()

getValue

public Object getValue(ServiceValueContext valueContext)
                throws Throwable
Description copied from interface: ServiceValueMetaData
Get the value

Specified by:
getValue in interface ServiceValueMetaData
Parameters:
valueContext - the value context
Returns:
the value
Throws:
Throwable - for any error

visit

public void visit(ServiceMetaDataVisitor visitor)
Description copied from interface: ServiceMetaDataVisitorNode
Visit the node

Specified by:
visit in interface ServiceMetaDataVisitorNode
Overrides:
visit in class AbstractMetaDataVisitorNode
Parameters:
visitor - the visitor

populateParameterTypes

public static void populateParameterTypes(Set<org.jboss.reflect.spi.MethodInfo> allMethods,
                                          String methodName,
                                          List<ServiceValueFactoryParameterMetaData> parameterMetaData)
Attempts to find a method in allMethods whose name and parameters match the given arguments. If successful, modifies the ServiceValueFactoryParameterMetaData in the provided list to ensure any null parameterTypeName values are no longer null, but instead match the equivalent parameter in the MethodInfo.

If a given ServiceValueFactoryParameterMetaData has no parameterTypeName set, that is treated as meaning "matches any parameter type".

Parameters:
allMethods - set of methods to match against
methodName - name of method to match
parameterMetaData - parameters to the method
Throws:
IllegalArgumentException - if less or more than one MethodInfo matches


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.