org.qi4j.api
Interface Qi4j

All Known Subinterfaces:
Qi4jSPI

public interface Qi4j

Encapsulation of the Qi4j API.


Field Summary
static Function<Composite,CompositeInstance> FUNCTION_COMPOSITE_INSTANCE_OF
          Function that returns the CompositeInstance of a Composite.
static Function<Composite,CompositeDescriptor> FUNCTION_DESCRIPTOR_FOR
          Function that returns the CompositeDescriptor of a Composite.
 
Method Summary
 AssociationDescriptor associationDescriptorFor(AbstractAssociation association)
          Returns the AssociationDescriptor of the Association.
 CompositeDescriptor compositeDescriptorFor(java.lang.Object compositeOrServiceReference)
          Returns the CompositeDescriptor of the Composite.
<T> T
dereference(T composite)
          If a Modifier gets a reference to the Composite using @This, then that reference must be dereferenced using this method before handing it out for others to use.
 EntityDescriptor entityDescriptorFor(java.lang.Object entity)
          Returns the EntityDescriptor of the EntityComposite.
 ModelDescriptor modelDescriptorFor(java.lang.Object compositeOrServiceReference)
          Returns the ModelDescriptor of the Composite.
 Module moduleOf(java.lang.Object compositeOrUow)
          Returns the Module or UnitOfWork where the Composite belongs.
 PropertyDescriptor propertyDescriptorFor(Property property)
          Returns the PropertyDescriptor of the Property.
 ServiceDescriptor serviceDescriptorFor(java.lang.Object service)
          Returns the ServiceDescriptor of the ServiceComposite.
 TransientDescriptor transientDescriptorFor(java.lang.Object transsient)
          Returns the TransientDescriptor of the TransientComposite.
 ValueDescriptor valueDescriptorFor(java.lang.Object value)
          Returns the ValueDescriptor of the ValueComposite.
 

Field Detail

FUNCTION_DESCRIPTOR_FOR

static final Function<Composite,CompositeDescriptor> FUNCTION_DESCRIPTOR_FOR
Function that returns the CompositeDescriptor of a Composite.


FUNCTION_COMPOSITE_INSTANCE_OF

static final Function<Composite,CompositeInstance> FUNCTION_COMPOSITE_INSTANCE_OF
Function that returns the CompositeInstance of a Composite.

Method Detail

dereference

<T> T dereference(T composite)
If a Modifier gets a reference to the Composite using @This, then that reference must be dereferenced using this method before handing it out for others to use.

Parameters:
composite - instance reference injected in Modified using @This
Returns:
the dereferenced Composite

moduleOf

Module moduleOf(java.lang.Object compositeOrUow)
Returns the Module or UnitOfWork where the Composite belongs.

Parameters:
compositeOrUow - The Composite (Service, Value, Entity or Transient) or UnitOfWork to lookup the Module it belongs to.
Returns:
The Module instance where the Composite or UnitOfWork belongs to.

modelDescriptorFor

ModelDescriptor modelDescriptorFor(java.lang.Object compositeOrServiceReference)
Returns the ModelDescriptor of the Composite.

Parameters:
compositeOrServiceReference - The Composite (Service, Value, Entity or Transient) for which to lookup the ModelDescriptor
Returns:
The ModelDescriptor of the Composite

compositeDescriptorFor

CompositeDescriptor compositeDescriptorFor(java.lang.Object compositeOrServiceReference)
Returns the CompositeDescriptor of the Composite.

Parameters:
compositeOrServiceReference - The Composite (Service, Value, Entity or Transient) for which to lookup the CompositeDescriptor
Returns:
The CompositeDescriptor of the Composite

transientDescriptorFor

TransientDescriptor transientDescriptorFor(java.lang.Object transsient)
Returns the TransientDescriptor of the TransientComposite.

Parameters:
transsient - The TransientComposite for which to lookup the TransientDescriptor
Returns:
The TransientDescriptor of the TransientComposite

entityDescriptorFor

EntityDescriptor entityDescriptorFor(java.lang.Object entity)
Returns the EntityDescriptor of the EntityComposite.

Parameters:
entity - The EntityComposite for which to lookup the EntityDescriptor
Returns:
The EntityDescriptor of the EntityComposite

valueDescriptorFor

ValueDescriptor valueDescriptorFor(java.lang.Object value)
Returns the ValueDescriptor of the ValueComposite.

Parameters:
value - The ValueComposite for which to lookup the ValueDescriptor
Returns:
The ValueDescriptor of the ValueComposite

serviceDescriptorFor

ServiceDescriptor serviceDescriptorFor(java.lang.Object service)
Returns the ServiceDescriptor of the ServiceComposite.

Parameters:
service - The ServiceComposite for which to lookup the ServiceDescriptor
Returns:
The ServiceDescriptor of the ServiceComposite

propertyDescriptorFor

PropertyDescriptor propertyDescriptorFor(Property property)
Returns the PropertyDescriptor of the Property.

Parameters:
property - The Property for which to lookup the PropertyDescriptor
Returns:
The PropertyDescriptor of the Property

associationDescriptorFor

AssociationDescriptor associationDescriptorFor(AbstractAssociation association)
Returns the AssociationDescriptor of the Association.

Parameters:
association - The Association for which to lookup the AssociationDescriptor
Returns:
The AssociationDescriptor of the Association