if (getTypeBinding().getInterfaces().length != 0) {
// An anonymous class can implement only 1 interface
lImplementedType = getClass(getTypeBinding().getInterfaces()[0], null, false);
lImplementedType = (FamixClass) getModel().addElement(lImplementedType);
lImplementedType.setModifiers(lImplementedType.getModifiers() | AbstractFamixEntity.MODIFIER_INTERFACE);
FamixAssociation subtyping = getFactory().createSubtyping(getCurrType(), lImplementedType);
subtyping.setSourceAnchor(getSourceAnchor());
getModel().addRelation(subtyping);
} else {
lImplementedType = getClass(getTypeBinding().getSuperclass(), null, false);
lImplementedType = (FamixClass) getModel().addElement(lImplementedType);
FamixAssociation inheritance = getFactory().createInheritance(getCurrType(), lImplementedType);
inheritance.setSourceAnchor(getSourceAnchor());
getModel().addRelation(inheritance);
}
} else {
String lClassID = AbstractASTNodeHandler.UNDEFINED_BINDING;
if (getASTNode().getParent() instanceof ClassInstanceCreation) {
SimpleType castedType = (SimpleType) ((ClassInstanceCreation) getASTNode().getParent()).getType();
lClassID += AbstractFamixEntity.NAME_DELIMITER + castedType.getName().getFullyQualifiedName();
}
lImplementedType = getFactory().createClass(lClassID, null);
lImplementedType = (FamixClass) getModel().addElement(lImplementedType);
// We do not know whether it is a superclass or an interface; we create a Subtype
FamixAssociation subtyping = getFactory().createSubtyping(getCurrType(), lImplementedType);
subtyping.setSourceAnchor(getSourceAnchor());
getModel().addRelation(subtyping);
}
// getModel().addElement(lImplementedType);
}