Introduce getConstants generation for Native Modules codegen.
Reviewed By: fkgozali Differential Revision: D6125394 fbshipit-source-id: 13b48c75056868f45394f277d75fb05d167f1c9f
This commit is contained in:
parent
9742bcb4ba
commit
a5550a56ea
|
@ -170,8 +170,13 @@ public class ReactModuleSpecProcessor extends AbstractProcessor {
|
|||
List<? extends Element> elements = typeElement.getEnclosedElements();
|
||||
boolean hasConstants = false;
|
||||
if (elements != null) {
|
||||
hasConstants = elements.stream()
|
||||
.anyMatch((Element m) -> m.getKind() == ElementKind.METHOD && m.getSimpleName().contentEquals("getConstants"));
|
||||
hasConstants =
|
||||
elements
|
||||
.stream()
|
||||
.filter(element -> element.getKind() == ElementKind.METHOD)
|
||||
.map(Element::getSimpleName)
|
||||
.anyMatch(
|
||||
name -> name.contentEquals("getConstants") || name.contentEquals("getTypedExportedConstants"));
|
||||
}
|
||||
|
||||
String valueString = new StringBuilder()
|
||||
|
|
Loading…
Reference in New Issue