// Path: src/main/java/com/kscs/util/plugins/xjc/base/PluginUtil.java
// public final class PluginUtil {
// 	public static JFieldVar getDeclaredField(final FieldOutline fieldOutline) {
// 		return fieldOutline.parent().implClass.fields().get(fieldOutline.getPropertyInfo().getName(false));
// 	}
// 
// 	public static JExpression nullSafe(final JExpression test, final JExpression source) {
// 		return JOp.cond(test.eq(JExpr._null()), JExpr._null(), source);
// 	}
// 
// 	public static JExpression nullSafe(final FieldOutline test, final JExpression source) {
// 		return nullSafe(JExpr.ref(test.getPropertyInfo().getName(false)), source);
// 	}
// 
// 	public static JExpression nullSafe(final PropertyOutline test, final JExpression source) {
// 		return nullSafe(JExpr.ref(test.getFieldName()), source);
// 	}
// 
// 	public static JType getElementType(final FieldOutline fieldOutline) {
// 		final JFieldVar definedField = PluginUtil.getDeclaredField(fieldOutline);
// 		if (definedField != null) {
// 			if (fieldOutline.getPropertyInfo().isCollection()) {
// 				return definedField.type().isArray() ? definedField.type().elementType() : ((JClass) definedField.type()).getTypeParameters().get(0);
// 			} else {
// 				return definedField.type();
// 			}
// 		} else {
// 			return null;
// 		}
// 	}
// 
// }


import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.logging.Logger;
import com.kscs.util.plugins.xjc.base.PluginUtil;
import com.sun.codemodel.JClass;
import com.sun.codemodel.JClassAlreadyExistsException;
import com.sun.codemodel.JDefinedClass;
import com.sun.codemodel.JExpr;
import com.sun.codemodel.JFieldRef;
import com.sun.codemodel.JFieldVar;
import com.sun.codemodel.JMethod;
import com.sun.codemodel.JMod;
import com.sun.codemodel.JOp;
import com.sun.codemodel.JType;
import com.sun.codemodel.JTypeVar;
import com.sun.codemodel.JVar;
import com.sun.tools.xjc.outline.ClassOutline;
import com.sun.tools.xjc.outline.FieldOutline;
	}
}

class MetaInfoOutline {
	private final SelectorGenerator selectorGenerator;
	private final ClassOutline classOutline;
	private final JDefinedClass selectorClass;
	private final JTypeVar parentTypeParam;
	private final JTypeVar rootTypeParam;
	private final JMethod buildChildrenMethod;
	private final JVar productMapVar;

	MetaInfoOutline(final SelectorGenerator selectorGenerator, final ClassOutline classOutline, final JDefinedClass selectorClass, final JTypeVar rootTypeParam, final JTypeVar parentTypeParam, final JMethod buildChildrenMethod, final JVar productMapVar) {
		this.selectorGenerator = selectorGenerator;
		this.classOutline = classOutline;
		this.selectorClass = selectorClass;
		this.rootTypeParam = rootTypeParam;
		this.parentTypeParam = parentTypeParam;
		this.buildChildrenMethod = buildChildrenMethod;
		this.buildChildrenMethod.body().add(productMapVar.invoke("putAll").arg(JExpr._super().invoke(buildChildrenMethod)));
		this.productMapVar = productMapVar;
	}

