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

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

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

JFormatter.g介绍

[英]Cause the JGenerable object to generate source for iteself
[中]使JGenerable对象为自身生成源

代码示例

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

public void generate(JFormatter f) {
    JClass c;
    if(cl instanceof JNarrowedClass)
      c = ((JNarrowedClass)cl).basis;
    else
      c = cl;
    f.g(c).p(".class");
  }
};

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

public void generate(JFormatter f) {
    if (opFirst)
      f.p(op).g(e);
    else
      f.g(e).p(op);
  }
}

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

public void generate(JFormatter f) {
  if (opFirst)
    f.p(op).g(e);
  else
    f.g(e).p(op);
}

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

public void generate(JFormatter f) {
    JClass c;
    if(cl instanceof JNarrowedClass)
      c = ((JNarrowedClass)cl).basis;
    else
      c = cl;
    f.g(c).p(".class");
  }
};

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

/**
   * Prints the class name in javadoc @link format.
   */
  void printLink(JFormatter f) {
    f.p("{@link ").g(this).p('}');
  }
}

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

/**
   * Prints the class name in javadoc @link format.
   */
  void printLink(JFormatter f) {
    f.p("{@link ").g(this).p('}');
  }
}

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

public void state(JFormatter f) {
  f.p("try").g(body);
  for (JCatchBlock cb : catches)
    f.g(cb);
  if (_finally != null)
    f.p("finally").g(_finally);
  f.nl();
}

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

/**
   * Prints the class name in javadoc @link format.
   */
  void printLink(JFormatter f) {
    f.p("{@link ").g(this).p('}');
  }
}

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

public void state(JFormatter f) {
  f.p("try").g(body);
  for (JCatchBlock cb : catches)
    f.g(cb);
  if (_finally != null)
    f.p("finally").g(_finally);
  f.nl();
}

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

public void state(JFormatter f) {
  f.p("try").g(body);
  for (JCatchBlock cb : catches)
    f.g(cb);
  if (_finally != null)
    f.p("finally").g(_finally);
  f.nl();
}

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

/**
   * Prints the class name in javadoc @link format.
   */
  void printLink(JFormatter f) {
    f.p("{@link ").g(this).p('}');
  }
}

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

public void bind(JFormatter f) {
  if (annotations != null){
    for( int i=0; i<annotations.size(); i++ )
      f.g(annotations.get(i)).nl();
  }
  f.g(mods).g(type).id(name);
  if (init != null)
    f.p('=').g(init);
}

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

public void generate(JFormatter f) {
  if (opFirst)
    f.p('(').p(op).g(e).p(')');
  else
    f.p('(').g(e).p(op).p(')');
}

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

public void bind(JFormatter f) {
  if (annotations != null){
    for( int i=0; i<annotations.size(); i++ )
      f.g(annotations.get(i)).nl();
  }
  f.g(mods).g(type).id(name);
  if (init != null)
    f.p('=').g(init);
}

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

public void bind(JFormatter f) {
  if (annotations != null){
    for( int i=0; i<annotations.size(); i++ )
      f.g(annotations.get(i)).nl();
  }
  f.g(mods).g(type).id(name);
  if (init != null)
    f.p('=').g(init);
}

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

public void state(JFormatter f) {
  f.p("return ");
  if (expr != null) f.g(expr);
  f.p(';').nl();
}

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

public void state(JFormatter f) {
  f.p("throw");
  f.g(expr);
  f.p(';').nl();
}

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

public void declare(JFormatter f) {
  if( jdoc != null )
    f.nl().g( jdoc );
  if (annotations != null) {
    for( int i=0; i<annotations.size(); i++ )
      f.g(annotations.get(i)).nl();
  }
  f.id(name);
  if(args!=null) {
    f.p('(').g(args).p(')');
  }
}

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

public void declare(JFormatter f) {
  if( jdoc != null )
    f.nl().g( jdoc );
  if (annotations != null) {
    for( int i=0; i<annotations.size(); i++ )
      f.g(annotations.get(i)).nl();
  }
  f.id(name);
  if(args!=null) {
    f.p('(').g(args).p(')');
  }
}

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

public void state(JFormatter f) {
  f.p("for (");
  f.g(type).id(var).p(": ").g(collection);
  f.p(')');
  if (body != null)
    f.g(body).nl();
  else
    f.p(';').nl();
}

相关文章