16
16
import org .jvnet .jaxb2_commons .xml .bind .model .MEnumLeafInfo ;
17
17
import org .jvnet .jaxb2_commons .xml .bind .model .MTypeInfo ;
18
18
19
+ import com .sun .xml .xsom .XmlString ;
20
+
19
21
public class EnumLeafInfoProducer <T , C extends T > extends PackagedTypeInfoProducer <T , C > {
20
22
21
23
private MEnumLeafInfo <T , C > enumLeafInfo ;
@@ -36,8 +38,7 @@ public JsonSchemaBuilder compile(JsonSchemaMappingCompiler<T, C> mappingCompiler
36
38
final JsonSchemaBuilder baseTypeInfoSchema = baseTypeInfoProducer .createTypeInfoSchemaRef (mappingCompiler );
37
39
typeInfoSchema = new JsonSchemaBuilder ();
38
40
typeInfoSchema .addAllOf (baseTypeInfoSchema );
39
-
40
-
41
+
41
42
final JsonSchemaBuilder enumsTypeInfoSchema = new JsonSchemaBuilder ();
42
43
43
44
boolean valuesSupported = true ;
@@ -66,4 +67,20 @@ public JsonSchemaBuilder compile(JsonSchemaMappingCompiler<T, C> mappingCompiler
66
67
67
68
return typeInfoSchema ;
68
69
}
70
+
71
+ @ Override
72
+ public JsonValue createValue (JsonSchemaMappingCompiler <T , C > mappingCompiler , String item ) {
73
+ final MTypeInfo <T , C > baseTypeInfo = enumLeafInfo .getBaseTypeInfo ();
74
+ final TypeInfoProducer <T , C > baseTypeInfoProducer = mappingCompiler .getTypeInfoProducer (enumLeafInfo ,
75
+ baseTypeInfo );
76
+ return baseTypeInfoProducer .createValue (mappingCompiler , item );
77
+ }
78
+
79
+ @ Override
80
+ public JsonValue createValue (JsonSchemaMappingCompiler <T , C > mappingCompiler , XmlString item ) {
81
+ final MTypeInfo <T , C > baseTypeInfo = enumLeafInfo .getBaseTypeInfo ();
82
+ final TypeInfoProducer <T , C > baseTypeInfoProducer = mappingCompiler .getTypeInfoProducer (enumLeafInfo ,
83
+ baseTypeInfo );
84
+ return baseTypeInfoProducer .createValue (mappingCompiler , item );
85
+ }
69
86
}
0 commit comments