	public void generateMetaFields() {
		if(this.classOutline.getSuperClass() != null) {
			this.selectorClass._extends(this.selectorGenerator.getInfoClass(this.classOutline.getSuperClass().implClass).selectorClass.narrow(this.rootTypeParam).narrow(this.parentTypeParam));
		}
		for (final FieldOutline fieldOutline : this.classOutline.getDeclaredFields()) {
			final JFieldVar definedField = PluginUtil.getDeclaredField(fieldOutline);
			if (definedField != null) {
// Path: src/main/java/com/kscs/util/plugins/xjc/base/PluginUtil.java
// public final class PluginUtil {
// 	public static JFieldVar getDeclaredField(final FieldOutline fieldOutline) {
// 		return fieldOutline.parent().implClass.fields().get(fieldOutline.getPropertyInfo().getName(false));
// 	}
// 
// 	public static JExpression nullSafe(final JExpression test, final JExpression source) {
// 		return JOp.cond(test.eq(JExpr._null()), JExpr._null(), source);
// 	}
// 
// 	public static JExpression nullSafe(final FieldOutline test, final JExpression source) {
// 		return nullSafe(JExpr.ref(test.getPropertyInfo().getName(false)), source);
// 	}
// 
// 	public static JExpression nullSafe(final PropertyOutline test, final JExpression source) {
// 		return nullSafe(JExpr.ref(test.getFieldName()), source);
// 	}
// 
// 	public static JType getElementType(final FieldOutline fieldOutline) {
// 		final JFieldVar definedField = PluginUtil.getDeclaredField(fieldOutline);
// 		if (definedField != null) {
// 			if (fieldOutline.getPropertyInfo().isCollection()) {
// 				return definedField.type().isArray() ? definedField.type().elementType() : ((JClass) definedField.type()).getTypeParameters().get(0);
// 			} else {
// 				return definedField.type();
// 			}
// 		} else {
// 			return null;
// 		}
// 	}
// 
// }


// Path: src/main/java/com/kscs/util/plugins/xjc/SelectorGenerator.java
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.logging.Logger;
import com.kscs.util.plugins.xjc.base.PluginUtil;
import com.sun.codemodel.JClass;
import com.sun.codemodel.JClassAlreadyExistsException;
import com.sun.codemodel.JDefinedClass;
import com.sun.codemodel.JExpr;
import com.sun.codemodel.JFieldRef;
import com.sun.codemodel.JFieldVar;
import com.sun.codemodel.JMethod;
import com.sun.codemodel.JMod;
import com.sun.codemodel.JOp;
import com.sun.codemodel.JType;
import com.sun.codemodel.JTypeVar;
import com.sun.codemodel.JVar;
import com.sun.tools.xjc.outline.ClassOutline;
import com.sun.tools.xjc.outline.FieldOutline;

	}
}

class MetaInfoOutline {
	private final SelectorGenerator selectorGenerator;
	private final ClassOutline classOutline;
	private final JDefinedClass selectorClass;
	private final JTypeVar parentTypeParam;
	private final JTypeVar rootTypeParam;
	private final JMethod buildChildrenMethod;
	private final JVar productMapVar;

	MetaInfoOutline(final SelectorGenerator selectorGenerator, final ClassOutline classOutline, final JDefinedClass selectorClass, final JTypeVar rootTypeParam, final JTypeVar parentTypeParam, final JMethod buildChildrenMethod, final JVar productMapVar) {
		this.selectorGenerator = selectorGenerator;
		this.classOutline = classOutline;
		this.selectorClass = selectorClass;
		this.rootTypeParam = rootTypeParam;
		this.parentTypeParam = parentTypeParam;
		this.buildChildrenMethod = buildChildrenMethod;
		this.buildChildrenMethod.body().add(productMapVar.invoke("putAll").arg(JExpr._super().invoke(buildChildrenMethod)));
		this.productMapVar = productMapVar;
	}

	public void generateMetaFields() {
		if(this.classOutline.getSuperClass() != null) {
			this.selectorClass._extends(this.selectorGenerator.getInfoClass(this.classOutline.getSuperClass().implClass).selectorClass.narrow(this.rootTypeParam).narrow(this.parentTypeParam));
		}
		for (final FieldOutline fieldOutline : this.classOutline.getDeclaredFields()) {
			final JFieldVar definedField = PluginUtil.getDeclaredField(fieldOutline);
			if (definedField != null) {
				final JType elementType = PluginUtil.getElementType(fieldOutline);