FileOutConfig.java 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * Copyright (c) 2011-2020, hubin (jobob@qq.com).
  3. * <p>
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. * <p>
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. * <p>
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.baomidou.mybatisplus.generator.config;
  17. import com.baomidou.mybatisplus.generator.config.po.TableInfo;
  18. /**
  19. * <p>
  20. * 输出文件配置
  21. * </p>
  22. *
  23. * @author hubin
  24. * @since 2017-01-18
  25. */
  26. public abstract class FileOutConfig {
  27. /**
  28. * 模板
  29. */
  30. private String templatePath;
  31. public FileOutConfig() {
  32. // to do nothing
  33. }
  34. public FileOutConfig(String templatePath) {
  35. this.templatePath = templatePath;
  36. }
  37. /**
  38. * 输出文件
  39. */
  40. public abstract String outputFile(TableInfo tableInfo);
  41. public String getTemplatePath() {
  42. return templatePath;
  43. }
  44. public FileOutConfig setTemplatePath(String templatePath) {
  45. this.templatePath = templatePath;
  46. return this;
  47. }
  48. }