content: package com.alan344.mybatis;
  
  import org.mybatis.generator.api.CommentGenerator;
  import org.mybatis.generator.api.dom.java.CompilationUnit;
  import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType;
  import org.mybatis.generator.api.dom.java.Interface;
  import org.mybatis.generator.api.dom.java.JavaVisibility;
  import org.mybatis.generator.codegen.AbstractJavaClientGenerator;
  import org.mybatis.generator.codegen.AbstractXmlGenerator;
  import org.mybatis.generator.config.PropertyRegistry;
  
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.List;
  
  import static org.mybatis.generator.internal.util.StringUtility.stringHasValue;
  import static org.mybatis.generator.internal.util.messages.Messages.getString;
  
  public class MybatisFlexJavaClientGenerator extends AbstractJavaClientGenerator {
  
      public MybatisFlexJavaClientGenerator(String project) {
          this(project, true);
      }
  
      public MybatisFlexJavaClientGenerator(String project, boolean requiresMatchedXMLGenerator) {
          super(project, requiresMatchedXMLGenerator);
      }
  
      @Override
      public List<CompilationUnit> getCompilationUnits() {
          progressCallback.startTask(getString("Progress.17", //$NON-NLS-1$
                  introspectedTable.getFullyQualifiedTable().toString()));
          CommentGenerator commentGenerator = context.getCommentGenerator();
  
          FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getMyBatis3JavaMapperType());
          Interface interfaze = new Interface(type);
          interfaze.setVisibility(JavaVisibility.PUBLIC);
          commentGenerator.addJavaFileComment(interfaze);
  
          String rootInterface = introspectedTable.getTableConfigurationProperty(PropertyRegistry.ANY_ROOT_INTERFACE);
          if (!stringHasValue(rootInterface)) {
              rootInterface = context.getJavaClientGeneratorConfiguration()
                      .getProperty(PropertyRegistry.ANY_ROOT_INTERFACE);
          }
  
          if (stringHasValue(rootInterface)) {
              rootInterface = rootInterface + "<" + introspectedTable.getBaseRecordType() + ">";
              FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(rootInterface);
              interfaze.addSuperInterface(fqjt);
              interfaze.addImportedType(fqjt);
          }
  
          List<CompilationUnit> answer = new ArrayList<>();
          if (context.getPlugins().clientGenerated(interfaze, introspectedTable)) {
              answer.add(interfaze);
          }
  
          List<CompilationUnit> extraCompilationUnits = getExtraCompilationUnits();
          if (extraCompilationUnits != null) {
              answer.addAll(extraCompilationUnits);
          }
  
          return answer;
      }
  
      public List<CompilationUnit> getExtraCompilationUnits() {
          return Collections.emptyList();
      }
  
      @Override
      public AbstractXmlGenerator getMatchedXMLGenerator() {
          return null;
      }
  
      @Override
      public boolean requiresXMLGenerator() {
          return false;
      }
  }
  