org.mybatis.generator.api.dom.java.Method.isConstructor()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(168)

本文整理了Java中org.mybatis.generator.api.dom.java.Method.isConstructor()方法的一些代码示例,展示了Method.isConstructor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Method.isConstructor()方法的具体详情如下:
包路径:org.mybatis.generator.api.dom.java.Method
类名称:Method
方法名:isConstructor

Method.isConstructor介绍

暂无

代码示例

代码示例来源:origin: cxjava/mybatis-generator-core

public final List<Method> getMethodClones(CommentGenerator commentGenerator, IntrospectedTable introspectedTable) {
  configure();
  List<Method> answer = new ArrayList<Method>();
  for (Method oldMethod : methods) {
    Method method = new Method();
    for (String bodyLine : oldMethod.getBodyLines()) {
      method.addBodyLine(bodyLine);
    }
    for (FullyQualifiedJavaType fqjt : oldMethod.getExceptions()) {
      method.addException(fqjt);
    }
    for (Parameter parm : oldMethod.getParameters()) {
      method.addParameter(parm);
    }
    method.setConstructor(oldMethod.isConstructor());
    method.setFinal(oldMethod.isFinal());
    method.setStatic(oldMethod.isStatic());
    method.setName(oldMethod.getName());
    method.setReturnType(oldMethod.getReturnType());
    method.setVisibility(oldMethod.getVisibility());
    commentGenerator.addGeneralMethodComment(method, introspectedTable);
    answer.add(method);
  }
  return answer;
}

代码示例来源:origin: org.mybatis.generator/mybatis-generator-core

public final List<Method> getMethodClones(
    CommentGenerator commentGenerator,
    IntrospectedTable introspectedTable) {
  configure();
  List<Method> answer = new ArrayList<Method>();
  for (Method oldMethod : methods) {
    Method method = new Method();
    for (String bodyLine : oldMethod.getBodyLines()) {
      method.addBodyLine(bodyLine);
    }
    for (FullyQualifiedJavaType fqjt : oldMethod.getExceptions()) {
      method.addException(fqjt);
    }
    for (Parameter parm : oldMethod.getParameters()) {
      method.addParameter(parm);
    }
    method.setConstructor(oldMethod.isConstructor());
    method.setFinal(oldMethod.isFinal());
    method.setStatic(oldMethod.isStatic());
    method.setName(oldMethod.getName());
    method.setReturnType(oldMethod.getReturnType());
    method.setVisibility(oldMethod.getVisibility());
    commentGenerator.addGeneralMethodComment(method, introspectedTable);
    answer.add(method);
  }
  return answer;
}

代码示例来源:origin: handosme/mybatis-generator-plus

public final List<Method> getMethodClones(
    CommentGenerator commentGenerator,
    IntrospectedTable introspectedTable) {
  configure();
  List<Method> answer = new ArrayList<Method>();
  for (Method oldMethod : methods) {
    Method method = new Method();
    for (String bodyLine : oldMethod.getBodyLines()) {
      method.addBodyLine(bodyLine);
    }
    for (FullyQualifiedJavaType fqjt : oldMethod.getExceptions()) {
      method.addException(fqjt);
    }
    for (Parameter parm : oldMethod.getParameters()) {
      method.addParameter(parm);
    }
    method.setConstructor(oldMethod.isConstructor());
    method.setFinal(oldMethod.isFinal());
    method.setStatic(oldMethod.isStatic());
    method.setName(oldMethod.getName());
    method.setReturnType(oldMethod.getReturnType());
    method.setVisibility(oldMethod.getVisibility());
    commentGenerator.addGeneralMethodComment(method, introspectedTable);
    answer.add(method);
  }
  return answer;
}

代码示例来源:origin: roncoo/roncoo-mybatis-generator

public final List<Method> getMethodClones(
    CommentGenerator commentGenerator,
    IntrospectedTable introspectedTable) {
  configure();
  List<Method> answer = new ArrayList<Method>();
  for (Method oldMethod : methods) {
    Method method = new Method();
    for (String bodyLine : oldMethod.getBodyLines()) {
      method.addBodyLine(bodyLine);
    }
    for (FullyQualifiedJavaType fqjt : oldMethod.getExceptions()) {
      method.addException(fqjt);
    }
    for (Parameter parm : oldMethod.getParameters()) {
      method.addParameter(parm);
    }
    method.setConstructor(oldMethod.isConstructor());
    method.setFinal(oldMethod.isFinal());
    method.setStatic(oldMethod.isStatic());
    method.setName(oldMethod.getName());
    method.setReturnType(oldMethod.getReturnType());
    method.setVisibility(oldMethod.getVisibility());
    commentGenerator.addGeneralMethodComment(method, introspectedTable);
    answer.add(method);
  }
  return answer;
}

代码示例来源:origin: io.github.cgi/mybatis-generator-plugins

private void addFactoryMethodToCriteria(TopLevelClass topLevelClass, InnerClass innerClass,
                      IntrospectedTable introspectedTable) {

    Field f = new Field("example", topLevelClass.getType());
    f.setVisibility(JavaVisibility.PRIVATE);
    innerClass.addField(f);

    // overwrite constructor
    List<Method> methods = innerClass.getMethods();
    for (Method method : methods) {
      if (method.isConstructor()) {
        method.addParameter(new Parameter(topLevelClass.getType(), "example"));
        method.addBodyLine("this.example = example;");
      }
    }

    // add factory method "example"
    Method method = new Method("example");
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setReturnType(topLevelClass.getType());
    method.addBodyLine("return this.example;");
    context.getCommentGenerator().addGeneralMethodComment(method, introspectedTable);
    innerClass.addMethod(method);
  }
}

相关文章