private void addTypeMembers(final TypeDeclaration astType, final TypeDefinition type) { for (final FieldDefinition field : type.getDeclaredFields()) { astType.addChild(createField(field), Roles.TYPE_MEMBER); } for (final MethodDefinition method : type.getDeclaredMethods()) { if (method.isConstructor()) { astType.addChild(createConstructor(method), Roles.TYPE_MEMBER); } else { astType.addChild(createMethod(method), Roles.TYPE_MEMBER); } } final List<TypeDefinition> nestedTypes = new ArrayList<>(); for (final TypeDefinition nestedType : type.getDeclaredTypes()) { final TypeReference declaringType = nestedType.getDeclaringType(); if (!nestedType.isLocalClass() && type.isEquivalentTo(declaringType)) { if (nestedType.isAnonymous()) { _typeDeclarations.put(type.getInternalName(), new SoftReference<>(astType)); } else { nestedTypes.add(nestedType); } } } sortNestedTypes(nestedTypes); for (final TypeDefinition nestedType : nestedTypes) { astType.addChild(createTypeNoCache(nestedType), Roles.TYPE_MEMBER); } }
private void addTypeMembers(final TypeDeclaration astType, final TypeDefinition type) { for (final FieldDefinition field : type.getDeclaredFields()) { astType.addChild(createField(field), Roles.TYPE_MEMBER); } for (final MethodDefinition method : type.getDeclaredMethods()) { if (method.isConstructor()) { astType.addChild(createConstructor(method), Roles.TYPE_MEMBER); } else { astType.addChild(createMethod(method), Roles.TYPE_MEMBER); } } final List<TypeDefinition> nestedTypes = new ArrayList<>(); for (final TypeDefinition nestedType : type.getDeclaredTypes()) { final TypeReference declaringType = nestedType.getDeclaringType(); if (!nestedType.isLocalClass() && type.isEquivalentTo(declaringType)) { if (nestedType.isAnonymous()) { _typeDeclarations.put(type.getInternalName(), new SoftReference<>(astType)); } else { nestedTypes.add(nestedType); } } } sortNestedTypes(nestedTypes); for (final TypeDefinition nestedType : nestedTypes) { astType.addChild(createTypeNoCache(nestedType), Roles.TYPE_MEMBER); } }
private void addTypeMembers(final TypeDeclaration astType, final TypeDefinition type) { for (final FieldDefinition field : type.getDeclaredFields()) { astType.addChild(createField(field), Roles.TYPE_MEMBER); } for (final MethodDefinition method : type.getDeclaredMethods()) { if (method.isConstructor()) { astType.addChild(createConstructor(method), Roles.TYPE_MEMBER); } else { astType.addChild(createMethod(method), Roles.TYPE_MEMBER); } } final List<TypeDefinition> nestedTypes = new ArrayList<>(); for (final TypeDefinition nestedType : type.getDeclaredTypes()) { final TypeReference declaringType = nestedType.getDeclaringType(); if (!nestedType.isLocalClass() && type.isEquivalentTo(declaringType)) { if (nestedType.isAnonymous()) { _typeDeclarations.put(type.getInternalName(), new SoftReference<>(astType)); } else { nestedTypes.add(nestedType); } } } sortNestedTypes(nestedTypes); for (final TypeDefinition nestedType : nestedTypes) { astType.addChild(createTypeNoCache(nestedType), Roles.TYPE_MEMBER); } }