Examples of directStatement()


Examples of com.sun.codemodel.JBlock.directStatement()

    private void addRouterMethod(JDefinedClass router, JDefinedClass definedClass) {
        String className = definedClass.fullName();
        JMethod method = router.method(generateMods, definedClass, definedClass.name());
        JBlock block = method.body();
        block.directStatement("return new " + className + "();");
    }
}
View Full Code Here

Examples of com.sun.codemodel.JBlock.directStatement()

    // return true;
    tryBlock.body()._return(JExpr.TRUE);

    // } catch (JAXBException _x) {
    final JBlock catchBlock = tryBlock._catch(jaxbExceptionClass.boxify()).body();
    catchBlock.directStatement("_x.printStackTrace();");
    catchBlock._return(JExpr.FALSE);
    return generateMarshalOutputStream;
  }

  private JMethod generateMarshal(final ClassOutlineImpl cc, final JType argumentType, final ArrayList<String> comment) {
View Full Code Here

Examples of com.sun.codemodel.JBlock.directStatement()

    // return true;
    tryBlock.body()._return(JExpr.TRUE);

    // } catch (JAXBException _x) {
    final JBlock catchBlock = tryBlock._catch(jaxbExceptionClass.boxify()).body();
    catchBlock.directStatement("_x.printStackTrace();");
    catchBlock._return(JExpr.FALSE);
    return generateMarshalOutputStream;
  }

  private void generateUnMarshalMethods(final ClassOutlineImpl cc) {
View Full Code Here

Examples of com.sun.codemodel.JBlock.directStatement()

    final JVar schemaFileVar = tryValidateBlock.body().decl(fileClass, "schemaFile", JExpr._new(fileClass).arg(schemaLocationVar));
    final JVar schemaVar = tryValidateBlock.body().decl(schemaClass, "schema", schemaFactoryVar.invoke("newSchema").arg(schemaFileVar));
    tryValidateBlock.body().add(unmarshallValidateVar.invoke("setSchema").arg(schemaVar));
    tryValidateBlock.body()._return(JExpr.TRUE);
    final JBlock catchValidateBlock = tryValidateBlock._catch(saxExceptionClass.boxify()).body();
    catchValidateBlock.directStatement("_x.printStackTrace();");
    generateValidate.body()._return(JExpr.FALSE);
    return generateValidate;
  }

  /**
 
View Full Code Here

Examples of com.sun.codemodel.JBlock.directStatement()

    {
        final JFieldVar field = c.implClass.fields().get( p.getName( false ) );
        final JMethod setter = c.implClass.method( JMod.PUBLIC, cm.VOID, "set" + p.getName( true ) );
        final JVar valueParam = setter.param( JMod.FINAL, field.type(), "value" );
        final JBlock body = setter.body();
        body.directStatement( "// " + getMessage( "title" ) );
        body.assign( JExpr._this().ref( field ), valueParam );

        setter.javadoc().append( "Sets the value of the " + p.getName( false ) + " property." );
        setter.javadoc().addParam( valueParam ).append( "The new value of the " + p.getName( false ) + " property." );
    }
View Full Code Here

Examples of com.sun.codemodel.JBlock.directStatement()

        getFooEndpoint1.param(String.class,"url");
        JBlock geBody1 = getFooEndpoint1.body();
        JInvocation getEndp = JExpr.invoke(getFooEndpoint);
        JVar tpe = geBody1.decl(serviceIntf, "var", getEndp );
       
        geBody1.directStatement("org.codehaus.xfire.client.Client.getInstance(var).setUrl(url);");
        geBody1._return(tpe);
    }

}
View Full Code Here

Examples of com.sun.codemodel.JBlock.directStatement()

    sub.add(ObjectInspectorHelper.initReturnValueHolder(g, m, workspaceJVars[4], returnOI, returnType.getMinorType()));

    // now add it to the doSetup block in Generated class
    JBlock setup = g.getBlock(ClassGenerator.BlockType.SETUP);
    setup.directStatement(String.format("/** start %s for function %s **/ ",
      ClassGenerator.BlockType.SETUP.name(), genericUdfClazz.getName() + (!isGenericUDF ? "("+udfName+")" : "")));

    setup.add(sub);

    setup.directStatement(String.format("/** end %s for function %s **/ ",
View Full Code Here

Examples of com.sun.codemodel.JBlock.directStatement()

    setup.directStatement(String.format("/** start %s for function %s **/ ",
      ClassGenerator.BlockType.SETUP.name(), genericUdfClazz.getName() + (!isGenericUDF ? "("+udfName+")" : "")));

    setup.add(sub);

    setup.directStatement(String.format("/** end %s for function %s **/ ",
      ClassGenerator.BlockType.SETUP.name(), genericUdfClazz.getName() + (!isGenericUDF ? "("+udfName+")" : "")));
  }

  private HoldingContainer generateEval(ClassGenerator<?> g, HoldingContainer[] inputVariables, JVar[] workspaceJVars) {

View Full Code Here

Examples of com.sun.codemodel.JBlock.directStatement()

    sub.add(ObjectInspectorHelper.getDrillObject(m, returnOI, workspaceJVars[0], workspaceJVars[4], retVal));
    sub.assign(out.getHolder(), workspaceJVars[4]);

    // now add it to the doEval block in Generated class
    JBlock setup = g.getBlock(ClassGenerator.BlockType.EVAL);
    setup.directStatement(String.format("/** start %s for function %s **/ ",
      ClassGenerator.BlockType.EVAL.name(), genericUdfClazz.getName() + (!isGenericUDF ? "("+udfName+")" : "")));
    setup.add(sub);
    setup.directStatement(String.format("/** end %s for function %s **/ ",
      ClassGenerator.BlockType.EVAL.name(), genericUdfClazz.getName() + (!isGenericUDF ? "("+udfName+")" : "")));

View Full Code Here

Examples of com.sun.codemodel.JBlock.directStatement()

    // now add it to the doEval block in Generated class
    JBlock setup = g.getBlock(ClassGenerator.BlockType.EVAL);
    setup.directStatement(String.format("/** start %s for function %s **/ ",
      ClassGenerator.BlockType.EVAL.name(), genericUdfClazz.getName() + (!isGenericUDF ? "("+udfName+")" : "")));
    setup.add(sub);
    setup.directStatement(String.format("/** end %s for function %s **/ ",
      ClassGenerator.BlockType.EVAL.name(), genericUdfClazz.getName() + (!isGenericUDF ? "("+udfName+")" : "")));

    return out;
  }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.