Loader API#

Implementation#

class bshark.compiler.BaseLoader(path: List[str], uc: dict | None = None)[source]#
import_(qname: str) List[Unit][source]#

Imports the given .aidl file and returns all defined units

load_aidl(rpath: str) Tuple[Unit][source]#

Loads the given aidl file and returns all defined parcelable or binder units. This action will cache all loaded units and aditionally, it will try to resolve the Java equivalent of parcelables.

This method will have no effect if the unit is already cached.

parse_aidl(abs_path: str) Unit[source]#

Parses the given aidl file and returns the parsed unit without caching it.

parse_java(abs_path: str, name: str, parent: str | None = None) Unit[source]#

Parses the given java file and searches for the given class

parse_json(abs_path: str) Unit[source]#

Parses the given json file and returns the cached unit

to_absolute(rpath: str) str[source]#

Converts a relative path to an absolute path.