com.sun.codemodel.JFormatter.close()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(102)

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

JFormatter.close介绍

[英]Closes this formatter.
[中]关闭此格式化程序。

代码示例

代码示例来源:origin: javaee/jaxb-v2

/**
 * Build {@code module-info.java} source file.
 * @param src Source code writer.
 * @throws IOException if there is any problem with writing the file.
 */
void build(final CodeWriter src) throws IOException {
  final JFormatter f = createModuleInfoSourceFileWriter(src);
  generate(f);
  f.close();
}

代码示例来源:origin: org.glassfish.metro/webservices-tools

/**
 * Build {@code module-info.java} source file.
 * @param src Source code writer.
 * @throws IOException if there is any problem with writing the file.
 */
void build(final CodeWriter src) throws IOException {
  final JFormatter f = createModuleInfoSourceFileWriter(src);
  generate(f);
  f.close();
}

代码示例来源:origin: com.sap.cloud.yaas.service-generator/service-generator-model-raml

myPersonalFormatter.close();

代码示例来源:origin: javaee/jaxb-v2

void build( CodeWriter src, CodeWriter res ) throws IOException {
  // write classes
  for (JDefinedClass c : classes.values()) {
    if (c.isHidden())
      continue;   // don't generate this file
    JFormatter f = createJavaSourceFileWriter(src, c.name());
    f.write(c);
    f.close();
  }
  // write package annotations
  if(annotations!=null || jdoc!=null) {
    JFormatter f = createJavaSourceFileWriter(src,"package-info");
    if (jdoc != null)
      f.g(jdoc);
    // TODO: think about importing
    if (annotations != null){
      for (JAnnotationUse a : annotations)
        f.g(a).nl();
    }
    f.d(this);
    f.close();
  }
  // write resources
  for (JResourceFile rsrc : resources) {
    CodeWriter cw = rsrc.isResource() ? res : src;
    OutputStream os = new BufferedOutputStream(cw.openBinary(this, rsrc.name()));
    rsrc.build(os);
    os.close();
  }
}

代码示例来源:origin: org.glassfish.metro/webservices-tools

void build( CodeWriter src, CodeWriter res ) throws IOException {
  // write classes
  for (JDefinedClass c : classes.values()) {
    if (c.isHidden())
      continue;   // don't generate this file
    JFormatter f = createJavaSourceFileWriter(src, c.name());
    f.write(c);
    f.close();
  }
  // write package annotations
  if(annotations!=null || jdoc!=null) {
    JFormatter f = createJavaSourceFileWriter(src,"package-info");
    if (jdoc != null)
      f.g(jdoc);
    // TODO: think about importing
    if (annotations != null){
      for (JAnnotationUse a : annotations)
        f.g(a).nl();
    }
    f.d(this);
    f.close();
  }
  // write resources
  for (JResourceFile rsrc : resources) {
    CodeWriter cw = rsrc.isResource() ? res : src;
    OutputStream os = new BufferedOutputStream(cw.openBinary(this, rsrc.name()));
    rsrc.build(os);
    os.close();
  }
}

代码示例来源:origin: com.unquietcode.tools.jcodemodel/codemodel

void build( CodeWriter src, CodeWriter res ) throws IOException {
  // write classes
  for (JDefinedClass c : classes.values()) {
    if (c.isHidden())
      continue;   // don't generate this file
    JFormatter f = createJavaSourceFileWriter(src, c.name());
    f.write(c);
    f.close();
  }
  // write package annotations
  if(annotations!=null || jdoc!=null) {
    JFormatter f = createJavaSourceFileWriter(src,"package-info");
    if (jdoc != null)
      f.g(jdoc);
    // TODO: think about importing
    if (annotations != null){
      for (JAnnotationUse a : annotations)
        f.g(a).nl();
    }
    f.d(this);
    f.close();
  }
  // write resources
  for (JResourceFile rsrc : resources) {
    CodeWriter cw = rsrc.isResource() ? res : src;
    OutputStream os = new BufferedOutputStream(cw.openBinary(this, rsrc.name()));
    rsrc.build(os);
    os.close();
  }
}

代码示例来源:origin: com.sun.codemodel/codemodel

void build( CodeWriter src, CodeWriter res ) throws IOException {
  // write classes
  for (JDefinedClass c : classes.values()) {
    if (c.isHidden())
      continue;   // don't generate this file
    JFormatter f = createJavaSourceFileWriter(src, c.name());
    f.write(c);
    f.close();
  }
  // write package annotations
  if(annotations!=null || jdoc!=null) {
    JFormatter f = createJavaSourceFileWriter(src,"package-info");
    if (jdoc != null)
      f.g(jdoc);
    // TODO: think about importing
    if (annotations != null){
      for (JAnnotationUse a : annotations)
        f.g(a).nl();
    }
    f.d(this);
    f.close();
  }
  // write resources
  for (JResourceFile rsrc : resources) {
    CodeWriter cw = rsrc.isResource() ? res : src;
    OutputStream os = new BufferedOutputStream(cw.openBinary(this, rsrc.name()));
    rsrc.build(os);
    os.close();
  }
}

代码示例来源:origin: sun-jaxb/jaxb-xjc

void build( CodeWriter src, CodeWriter res ) throws IOException {
  // write classes
  for (JDefinedClass c : classes.values()) {
    if (c.isHidden())
      continue;   // don't generate this file
    JFormatter f = createJavaSourceFileWriter(src, c.name());
    f.write(c);
    f.close();
  }
  // write package annotations
  if(annotations!=null || jdoc!=null) {
    JFormatter f = createJavaSourceFileWriter(src,"package-info");
    if (jdoc != null)
      f.g(jdoc);
    // TODO: think about importing
    if (annotations != null){
      for (JAnnotationUse a : annotations)
        f.g(a).nl();
    }
    f.d(this);
    f.close();
  }
  // write resources
  for (JResourceFile rsrc : resources) {
    CodeWriter cw = rsrc.isResource() ? res : src;
    OutputStream os = new BufferedOutputStream(cw.openBinary(this, rsrc.name()));
    rsrc.build(os);
    os.close();
  }
}

相关文章