Search in sources :

Example 6 with NamedAssociation

use of org.qi4j.api.association.NamedAssociation in project qi4j-sdk by Qi4j.

the class MethodFinder method doFilter.

/**
     * Do the filter for method return type (Property, Association, ManyAssociation, NamedAssociation)
     * by removing the entry from the list.
     *
     * @param list list of CompositeMethodDetailDescriptor
     */
private void doFilter(List<CompositeMethodDetailDescriptor> list) {
    if (list.isEmpty()) {
        return;
    }
    Iterator<CompositeMethodDetailDescriptor> iter = list.iterator();
    while (iter.hasNext()) {
        CompositeMethodDetailDescriptor descriptor = iter.next();
        Method method = descriptor.descriptor().method();
        if (Property.class.isAssignableFrom(method.getReturnType())) {
            iter.remove();
        } else if (Association.class.isAssignableFrom(method.getReturnType())) {
            iter.remove();
        } else if (ManyAssociation.class.isAssignableFrom(method.getReturnType())) {
            iter.remove();
        } else if (NamedAssociation.class.isAssignableFrom(method.getReturnType())) {
            iter.remove();
        }
    }
}
Also used : Association(org.qi4j.api.association.Association) ManyAssociation(org.qi4j.api.association.ManyAssociation) NamedAssociation(org.qi4j.api.association.NamedAssociation) CompositeMethodDetailDescriptor(org.qi4j.tools.model.descriptor.CompositeMethodDetailDescriptor) NamedAssociation(org.qi4j.api.association.NamedAssociation) Method(java.lang.reflect.Method)

Aggregations

NamedAssociation (org.qi4j.api.association.NamedAssociation)6 Association (org.qi4j.api.association.Association)3 ManyAssociation (org.qi4j.api.association.ManyAssociation)3 NamedAssociationModel (org.qi4j.runtime.association.NamedAssociationModel)3 Annotation (java.lang.annotation.Annotation)2 Member (java.lang.reflect.Member)2 Method (java.lang.reflect.Method)2 MetaInfo (org.qi4j.api.common.MetaInfo)2 Optional (org.qi4j.api.common.Optional)2 ValueConstraintsInstance (org.qi4j.runtime.composite.ValueConstraintsInstance)2 ValueConstraintsModel (org.qi4j.runtime.composite.ValueConstraintsModel)2 CompositeMethodDetailDescriptor (org.qi4j.tools.model.descriptor.CompositeMethodDetailDescriptor)2 AccessibleObject (java.lang.reflect.AccessibleObject)1 AbstractAssociation (org.qi4j.api.association.AbstractAssociation)1 AssociationDescriptor (org.qi4j.api.association.AssociationDescriptor)1 AssociationStateDescriptor (org.qi4j.api.association.AssociationStateDescriptor)1 StateDescriptor (org.qi4j.api.composite.StateDescriptor)1 EntityDescriptor (org.qi4j.api.entity.EntityDescriptor)1 State (org.qi4j.api.injection.scope.State)1 Property (org.qi4j.api.property.Property)1