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

x33g5p2x  于2022-01-21 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(103)

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

JBlock.insert介绍

暂无

代码示例

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

/**
 * Adds a statement to this block
 *
 * @param s
 *        JStatement to be added
 *
 * @return This block
 */
public JBlock add(JStatement s) { // ## Needed?
  insert(s);
  return this;
}

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

/**
 * Creates an invocation statement and adds it to this block.
 *
 * @param method
 *        Name of method to invoke
 *
 * @return Newly generated JInvocation
 */
public JInvocation invoke(String method) {
  return insert(new JInvocation((JExpression)null, method));
}

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

/**
 * Create a For statement and add it to this block
 *
 * @return Newly generated For statement
 */
public JForLoop _for() {
  return insert(new JForLoop());
}

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

/**
 * Create a Try statement and add it to this block
 *
 * @return Newly generated Try statement
 */
public JTryBlock _try() {
  return insert(new JTryBlock());
}

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

/**
 * Create a continue statement and add it to this block
 */
public void _continue(JLabel label) {
  insert(new JContinue(label));
}

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

/**
 * Create an If statement and add it to this block
 *
 * @param expr
 *        JExpression to be tested to determine branching
 *
 * @return Newly generated conditional statement
 */
public JConditional _if(JExpression expr) {
  return insert(new JConditional(expr));
}

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

/**
 * Create a switch/case statement and add it to this block
 */
public JSwitch _switch(JExpression test) {
  return insert(new JSwitch(test));
}

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

/**
 * Create a throw statement and add it to this block
 */
public void _throw(JExpression exp) {
  insert(new JThrow(exp));
}

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

/**
 * Creates a static invocation statement.
 */
public JInvocation staticInvoke(JClass type, String method) {
  return insert(new JInvocation(type, method));
}

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

/**
 * Creates an enhanced For statement based on j2se 1.5 JLS
 * and add it to this block
 *
 * @return Newly generated enhanced For statement per j2se 1.5
 * specification
*/
public JForEach forEach(JType varType, String name, JExpression collection) {
  return insert(new JForEach( varType, name, collection));
}
public void state(JFormatter f) {

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

/**
 * Create a sub-block and add it to this block
 */
public JBlock block() {
  JBlock b = new JBlock();
  b.bracesRequired = false;
  b.indentRequired = false;
  return insert(b);
}

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

/**
 * Create a While statement and add it to this block
 *
 * @return Newly generated While statement
 */
public JWhileLoop _while(JExpression test) {
  return insert(new JWhileLoop(test));
}

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

/**
 * Create a switch/case statement and add it to this block
 */
public JSwitch _switch(JExpression test) {
  return insert(new JSwitch(test));
}

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

/**
 * Create a Do statement and add it to this block
 *
 * @return Newly generated Do statement
 */
public JDoLoop _do(JExpression test) {
  return insert(new JDoLoop(test));
}

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

/**
 * Create a return statement and add it to this block
 */
public void _return(JExpression exp) {
  insert(new JReturn(exp));
}

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

/**
 * Creates a static invocation statement.
 */
public JInvocation staticInvoke(JClass type, String method) {
  return insert(new JInvocation(type, method));
}

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

/**
 * Create an If statement and add it to this block
 *
 * @param expr
 *        JExpression to be tested to determine branching
 *
 * @return Newly generated conditional statement
 */
public JConditional _if(JExpression expr) {
  return insert(new JConditional(expr));
}

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

/**
 * Create a label, which can be referenced from
 * <code>continue</code> and <code>break</code> statements.
 */
public JLabel label(String name) {
  JLabel l = new JLabel(name);
  insert(l);
  return l;
}

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

/**
 * Create a continue statement and add it to this block
 */
public void _continue(JLabel label) {
  insert(new JContinue(label));
}

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

/**
 * Create a Try statement and add it to this block
 *
 * @return Newly generated Try statement
 */
public JTryBlock _try() {
  return insert(new JTryBlock());
}

相关文章