Skip to content

Make it possible to implement ResourceIdentifier #55568

Open
@HosseinYousefi

Description

@HosseinYousefi

ResourceIdentifier is currently not a final class. However, it won't behave correctly if we subclass it, and use the subclass as an annotation, since we're checking it based on the name.

I would like to be able to implement it for jnigen, so I don't have to repeat certain things in the generated code. For example:

class JClassIdentifier implements ResourceIdentifier {
  final String name;
  final String somethingElse;

  const JClassIdentifier(this.name, this.somethingElse);
}

@JClassIdentifier('Foo', 'Bar') // instead of @ResourceIdentifier('jnigen-Foo-Bar')
late final JClass foobar;

@mosuem
cc/ @dcharkes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions