TypeDeclaration typeDec = (TypeDeclaration) obj;
ITypeBinding binding = typeDec.resolveBinding();
String compName = mappingHelper.getComponentName(binding);
if (compName != null) {
Component comp = arch.getComponentByName(compName);
if (comp != null && VIEW_COMPONENT_TYPE.equals(comp.getStyleType())) {
List<?> constructions = resource.getTypedNodeList(typeDec, ASTNode.CLASS_INSTANCE_CREATION, true);
for (Object constrObj : constructions) {
ClassInstanceCreation constrInv = (ClassInstanceCreation) constrObj;
Type type = constrInv.getType();
ITypeBinding classBinding = type.resolveBinding();
String createdClassCompName = mappingHelper.getComponentName(classBinding);
if (createdClassCompName != null) {
Component createdClassComp = arch.getComponentByName(createdClassCompName);
if (createdClassComp != null && MODEL_COMPONENT_TYPE.equals(createdClassComp.getStyleType())) {
generateResultsForASTNode(history, constrInv, resource,
"The class "+ classBinding.getQualifiedName() + " from the component "+
createdClassCompName + " may not be instantiated in a View component.");
}
}