public class AttributeManager
extends java.lang.Object
Most coupling creation should occur by way of the createPotential... methods in this class. The preferred method is to create a potential attribute (potential consumer or producer) which is then used to make a coupling.
A potential consumer or producer can be created in one of three ways
AttributeType
object.
These concepts are discussed in the javadocs for Attribute
.
Attribute
,
AttributeType
,
PotentialAttribute
,
Coupling
Constructor and Description |
---|
AttributeManager(WorkspaceComponent parentComponent) |
Modifier and Type | Method and Description |
---|---|
protected Consumer<?> |
createConsumer(java.lang.Object parentObject,
java.lang.String methodName,
java.lang.Class<?>[] argumentDataTypes,
java.lang.Object[] argumentValues,
java.lang.String description)
Create a consumer.
|
protected Consumer<?> |
createConsumer(PotentialAttribute potentialAttribute)
Create an actual consumer from a potential consumer.
|
PotentialConsumer |
createPotentialConsumer(java.lang.Object baseObject,
AttributeType type)
Create a potential consumer using an attribute type.
|
PotentialConsumer |
createPotentialConsumer(java.lang.Object baseObject,
java.lang.String methodName,
java.lang.Class<?> dataType)
Create a potential consumer without auxiliary arguments.
|
PotentialConsumer |
createPotentialConsumer(java.lang.Object baseObject,
java.lang.String methodName,
java.lang.Class<?>[] argDataTypes,
java.lang.Object[] argValues)
Create a potential consumer using auxiliary arguments.
|
PotentialProducer |
createPotentialProducer(java.lang.Object baseObject,
AttributeType type)
Create a potential producer using an attribute type.
|
PotentialProducer |
createPotentialProducer(java.lang.Object baseObject,
java.lang.String methodName,
java.lang.Class<?> dataType)
Create a potential producer (without auxiliary arguments).
|
PotentialProducer |
createPotentialProducer(java.lang.Object baseObject,
java.lang.String methodName,
java.lang.Class<?> dataType,
java.lang.Class<?>[] argDataTypes,
java.lang.Object[] argValues)
Create a potential producer using auxiliary arguments.
|
protected Producer<?> |
createProducer(java.lang.Object parentObject,
java.lang.String methodName,
java.lang.Class<?> dataType,
java.lang.Class<?>[] argumentDataTypes,
java.lang.Object[] argumentValues,
java.lang.String description)
Create a producer based on an argument.
|
protected Producer<?> |
createProducer(PotentialAttribute potentialAttribute)
Create an actual producer from a potential producer.
|
public AttributeManager(WorkspaceComponent parentComponent)
parentComponent
- protected Producer<?> createProducer(java.lang.Object parentObject, java.lang.String methodName, java.lang.Class<?> dataType, java.lang.Class<?>[] argumentDataTypes, java.lang.Object[] argumentValues, java.lang.String description)
parentObject
- base objectmethodName
- name of methoddataType
- main data type of data (used in coupling manager)argumentDataTypes
- data types of all arguments to the methodargumentValues
- arguments to the methoddescription
- description of the producerprotected Producer<?> createProducer(PotentialAttribute potentialAttribute)
potentialAttribute
- the potential attribute to actualizeprotected Consumer<?> createConsumer(java.lang.Object parentObject, java.lang.String methodName, java.lang.Class<?>[] argumentDataTypes, java.lang.Object[] argumentValues, java.lang.String description)
Attribute
.parentObject
- parent objectmethodName
- name of methodargumentDataTypes
- type of all arguments, where the first is the
main data typeargumentValues
- values for auxiliary argumentsdescription
- descriptionprotected Consumer<?> createConsumer(PotentialAttribute potentialAttribute)
potentialAttribute
- the potential attribute to actualizepublic PotentialProducer createPotentialProducer(java.lang.Object baseObject, java.lang.String methodName, java.lang.Class<?> dataType, java.lang.Class<?>[] argDataTypes, java.lang.Object[] argValues)
Attribute
.baseObject
- base objectmethodName
- name of method on base objectdataType
- main data type. Type of data returned by the base object.argDataTypes
- signature of method (new Class[] {Class1,
Class2,...})argValues
- values to pass to method (new Object[] {Object1,
Object2,...})public PotentialProducer createPotentialProducer(java.lang.Object baseObject, java.lang.String methodName, java.lang.Class<?> dataType)
baseObject
- base objectmethodName
- name of method on base objectdataType
- main data type. Type of data returned by the base object.public PotentialProducer createPotentialProducer(java.lang.Object baseObject, AttributeType type)
baseObject
- the base objecttype
- the attribute typepublic PotentialConsumer createPotentialConsumer(java.lang.Object baseObject, java.lang.String methodName, java.lang.Class<?>[] argDataTypes, java.lang.Object[] argValues)
Attribute
.baseObject
- base objectmethodName
- name of method on base objectargDataTypes
- signature of method (new Class[] {datatype, Class1,
Class2,...})argValues
- values to pass to method (new Object[] {Class1,
Class2,...})public PotentialConsumer createPotentialConsumer(java.lang.Object baseObject, java.lang.String methodName, java.lang.Class<?> dataType)
baseObject
- base objectmethodName
- name of method on base objectdataType
- main data type. Type of data returned by the base object.public PotentialConsumer createPotentialConsumer(java.lang.Object baseObject, AttributeType type)
baseObject
- the base objecttype
- the attribute type