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

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

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

JFormatter.d介绍

[英]Cause the JDeclaration to generate source for itself
[中]使JDECaration为自己生成源

代码示例

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

void generateBody(JFormatter f) {
  for (Object o : content) {
    if (o instanceof JDeclaration)
      f.d((JDeclaration) o);
    else
      f.s((JStatement) o);
  }
}

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

void generateBody(JFormatter f) {
  for (Object o : content) {
    if (o instanceof JDeclaration)
      f.d((JDeclaration) o);
    else
      f.s((JStatement) o);
  }
}

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

void generateBody(JFormatter f) {
  for (Object o : content) {
    if (o instanceof JDeclaration)
      f.d((JDeclaration) o);
    else
      f.s((JStatement) o);
  }
}

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

void generateBody(JFormatter f) {
  for (Object o : content) {
    if (o instanceof JDeclaration)
      f.d((JDeclaration) o);
    else
      f.s((JStatement) o);
  }
}

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

void generateBody(JFormatter f) {
  for (Object o : content) {
    if (o instanceof JDeclaration)
      f.d((JDeclaration) o);
    else
      f.s((JStatement) o);
  }
}

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

public void declare( JFormatter f ) {
  if(typeVariables!=null) {
    f.p('<');
    for (int i = 0; i < typeVariables.size(); i++) {
      if(i!=0)    f.p(',');
      f.d(typeVariables.get(i));
    }
    f.p('>');
  }
}

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

public void declare( JFormatter f ) {
  if(typeVariables!=null) {
    f.p('<');
    for (int i = 0; i < typeVariables.size(); i++) {
      if(i!=0)    f.p(',');
      f.d(typeVariables.get(i));
    }
    f.p('>');
  }
}

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

public void declare( JFormatter f ) {
  if(typeVariables!=null) {
    f.p('<');
    for (int i = 0; i < typeVariables.size(); i++) {
      if(i!=0)    f.p(',');
      f.d(typeVariables.get(i));
    }
    f.p('>');
  }
}

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

public void declare( JFormatter f ) {
  if(typeVariables!=null) {
    f.p('<');
    for (int i = 0; i < typeVariables.size(); i++) {
      if(i!=0)    f.p(',');
      f.d(typeVariables.get(i));
    }
    f.p(JFormatter.CLOSE_TYPE_ARGS);
  }
}

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

public void declare( JFormatter f ) {
  if(typeVariables!=null) {
    f.p('<');
    for (int i = 0; i < typeVariables.size(); i++) {
      if(i!=0)    f.p(',');
      f.d(typeVariables.get(i));
    }
    f.p('>');
  }
}

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

for (JEnumConstant c : enumConstantsByName.values()) {
    if (!first) f.p(',').nl();
    f.d(c);
    first = false;
  f.d(field);
if (init != null)
  f.nl().p("static").s(init);
for (JMethod m : constructors) {
  f.nl().d(m);
  f.nl().d(m);
    f.nl().d(dc);

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

for (JEnumConstant c : enumConstantsByName.values()) {
    if (!first) f.p(',').nl();
    f.d(c);
    first = false;
  f.d(field);
if (init != null)
  f.nl().p("static").s(init);
for (JMethod m : constructors) {
  f.nl().d(m);
  f.nl().d(m);
    f.nl().d(dc);

代码示例来源: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: 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.sun.codemodel/codemodel

public void declare(JFormatter f) {
  if (jdoc != null)
    f.nl().g(jdoc);
  if (annotations != null){
    for (JAnnotationUse annotation : annotations)
      f.g(annotation).nl();
  }
  f.g(mods).p(classType.declarationToken).id(name).d(generifiable);
  if (superClass != null && superClass != owner().ref(Object.class))
    f.nl().i().p("extends").g(superClass).nl().o();
  if (!interfaces.isEmpty()) {
    if (superClass == null)
      f.nl();
    f.i().p(classType==ClassType.INTERFACE ? "extends" : "implements");
    f.g(interfaces);
    f.nl().o();
  }
  declareBody(f);
}

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

public void declare(JFormatter f) {
  if (jdoc != null)
    f.nl().g(jdoc);
  if (annotations != null){
    for (JAnnotationUse annotation : annotations)
      f.g(annotation).nl();
  }
  f.g(mods).p(classType.declarationToken).id(name).d(generifiable);
  if (superClass != null && superClass != owner().ref(Object.class))
    f.nl().i().p("extends").g(superClass).nl().o();
  if (!interfaces.isEmpty()) {
    if (superClass == null)
      f.nl();
    f.i().p(classType==ClassType.INTERFACE ? "extends" : "implements");
    f.g(interfaces);
    f.nl().o();
  }
  declareBody(f);
}

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

public void declare(JFormatter f) {
  if (jdoc != null)
    f.nl().g(jdoc);
  if (annotations != null){
    for (JAnnotationUse annotation : annotations)
      f.g(annotation).nl();
  }
  f.g(mods).p(classType.declarationToken).id(name).d(generifiable);
  if (superClass != null && superClass != owner().ref(Object.class))
    f.nl().i().p("extends").g(superClass).nl().o();
  if (!interfaces.isEmpty()) {
    if (superClass == null)
      f.nl();
    f.i().p(classType==ClassType.INTERFACE ? "extends" : "implements");
    f.g(interfaces);
    f.nl().o();
  }
  declareBody(f);
}

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

public void declare(JFormatter f) {
  if (jdoc != null)
    f.nl().g(jdoc);
  if (annotations != null){
    for (JAnnotationUse annotation : annotations)
      f.g(annotation).nl();
  }
  f.g(mods).p(classType.declarationToken).id(name).d(generifiable);
  if (superClass != null && superClass != owner().ref(Object.class))
    f.nl().i().p("extends").g(superClass).nl().o();
  if (!interfaces.isEmpty()) {
    if (superClass == null)
      f.nl();
    f.i().p(classType==ClassType.INTERFACE ? "extends" : "implements");
    f.g(interfaces);
    f.nl().o();
  }
  declareBody(f);
}

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

public void declare(JFormatter f) {
  if (jdoc != null)
    f.nl().g(jdoc);
  if (annotations != null){
    for (JAnnotationUse annotation : annotations)
      f.g(annotation).nl();
  }
  f.g(mods).p(classType.declarationToken).id(name).d(generifiable);
  if (superClass != null && superClass != owner().ref(Object.class))
    f.nl().i().p("extends").g(superClass).nl().o();
  if (!interfaces.isEmpty()) {
    if (superClass == null)
      f.nl();
    f.i().p(classType==ClassType.INTERFACE ? "extends" : "implements");
    f.g(interfaces);
    f.nl().o();
  }
  declareBody(f);
}

相关文章