+
+ if (leaf.isAddedByUses()) {
+ Preconditions.checkState(leaf instanceof DerivableSchemaNode);
+ 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)) {
+ LeafSchemaNode originalLeaf = (LeafSchemaNode) ((DerivableSchemaNode) leaf).getOriginal().orNull();
+ Preconditions.checkNotNull(originalLeaf);
+ returnType = genCtx.get(findParentModule(schemaContext, originalLeaf)).getInnerType(typeDef.getPath());
+ } else {
+ final Restrictions restrictions = BindingGeneratorUtil.getRestrictions(typeDef);
+ returnType = typeProvider.javaTypeForSchemaDefinitionType(typeDef, leaf, restrictions, genCtx.get(module));
+ }
+ }
+ } else if (isInnerType(leaf, typeDef)) {