void injectScriptHierarchy(JythonScript script) {

		if (script == null) {
			return;
		}

		// Inject 'this'
		setVariable("this", script);

		// Loop though the script class hierarchy
		for (Class<?> scriptClass = script.getClass(); scriptClass != Object.class; scriptClass =
			scriptClass.getSuperclass()) {

			// Add public and protected fields
			for (Field field : scriptClass.getDeclaredFields()) {
				if (Modifier.isPublic(field.getModifiers()) ||
					Modifier.isProtected(field.getModifiers())) {
					try {
						field.setAccessible(true);
						setVariable(field.getName(), field.get(script));
					}
					catch (IllegalAccessException iae) {
						throw new AssertException("Unexpected security manager being used!");
					}
				}
			}

			// Add public methods (only once). Ignore inner classes.
			//
			// NOTE: We currently do not have a way to safely add protected methods.  Disabling
			// python.security.respectJavaAccessibility and adding in protected methods in the below
			// loop caused an InaccessibleObjectException for some users (relating to core Java 
			// modules, not the GhidraScript class hierarchy).
			if (!scriptMethodsInjected) {
				for (Method method : scriptClass.getDeclaredMethods()) {
					if (!method.getName().contains("$") &&
						Modifier.isPublic(method.getModifiers())) {
						method.setAccessible(true);
						setMethod(script, method);
					}
				}
			}
		}

		scriptMethodsInjected = true;
	}
Injects all of the accessible fields and methods found in the PythonScript class hierarchy into
the given interpreter's Python address space.

@param script The script whose class hierarchy is to be used for injection.
Ghidra/Features/Jython/src/main/java/ghidra/jython/GhidraJythonInterpreter.java