Codota Logo
JCodeModel.build
Code IndexAdd Codota to your IDE (free)

How to use
build
method
in
com.sun.codemodel.JCodeModel

Best Java code snippets using com.sun.codemodel.JCodeModel.build (Showing top 20 results out of 639)

  • Common ways to obtain JCodeModel
private void myMethod () {
JCodeModel j =
  • Codota Iconnew JCodeModel()
  • Codota IconJDefinedClass jDefinedClass;jDefinedClass.owner()
  • Codota IconOutline outline;outline.getCodeModel()
  • Smart code suggestions by Codota
}
origin: stackoverflow.com

 JCodeModel cm = new JCodeModel();
JDefinedClass dc = cm._class("foo.Bar");
JMethod m = dc.method(0, int.class, "foo");
m.body()._return(JExpr.lit(5));

File file = new File("./target/classes");
file.mkdirs();
cm.build(file);
origin: Vedenin/useful-java-links

codeModel.build(directory);
origin: joelittlejohn/jsonschema2pojo

  CodeWriter sourcesWriter = new ScalaFileCodeWriter(config.getTargetDirectory(), config.getOutputEncoding());
  CodeWriter resourcesWriter = new FileCodeWriterWithEncoding(config.getTargetDirectory(), config.getOutputEncoding());
  codeModel.build(sourcesWriter, resourcesWriter);
} else {
  CodeWriter sourcesWriter = new FileCodeWriterWithEncoding(config.getTargetDirectory(), config.getOutputEncoding());
  CodeWriter resourcesWriter = new FileCodeWriterWithEncoding(config.getTargetDirectory(), config.getOutputEncoding());
  codeModel.build(sourcesWriter, resourcesWriter);
origin: javaee/glassfish

@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
  cm = new JCodeModel();
  for (TypeElement annotation : annotations) {
    for(javax.lang.model.element.Element d : roundEnv.getElementsAnnotatedWith(annotation)) {
      d.accept(visitor, null);
    }
    try {
      cm.build(new FilerCodeWriter(processingEnv.getFiler()));
    } catch (IOException e) {
      throw new Error(e);
    }
  }
  return true;
}
origin: e-biz/androidkickstartr

private void generateSourceCode() throws IOException {
  List<Generator> generators = new ArrayList<Generator>();
  generators.add(new MainActivityGenerator(appDetails));
  if (appDetails.isViewPager() && !appDetails.isSample()) {
    generators.add(new ViewPagerAdapterGenerator(appDetails));
    generators.add(new SampleFragmentGenerator(appDetails));
  }
  if (appDetails.isRestTemplate() && appDetails.isAndroidAnnotations() && !appDetails.isSample()) {
    generators.add(new RestClientGenerator(appDetails));
  }
  if (appDetails.isAcra() && !appDetails.isSample()) {
    generators.add(new ApplicationGenerator(appDetails));
  }
  RefHelper refHelper = new RefHelper(jCodeModel);
  refHelper.r(appDetails.getR());
  for (Generator generator : generators) {
    generator.generate(jCodeModel, refHelper);
  }
  jCodeModel.build(fileHelper.getTargetSourceDir());
}
origin: mulesoft-labs/raml-for-jax-rs

 @Override
 public void into(JCodeModel g) throws IOException {
  g.build(rootDirectory);
 }
});
origin: org.raml/jaxrs-code-generator

 @Override
 public void into(JCodeModel g) throws IOException {
  g.build(rootDirectory);
 }
});
origin: org.glassfish.metro/webservices-tools

/**
 * A convenience method for <code>build(out,out)</code>.
 */
public void build( CodeWriter out ) throws IOException {
  build(out,out);
}

origin: com.unquietcode.tools.jcodemodel/codemodel

/**
 * A convenience method for <code>build(destDir,System.out)</code>.
 */
public void build( File destDir ) throws IOException {
  build(destDir,System.out);
}
origin: com.sun.codemodel/codemodel

/**
 * A convenience method for <code>build(destDir,System.out)</code>.
 */
public void build( File destDir ) throws IOException {
  build(destDir,System.out);
}
origin: com.sun.codemodel/codemodel

/**
 * Generates Java source code.
 * A convenience method for <code>build(destDir,destDir,System.out)</code>.
 * 
 * @param    destDir
 *        source files are generated into this directory.
 * @param   status
 *      if non-null, progress indication will be sent to this stream.
 */
