- LeafSchemaNode originalLeaf = (LeafSchemaNode)((DerivableSchemaNode) leaf).getOriginal().orNull();
- Preconditions.checkNotNull(originalLeaf);
- if (isInnerType(originalLeaf, typeDef)) {
- if (typeDef instanceof EnumTypeDefinition
- || typeDef instanceof UnionTypeDefinition
- || typeDef instanceof BitsTypeDefinition) {
+ if (isInnerType(leaf, typeDef)) {
+ final Restrictions restrictions = BindingGeneratorUtil.getRestrictions(typeDef);
+ returnType = typeProvider.javaTypeForSchemaDefinitionType(getBaseOrDeclaredType(typeDef), leaf,
+ restrictions, genCtx.get(module));
+ } else {
+ if (typeDef.getBaseType() == null && (typeDef instanceof EnumTypeDefinition
+ || typeDef instanceof UnionTypeDefinition || typeDef instanceof BitsTypeDefinition)) {
+ final LeafSchemaNode originalLeaf = (LeafSchemaNode) ((DerivableSchemaNode) leaf).getOriginal().orNull();
+ Preconditions.checkNotNull(originalLeaf);