+ val newret = generateTransformerFor(inputType, typeSpec, node);
+ return newret as Class<? extends BindingCodec<Map<QName,Object>, Object>>;
+ ]
+ }
+
+ def Class<? extends BindingCodec<Map<QName, Object>, Object>> augmentationTransformerFor(Class<?> inputType) {
+ return withClassLoaderAndLock(inputType.classLoader, lock) [ |
+ val ret = getGeneratedClass(inputType)
+ if (ret !== null) {
+ return ret as Class<? extends BindingCodec<Map<QName,Object>, Object>>;
+ }
+ val ref = Types.typeForClass(inputType)
+ val node = typeToAugmentation.get(ref)
+ val typeSpecBuilder = typeToDefinition.get(ref)
+ val typeSpec = typeSpecBuilder.toInstance();
+ val newret = generateAugmentationTransformerFor(inputType, typeSpec, node);
+ return newret as Class<? extends BindingCodec<Map<QName,Object>, Object>>;
+ ]
+ }
+
+ def Class<? extends BindingCodec<Object, Object>> caseCodecFor(Class<?> inputType, ChoiceCaseNode node) {
+ return withClassLoaderAndLock(inputType.classLoader, lock) [ |
+ val ret = getGeneratedClass(inputType)
+ if (ret !== null) {
+ return ret as Class<? extends BindingCodec<Object, Object>>;
+ }
+ val ref = Types.typeForClass(inputType)
+ val typeSpecBuilder = typeToDefinition.get(ref)
+ val typeSpec = typeSpecBuilder.toInstance();
+ val newret = generateCaseCodec(inputType, typeSpec, node);
+ return newret as Class<? extends BindingCodec<Object, Object>>;
+ ]
+ }
+
+ def Class<? extends BindingCodec<Map<QName, Object>, Object>> keyTransformerForIdentifiable(Class<?> parentType) {
+ return withClassLoaderAndLock(parentType.classLoader, lock) [ |
+ val inputName = parentType.name + "Key";
+ val inputType = loadClassWithTCCL(inputName);
+ val ret = getGeneratedClass(inputType)
+ if (ret !== null) {
+ return ret as Class<? extends BindingCodec<Map<QName,Object>, Object>>;
+ }
+ val ref = Types.typeForClass(parentType)
+ val node = typeToSchemaNode.get(ref) as ListSchemaNode
+ val typeSpecBuilder = typeToDefinition.get(ref)
+ val typeSpec = typeSpecBuilder.identifierDefinition;
+ val newret = generateKeyTransformerFor(inputType, typeSpec, node);
+ return newret as Class<? extends BindingCodec<Map<QName,Object>, Object>>;
+ ]
+ }
+
+ def getIdentifierDefinition(GeneratedTypeBuilder builder) {
+ val inst = builder.toInstance
+ val keyMethod = inst.methodDefinitions.findFirst[name == "getKey"]
+ return keyMethod.returnType as GeneratedTransferObject
+ }
+
+ def Class<? extends BindingCodec<Map<QName, Object>, Object>> keyTransformerForIdentifier(Class<?> inputType) {
+ return withClassLoaderAndLock(inputType.classLoader, lock) [ |
+ val ret = getGeneratedClass(inputType)
+ if (ret !== null) {
+ return ret as Class<? extends BindingCodec<Map<QName,Object>, Object>>;
+ }
+ val ref = Types.typeForClass(inputType)
+ val node = typeToSchemaNode.get(ref) as ListSchemaNode
+ val typeSpecBuilder = typeToDefinition.get(ref)
+ val typeSpec = typeSpecBuilder.toInstance();
+ val newret = generateKeyTransformerFor(inputType, typeSpec, node);