+ tryToCreateCasesCodecs(schema);
+
+ }
+
+ private void tryToCreateCasesCodecs(ChoiceNode schema) {
+ for (ChoiceCaseNode caseNode : schema.getCases()) {
+ SchemaPath path = caseNode.getPath();
+ GeneratedTypeBuilder type;
+ if (path != null && (type = pathToType.get(path)) != null) {
+ ReferencedTypeImpl typeref = new ReferencedTypeImpl(type.getPackageName(), type.getName());
+ ChoiceCaseCodecImpl partialCodec = typeToCaseCodecs.get(typeref);
+ if(partialCodec.getSchema() == null ) {
+ partialCodec.setSchema(caseNode);
+ }
+
+ Class<?> caseClass = ClassLoaderUtils.tryToLoadClassWithTCCL(type.getFullyQualifiedName());
+ if (caseClass != null) {
+ getCaseCodecFor(caseClass);
+ }
+ }
+ }
+