package io.asfjava.ui.core.schema;

import java.lang.annotation.Annotation;

import com.fasterxml.jackson.databind.BeanProperty;
import com.fasterxml.jackson.module.jsonSchema.types.StringSchema;

import io.asfjava.ui.core.SchemaDecoratorFactory;

class CustomStringSchema extends StringSchema {

	@Override
	public void enrichWithBeanProperty(BeanProperty beanProperty) {
		super.enrichWithBeanProperty(beanProperty);
		Iterable<Annotation> it = beanProperty.getMember().annotations();
		String anno = it.iterator().next().annotationType().getName();
		SchemaDecoratorFactory.getInstance().getDecorator(anno).customizeSchema(beanProperty, this);
	}

}

@@ -486,128 +486,166 @@
 ;%0A%09%09
-String anno = it.iterator().next().annotationType().getName();%0A%09%09SchemaDecoratorFactory.getInstance().getDecorator(anno)
+it.forEach(%0A%09%09%09%09annotation -%3E SchemaDecoratorFactory.getInstance().getDecorator(annotation.annotationType().getName())%0A%09%09%09%09%09%09.ifPresent(decorator -%3E decorator
 .cus
@@ -676,16 +676,18 @@
 y, this)
+))
 ;%0A%09%7D%0A%0A%7D%0A

use Java 8 features