react_agent.custom_tools.java_validator.JavaValidationInput Objects
source_code- The Java source code (either schema mapping or query) to compile and run.framework- The specific Java target framework (e.g., Spring Data MongoDB, Spring Data Neo4j).entry_type_name- The public class name of the entry point declared in the source code.
react_agent.custom_tools.java_validator.compile_and_run_java
- Fetches the required
pom.xmlconfigurations for Spring Data. - Builds a bash script (
run.sh) to compile via Maven and execute the specified entry point class. - Provisions environment variables and database connection strings.
- Base64 encodes all payload files to safely transfer them over to the sandbox.
- Invokes the
execute_in_sandboxtool. - If a query output JSON was produced, it downloads it via
download_file_from_sandbox.
source_codestr - The raw Java source code to compile and run.frameworkJavaFramework - The target Java framework (Spring Data MongoDB, Spring Data Neo4j).entry_type_namestr - The name of the main class containing the public static void main method.runtimeToolRuntime[Context, State] - The LangGraph tool runtime containing context and state.
RuntimeError- If fetching the framework config fails or the sandbox execution throws an exception.
react_agent.custom_tools.java_validator.validate_java_code
compile_and_run_java and then parses the returned JSON results.
Crucially, it determines whether it is currently validating the “source” query or the
“target” query based on the tool call ID or state comparison, and dynamically issues a
LangGraph Command to update the global state with the parsed QueryValidationResults.
Arguments:
source_codestr - The Java source code to validate.frameworkJavaFramework - The target Java framework.entry_type_namestr - The entrypoint class name declared in the Java code.runtimeToolRuntime[Context, State] - Automatically injected runtime context.