operation JavaMM!ClassDeclaration package(): JavaMM!Package { return self.package; } operation JavaMM!Package rootPackage() : JavaMM!Package { if (self.package.isUndefined()) { return self; } else { return self.package.rootPackage(); } } operation JavaMM!ClassDeclaration type(): String { if (not self.modifier.isUndefined()) { if (self.modifier.inheritance=JavaMM!InheritanceKind#final) { return 'F'; } else { if (self.modifier.inheritance=JavaMM!InheritanceKind#abstract) { return 'A'; } else { return 'N'; } } } else { return 'N'; } } rule toNode transform inn : JavaMM!ClassDeclaration to out : GraphMM!Node { guard : not inn.package.isUndefined() and inn.package.rootPackage().name.indexOf('java') < 0 out.name := inn.name; out.type := inn.type(); out.size := inn.bodyDeclarations -> select(bd | bd.isTypeOf(JavaMM!FieldDeclaration)) -> size() + 0.0d; } rule toEdge transform inn : JavaMM!FieldDeclaration to out : GraphMM!Edge { guard : not inn.type.isUndefined() and not inn.type.type.isUndefined() and inn.type.type.isTypeOf(JavaMM!ClassDeclaration) and not inn.type.type.package().isUndefined() and inn.type.type.package().rootPackage().name.indexOf('java') < 0 and not inn.abstractTypeDeclaration.isUndefined() and inn.abstractTypeDeclaration.isTypeOf(JavaMM!ClassDeclaration) and not inn.abstractTypeDeclaration.package.isUndefined() and inn.abstractTypeDeclaration.package.rootPackage().name.indexOf('java') < 0 out.source := inn.abstractTypeDeclaration.equivalent(); out.target := inn.type.type.equivalent(); }