This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
ph-jaxb-plugin is a JAXB 4.x XJC plugin library that enhances JAXB-generated Java classes with additional functionality (equals/hashCode, toString, cloneable, bean validation annotations, etc.). It is a single-module Maven project targeting Java 17+.
mvn clean install # Full build with tests
mvn test # Run tests only
mvn test -Dtest=XJCLoaderFuncTest # Run a single test classThe parent POM (com.helger:parent-pom:3.0.3) provides all plugin and profile configuration.
All plugins extend AbstractPlugin (which extends com.sun.tools.xjc.Plugin) and are registered via SPI in src/main/resources/META-INF/services/com.sun.tools.xjc.Plugin. Each plugin manipulates the JAXB code model (com.sun.codemodel) during XJC code generation.
Key base classes:
AbstractPlugin- common field iteration, logging, and option name handlingAbstractPluginBeanValidation- shared logic for bean validation 1.0/1.1 pluginsAbstractPluginCloneable- shared logic for cloneable/explicitly-cloneable pluginsCJAXB- constants and utility methods used across plugins
Plugins hook into XJC's code generation pipeline. They receive ClassOutline objects representing generated classes and modify them by adding methods, annotations, or interfaces via the JDefinedClass code model API.
Functional tests (suffixed FuncTest) invoke the XJC compiler programmatically with test XSD schemas from src/test/resources/external/xsd/ and verify the generated code compiles and behaves correctly. SPITest validates that all plugins are properly registered in the SPI services file.
com.helger.commonsfamily (ph-graph,ph-jaxb,ph-jaxb-adapter) - core utilities, collection types, annotationscom.sun.xml.bind:jaxb-xjc(provided scope) - XJC compiler API that plugins extendjakarta.validation:jakarta.validation-api- bean validation annotations- JUnit 4 for tests