public void build( File destDir, PrintStream status ) throws IOException {
  build(destDir,destDir,status);
}
origin: com.sun.codemodel/codemodel

/**
 * A convenience method for <code>build(out,out)</code>.
 */
public void build( CodeWriter out ) throws IOException {
  build(out,out);
}

origin: webdriverextensions/webdriverextensions

  private void generate() throws IOException {
    CodeWriter codeWriter = new ProcessingEnvironmentCodeWriter(processingEnv);
    codeModel.build(codeWriter);
  }
}
origin: net.anwiba.commons.tools/anwiba-tools-generator-bean

public void generate(final File targetFolder, final String comment) throws IOException {
 if (!targetFolder.exists()) {
  targetFolder.mkdirs();
 }
 final CodeWriter sourceCodeWriter = new SourceCodeWriter(targetFolder, comment);
 final CodeWriter fileCodeWriter = new FileCodeWriter(targetFolder);
 this.codeModel.build(sourceCodeWriter, fileCodeWriter);
}
origin: bonitasoft/bonita-engine

public void generate(final File destDir) throws IOException {
  final PrintStream stream = new PrintStream(new NullStream());
  try {
    model.build(destDir, stream);
  } finally {
    stream.close();
  }
}
origin: com.envoisolutions.sxc/sxc-jaxb

public void write(CodeWriter codeWriter) throws IOException, BuildException {
  for (JAXBObjectBuilder builder : jaxbObjectBuilders.values()) {
    builder.write();
  }
  
  buildContext.getCodeModel().build(codeWriter);
}
origin: stackoverflow.com

 SchemaCompiler sc = XJC.createSchemaCompiler();
File file = new File("D:\\my-dir\\my-schema.xsd");
sc.setErrorListener(... );
sc.parseSchema(new InputSource(file.toURI().toString()));
S2JJAXBModel model = sc.bind();
JCodeModel cm = model.generateCode(null, null);
cm.build(new File("."));
origin: johncarl81/transfuse

  @Override
  public R innerRun(V value) {
    try {
      R result = worker.run(value);

      codeModel.build(codeWriter, resourceWriter);

      return result;
    } catch (IOException e) {
      throw new TransfuseRuntimeException("Unable to perform code generation", e);
    }
  }
}
origin: com.googlecode.androidannotations/androidannotations

public void generate(ProcessResult processResult) throws IOException {
  SourceCodewriter sourceCodeWriter = new SourceCodewriter(filer, messager, processResult.originatingElementsByGeneratedClassQualifiedName);
  PrologCodeWriter prologCodeWriter = new PrologCodeWriter(sourceCodeWriter, "DO NOT EDIT THIS FILE, IT HAS BEEN GENERATED USING AndroidAnnotations.\n");
  processResult.codeModel.build(prologCodeWriter, new ResourceCodeWriter(filer));
}
origin: stackoverflow.com

 JCodeModel model = new JCodeModel();
JClass mapper = model.directClass("com.another.Mapper");
JClass factory = model.directClass("com.another.MapperSingleton");
JDefinedClass dc = model._class("com.example.Something");
JMethod method = dc.method(JMod.PUBLIC | JMod.STATIC, mapper, "testMethod");
method.body()._return(factory.staticInvoke("getMapperInstance"));
model.build(destinationDirectory);
com.sun.codemodelJCodeModelbuild

Javadoc

A convenience method for build(out,out).

Popular methods of JCodeModel

  • ref
    Obtains a reference to an existing class from its fully-qualified class name. First, this method at
  • <init>
  • _class
    Creates a new generated class.
  • _package
    Add a package to the list of packages to be generated
  • _ref
  • parseType
    Obtains a type object from a type name. This method handles primitive types, arrays, and existing Cl
  • rootPackage
  • directClass
    Creates a dummy, unknown JClass that represents a given name. This method is useful when the code ge
  • _getClass
    Gets a reference to the already created generated class.
  • packages
    Returns an iterator that walks the packages defined using this code writer.
  • anonymousClass
  • wildcard
    Gets a JClass representation for "?", which is equivalent to "? extends Object".
  • anonymousClass,
  • wildcard,
  • countArtifacts,
  • _prepareModuleInfo,
  • _moduleInfo,
  • _updateModuleInfo

Popular in Java

  • Finding current android device location
  • getSystemService (Context)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now