koresframework/Kores

Elements resolution through CodeTypeResolver

Closed this issue · 0 comments

Add ability to resolve elements in the type through CodeTypeResolver, these elements will be returned in form of representation of the original element, this means that a CodeAPITypeResolver should not return the element but instead should return only the representation.

Element representation

Representation of element is the structure without any real CodeInstruction, so, representation of FieldDeclaration does not have the real value of the field, instead the value is CodeVoid. For methods, the body is always empty (same applies for constructors).

Methods:

  • CodeTypeResolver.resolveTypeDeclaration(Type): Either<Exception, TypeDeclaration>
  • CodeTypeResolver.resolveFields(Type): Either<Exception, List<FieldDeclaration>>
  • CodeTypeResolver.resolveConstructors(Type): Either<Exception, List<ConstructorDeclaration>>
  • CodeTypeResolver.resolveMethods(Type): Either<Exception, List<MethodDeclaration>>

resolveFields, resolveConstructors and resolveMethods should extract elements from type returned by resolveTypeDeclaration.