org.jboss.beans.metadata.plugins
Class AbstractValueFactoryMetaData

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.beans.metadata.plugins.AbstractValueMetaData
          extended by org.jboss.beans.metadata.plugins.AbstractValueFactoryMetaData
All Implemented Interfaces:
Serializable, Cloneable, MutableParameterizedMetaData, TypeProvider, MetaDataVisitorNode, ParameterizedMetaData, ValueMetaData, org.jboss.util.JBossInterface

public class AbstractValueFactoryMetaData
extends AbstractValueMetaData
implements MutableParameterizedMetaData

ValueFactory value.

Author:
Adrian Brock, Ales Justin
See Also:
Serialized Form

Field Summary
protected  KernelControllerContext context
          The context
protected  String defaultValue
          The defaultValue
protected  ControllerState dependentState
          The required state of the dependency or null to look in the registry
protected  String method
          The property name
protected  String parameter
          The parameter
protected  List<ParameterMetaData> parameters
          The parameters
protected  ControllerState whenRequiredState
          The when required state of the dependency or null to use current context state
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Fields inherited from interface org.jboss.beans.metadata.plugins.TypeProvider
ERROR_MSG
 
Constructor Summary
AbstractValueFactoryMetaData()
          Create a new dependency value
AbstractValueFactoryMetaData(Object value)
          Create a new dependency value
AbstractValueFactoryMetaData(Object value, String method)
          Create a new value-factory value
AbstractValueFactoryMetaData(Object value, String method, String defaultValue)
          Create a new value-factory value
 
Method Summary
 AbstractValueFactoryMetaData clone()
          Clone the object
 Iterator<? extends MetaDataVisitorNode> getChildren()
          Return the child nodes
 String getDefaultValue()
          Get the default value.
 ControllerState getDependentState()
          Get the dependant state.
 String getMethod()
          Get the method
 String getParameter()
          Get the parameter.
 List<ParameterMetaData> getParameters()
          Get the parameters.
 Object getValue(org.jboss.reflect.spi.TypeInfo info, ClassLoader cl)
          Get the value.
 ControllerState getWhenRequiredState()
          Get when required state.
 void initialVisit(MetaDataVisitor visitor)
          Visit the node
 void setBean(String bean)
           
 void setDefaultValue(String defaultValue)
          Set the default value.
 void setDependentState(ControllerState dependentState)
          Set the required state of the dependency
 void setMethod(String method)
          Set the property
 void setParameter(String parameter)
          Set the parameter.
 void setParameters(List<ParameterMetaData> parameters)
          Set the parameters.
 void setWhenRequiredState(ControllerState whenRequiredState)
          Set the when required state of the dependency
 void toString(org.jboss.util.JBossStringBuilder buffer)
           
 
Methods inherited from class org.jboss.beans.metadata.plugins.AbstractValueMetaData
describeVisit, getType, getUnderlyingValue, getValue, isUseJMXObjectNameFix, setValue, toShortString
 
Methods inherited from class org.jboss.util.JBossObject
cacheGetHashCode, cacheToString, equals, flushJBossObjectCache, getClassShortName, getHashCode, hashCode, list, notEqual, toShortString, toString, toStringImplementation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.util.JBossInterface
toShortString
 

Field Detail

context

protected transient KernelControllerContext context
The context


method

protected String method
The property name


parameter

protected String parameter
The parameter


defaultValue

protected String defaultValue
The defaultValue


whenRequiredState

protected ControllerState whenRequiredState
The when required state of the dependency or null to use current context state


dependentState

protected ControllerState dependentState
The required state of the dependency or null to look in the registry


parameters

protected List<ParameterMetaData> parameters
The parameters

Constructor Detail

AbstractValueFactoryMetaData

public AbstractValueFactoryMetaData()
Create a new dependency value


AbstractValueFactoryMetaData

public AbstractValueFactoryMetaData(Object value)
Create a new dependency value

Parameters:
value - the value

AbstractValueFactoryMetaData

public AbstractValueFactoryMetaData(Object value,
                                    String method)
Create a new value-factory value

Parameters:
value - the value
method - the method

AbstractValueFactoryMetaData

public AbstractValueFactoryMetaData(Object value,
                                    String method,
                                    String defaultValue)
Create a new value-factory value

Parameters:
value - the value
method - the method
defaultValue - the default
Method Detail

setBean

public void setBean(String bean)

getMethod

public String getMethod()
Get the method

Returns:
the method

setMethod

public void setMethod(String method)
Set the property

Parameters:
method - the property name

getParameter

public String getParameter()
Get the parameter.

Returns:
the parameter

setParameter

public void setParameter(String parameter)
Set the parameter.

Parameters:
parameter - the parameter

setWhenRequiredState

public void setWhenRequiredState(ControllerState whenRequiredState)
Set the when required state of the dependency

Parameters:
whenRequiredState - the when required state or null if it uses current context state

getWhenRequiredState

public ControllerState getWhenRequiredState()
Get when required state.

Returns:
when required state

setDependentState

public void setDependentState(ControllerState dependentState)
Set the required state of the dependency

Parameters:
dependentState - the required state or null if it must be in the registry

getDependentState

public ControllerState getDependentState()
Get the dependant state.

Returns:
the dependant state

getDefaultValue

public String getDefaultValue()
Get the default value.

Returns:
the default value

setDefaultValue

public void setDefaultValue(String defaultValue)
Set the default value.

Parameters:
defaultValue - default value

getParameters

public List<ParameterMetaData> getParameters()
Get the parameters.

Specified by:
getParameters in interface ParameterizedMetaData
Returns:
the parameters

setParameters

public void setParameters(List<ParameterMetaData> parameters)
Set the parameters.

Specified by:
setParameters in interface MutableParameterizedMetaData
Parameters:
parameters - the parameters

initialVisit

public void initialVisit(MetaDataVisitor visitor)
Description copied from interface: MetaDataVisitorNode
Visit the node

Specified by:
initialVisit in interface MetaDataVisitorNode
Overrides:
initialVisit in class AbstractValueMetaData
Parameters:
visitor - the visitor

getChildren

public Iterator<? extends MetaDataVisitorNode> getChildren()
Description copied from interface: MetaDataVisitorNode
Return the child nodes

Specified by:
getChildren in interface MetaDataVisitorNode
Overrides:
getChildren in class AbstractValueMetaData
Returns:
Iterator or null if there aren't any

getValue

public Object getValue(org.jboss.reflect.spi.TypeInfo info,
                       ClassLoader cl)
                throws Throwable
Description copied from interface: ValueMetaData
Get the value.

Specified by:
getValue in interface ValueMetaData
Overrides:
getValue in class AbstractValueMetaData
Parameters:
info - the type info
cl - the classloader
Returns:
the value.
Throws:
Throwable - for any error

toString

public void toString(org.jboss.util.JBossStringBuilder buffer)
Overrides:
toString in class AbstractValueMetaData

clone

public AbstractValueFactoryMetaData clone()
Description copied from interface: MetaDataVisitorNode
Clone the object

Specified by:
clone in interface MetaDataVisitorNode
Specified by:
clone in interface org.jboss.util.JBossInterface
Overrides:
clone in class AbstractValueMetaData
Returns:
a clone of the object


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