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

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

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

JBlock.<init>介绍

暂无

代码示例

代码示例来源:origin: apache/drill

private void generateSetup(ClassGenerator<?> g, JVar[] workspaceJVars) {
 JCodeModel m = g.getModel();
 JBlock sub = new JBlock(true, true);

代码示例来源:origin: apache/drill

JBlock sub = new JBlock(true, true);
 if (inputVariables[i].isOptional()) {
  sub.assign(workspaceJVars[3].component(JExpr.lit(i)), workspaceJVars[2].component(JExpr.lit(i)));
  JBlock conditionalBlock = new JBlock(false, false);
  JConditional jc = conditionalBlock._if(inputVariables[i].getIsSet().ne(JExpr.lit(0)));
  jc._then().assign(JExpr.ref(workspaceJVars[3].component(JExpr.lit(i)), "valueHolder"), inputVariables[i].getHolder());

代码示例来源:origin: apache/drill

public static JBlock getDrillObject(JCodeModel m, ObjectInspector oi,
 JVar returnOI, JVar returnValueHolder, JVar returnValue) {
 JBlock block = new JBlock(false, false);
 switch(oi.getCategory()) {
  case PRIMITIVE: {

代码示例来源:origin: apache/drill

public static JBlock initReturnValueHolder(ClassGenerator<?> g, JCodeModel m, JVar returnValueHolder, ObjectInspector oi, MinorType returnType) {
 JBlock block = new JBlock(false, false);
 switch(oi.getCategory()) {
  case PRIMITIVE: {

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

/**
 * Creates, if necessary, and returns the static initializer
 * for this class.
 *
 * @return JBlock containing initialization statements for this class
 */
public JBlock init() {
  if (init == null)
    init = new JBlock();
  return init;
}

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

/**
 * Get the block that makes up body of this method
 *
 * @return Body of method
 */
public JBlock body() {
  if (body == null)
    body = new JBlock();
  return body;
}

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

/**
 * Create a block to be executed by "else" branch
 *
 * @return Newly generated else block
 */
public JBlock _else() {
  if (_else == null) _else = new JBlock();
  return _else;
}

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

public JBlock body() {
  if (body == null)
    body = new JBlock();
  return body;
}

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

/**
 * Create a block to be executed by "else" branch
 *
 * @return Newly generated else block
 */
public JBlock _else() {
  if (_else == null) _else = new JBlock();
  return _else;
}

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

/**
 * Creates, if necessary, and returns the static initializer
 * for this class.
 *
 * @return JBlock containing initialization statements for this class
 */
public JBlock init() {
  if (init == null)
    init = new JBlock();
  return init;
}

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

/**
 * Create a block to be executed by "else" branch
 *
 * @return Newly generated else block
 */
public JBlock _else() {
  if (_else == null) _else = new JBlock();
  return _else;
}

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

/**
 * Creates, if necessary, and returns the instance initializer
 * for this class.
 *
 * @return JBlock containing initialization statements for this class
 */
public JBlock instanceInit() {
  if (instanceInit == null)
    instanceInit = new JBlock();
  return instanceInit;
}

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

/**
 * Get the block that makes up body of this method
 *
 * @return Body of method
 */
public JBlock body() {
  if (body == null)
    body = new JBlock();
  return body;
}

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

/**
 * 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: com.envoisolutions.sxc/sxc-jaxb

public JBlock expectAnyElement() {
  if (expectValue) throw new IllegalArgumentException("A value is alredy expected");
  if (expectAnyElement) throw new IllegalArgumentException("Any element is alredy expected");
  expectAnyElement = true;
  JBlock block = new JBlock();
  getParserBuilder().setAnyElementBlock(null, block);
  return block;
}

代码示例来源:origin: org.metatype.sxc/sxc-jaxb

public JBlock expectAnyElement() {
  if (expectValue) throw new IllegalArgumentException("A value is alredy expected");
  if (expectAnyElement) throw new IllegalArgumentException("Any element is alredy expected");
  expectAnyElement = true;
  JBlock block = new JBlock();
  getParserBuilder().setAnyElementBlock(null, block);
  return block;
}

代码示例来源:origin: dremio/dremio-oss

private JBlock generateInitWorkspaceBlockHA(ClassGenerator<?> g, BlockType bt, String body, JVar[] workspaceJVars, JExpression wsIndexVariable){
 JBlock initBlock = new JBlock(true, true);
 if(!Strings.isNullOrEmpty(body) && !body.trim().isEmpty()){
  JBlock sub = new JBlock(true, true);
  addProtectedBlockHA(g, sub, body, null, workspaceJVars, wsIndexVariable);
  initBlock.directStatement(String.format("/** start %s for function %s **/ ", bt.name(), registeredNames[0]));
  initBlock.add(sub);
  initBlock.directStatement(String.format("/** end %s for function %s **/ ", bt.name(), registeredNames[0]));
 }
 return initBlock;
}

代码示例来源:origin: org.apache.drill.exec/drill-java-exec

/**
 * Creates an inner braced and indented block
 * @param type type of the created block
 * @return a newly created inner block
 */
private JBlock createInnerBlock(BlockType type) {
 final JBlock currBlock = getBlock(type);
 final JBlock innerBlock = new JBlock();
 currBlock.add(innerBlock);
 return innerBlock;
}

代码示例来源:origin: dremio/dremio-oss

/**
 * Creates an inner braced and indented block
 * @param type type of the created block
 * @return a newly created inner block
 */
private JBlock createInnerBlock(BlockType type) {
 final JBlock currBlock = getBlock(type);
 final JBlock innerBlock = new JBlock();
 currBlock.add(innerBlock);
 return innerBlock;
}

代码示例来源:origin: johncarl81/transfuse

@Override
public JStatement buildFieldSet(boolean cast, ASTField field, TypedExpression expression, TypedExpression containingExpression) {
  JBlock assignmentBlock = new JBlock(false, false);
  assignmentBlock.assign(conditionalCast(cast, generationUtil.ref(containingExpression.getType()), containingExpression.getExpression()).ref(field.getName()), invocationHelper.coerceType(field.getASTType(), expression));
  return assignmentBlock;
}

相关文章