use of com.kyj.fx.voeditor.core.model.meta.FieldMeta in project Gargoyle by callakrsos.
the class SimpleTest method test.
@Test
public void test() throws Exception {
FieldMeta fieldMeta = new FieldMeta((Modifier.PRIVATE), "sample", String.class);
fieldMeta.setPrimarykey(true);
fieldMeta.setAlias("키속성");
FieldMeta fieldMeta2 = new FieldMeta((Modifier.PRIVATE), "sample2", String.class);
FieldMeta fieldMeta3 = new FieldMeta((Modifier.PRIVATE), "check", boolean.class);
FieldMeta fieldMeta4 = new FieldMeta((Modifier.PRIVATE), "count", int.class);
FieldMeta fieldMeta5 = new FieldMeta((Modifier.PRIVATE), "name", StringProperty.class, SimpleStringProperty.class);
FieldMeta fieldMeta6 = new FieldMeta((Modifier.PRIVATE), "name2", StringProperty.class, SimpleStringProperty.class);
/*
* , FxVo.class, new Class<?>[] { IExtractClass .class, IExtractField
* .class }
*/
ClassMeta classMeta = new ClassMeta("com.sample", "Simple");
VoEditor voEditor = new VoEditor(classMeta, fieldMeta, fieldMeta2, fieldMeta3, fieldMeta4, fieldMeta5, fieldMeta6);
voEditor.build();
String text = voEditor.toText();
LOGGER.debug(text);
}
use of com.kyj.fx.voeditor.core.model.meta.FieldMeta in project Gargoyle by callakrsos.
the class BaseFxExtractConstructor method work.
@Override
public void work(FxVo vo, ClassMeta classMeta, FieldMeta... fieldMetas) {
StringBuffer constructPart = vo.getConstructPart();
constructPart.append("\tpublic ").append(classMeta.getName()).append("( ) \n");
constructPart.append("\t{ \n");
for (FieldMeta meta : fieldMetas) {
try {
this.extract(vo, meta);
} catch (Exception e) {
e.printStackTrace();
}
}
constructPart.append("\t} \n");
}
use of com.kyj.fx.voeditor.core.model.meta.FieldMeta in project Gargoyle by callakrsos.
the class VOEditorParser2 method main.
public static void main(String[] args) throws ParseException, IOException {
String fileName = "C:\\Users\\KYJ\\JAVA_FX\\gagoyleWorkspace\\VisualFxVoEditor\\src\\main\\java\\com\\kyj\\fx\\voeditor\\visual\\main\\model\\vo\\ClassPathEntry.java";
FileInputStream in = new FileInputStream(fileName);
CompilationUnit cu;
try {
// parse the file
cu = JavaParser.parse(in);
} finally {
in.close();
}
PackageDeclaration packageDeclaration = cu.getPackage();
// System.out.println(packageDeclaration.getName().toString());
// System.out.println();
// System.out.println(String.format("package name : %s",
// packageDeclaration.getName().getName()));
ClassMeta classMeta = new ClassMeta("");
classMeta.setPackageName(packageDeclaration.getName().toString());
ArrayList<FieldMeta> fields = new ArrayList<FieldMeta>();
VoEditor voEditor = new VoEditor(classMeta, fields);
List<Node> childrenNodes = cu.getChildrenNodes();
for (Node n : childrenNodes) {
}
new MethodVisitor().visit(cu, null);
}
Aggregations