This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package usecase.model; | |
import java.io.Serializable; | |
import varcode.java.Java; | |
import varcode.java.adhoc.Export; | |
import varcode.java.model._class; | |
public class ModelClass | |
{ | |
static _class _ModelOfClass = _class.of( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package usecase.model; | |
import varcode.java.Java; | |
import varcode.java.adhoc.Export; | |
import varcode.java.model._interface; | |
public class ModelInterface | |
{ | |
static _interface _ModelOfInterface = _interface.of( | |
"package usecase.model;", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package quickstart; | |
import java.io.Serializable; | |
import java.util.UUID; | |
import varcode.java.Java; | |
import varcode.java.adhoc.Export; | |
import varcode.java.meta._class; | |
/** | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package quickstart.java; | |
import varcode.java.adhoc.Export; | |
import varcode.java.meta._Java; | |
import varcode.java.meta._class; | |
public class TailorExistingCode | |
{ | |
public class Existing { | |
public int count; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package quickstart.java; | |
import varcode.java.langmodel._class; | |
public class AdHocCode | |
{ | |
public static void main( String[] args ) | |
{ | |
_class _c = _class.of( "public class AdHoc" ) | |
.method( "public String toString()", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package quickstart.java; | |
import junit.framework.TestCase; | |
import varcode.java._Java; | |
import varcode.java.langmodel._class; | |
/** | |
* varcode makes generating Java source code easy with the langmodel API. | |
* | |
* Models like {@code _class, _enum, and _interface} can also be compiled |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.Serializable; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.UUID; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import varcode.java.code._class; | |
import varcode.java.code._code; | |
import varcode.java.code._interface; | |
import varcode.java.code._methods._method; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package swar.subword; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Random; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.Future; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ex.varcode.java.model; | |
import varcode.java.Java; | |
import varcode.java.JavaCase; | |
import varcode.java.model._class; | |
/**<PRE> | |
* *1* build a _class model | |
* *2* print out the model (.java) source | |
* *3* (javac) compile the (.java) source to a .class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ex.varcode.codeml; | |
import varcode.java.Java; | |
/*{$$condenseBlankLines$$}*/ | |
/*{-*/import varcode.java.JavaCase;/*-}*/ | |
public class /*{+className*/CodeMLHelloWorld/*+}*/ { | |
public static void main( String[] args ) { | |
System.out.println( "{+message+}" ); | |
} |