PlatformTargetAnalyzer class

Parses the @NitroModule(...) annotation from a spec file once and exposes typed query methods for each platform target.

Replaces five independent regex passes with a single parse so callers that need multiple platform attributes (e.g. discoverModuleInfos) avoid re-reading and re-matching the annotation for every query.

final analyzer = PlatformTargetAnalyzer.fromSpec(specFile);
if (analyzer.requiresCpp) { /* at least one platform is C++ */ }
if (analyzer.supportsApple) { /* ios or macos is C++ */ }

Constructors

PlatformTargetAnalyzer.fromContent(String content)
Parses the annotation from already-loaded content (zero file reads).
factory
PlatformTargetAnalyzer.fromSpec(File specFile)
Parses the annotation from specFile (one file read, one regex match).
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isNativeCpp bool
True when Android or Linux use direct C++ (src/CMakeLists.txt NDK/GCC path).
no setter
requiresCpp bool
True when at least one platform uses direct C++ (broad check). Matches ios, android, macos, windows, and linux C++ declarations.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportsAndroid bool
True when Android uses direct C++ (bypasses JNI bridge).
no setter
supportsApple bool
True when iOS or macOS use direct C++ (Apple platforms only).
no setter
supportsIosCpp bool
True when only iOS uses direct C++ (not macOS).
no setter
supportsMacosCpp bool
True when only macOS uses direct C++ (not iOS).
no setter
supportsWindows bool
True when Windows uses direct C++ (windows/CMakeLists.txt path).
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited