Cardinality cardinality)
{
if (ai.isValid() == false)
throw new IllegalArgumentException("Not a valid attribute info: " + ai);
TypeInfo info = ai.getType();
if (info.isCollection())
return createCollectionCallback(info, context, ai, whenRequired, dependentState, cardinality);
else if (ai.isProperty())
return new ClassAttributeCallbackItem(info.getType(), whenRequired, dependentState, cardinality, context, ai.getName());
else
return new ClassSingleCallbackItem(info.getType(), whenRequired, dependentState, cardinality, context, ai.getName(), info.getName());
}