Search in sources :

Example 6 with FieldMeta

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);
}
Also used : FieldMeta(com.kyj.fx.voeditor.core.model.meta.FieldMeta) ClassMeta(com.kyj.fx.voeditor.core.model.meta.ClassMeta) VoEditor(com.kyj.fx.voeditor.core.VoEditor) Test(org.junit.Test)

Example 7 with FieldMeta

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");
}
Also used : FieldMeta(com.kyj.fx.voeditor.core.model.meta.FieldMeta)

Example 8 with FieldMeta

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);
}
Also used : CompilationUnit(com.github.javaparser.ast.CompilationUnit) ClassMeta(com.kyj.fx.voeditor.core.model.meta.ClassMeta) FieldMeta(com.kyj.fx.voeditor.core.model.meta.FieldMeta) Node(com.github.javaparser.ast.Node) ArrayList(java.util.ArrayList) FileInputStream(java.io.FileInputStream) PackageDeclaration(com.github.javaparser.ast.PackageDeclaration) VoEditor(com.kyj.fx.voeditor.core.VoEditor)

Aggregations

FieldMeta (com.kyj.fx.voeditor.core.model.meta.FieldMeta)8 ClassMeta (com.kyj.fx.voeditor.core.model.meta.ClassMeta)4 Test (org.junit.Test)3 VoEditor (com.kyj.fx.voeditor.core.VoEditor)2 ArrayList (java.util.ArrayList)2 TbpSysDaoMethodsDVO (kyj.Fx.dao.wizard.core.model.vo.TbpSysDaoMethodsDVO)2 CompilationUnit (com.github.javaparser.ast.CompilationUnit)1 Node (com.github.javaparser.ast.Node)1 PackageDeclaration (com.github.javaparser.ast.PackageDeclaration)1 JavaTextView (com.kyj.fx.voeditor.visual.component.popup.JavaTextView)1 DaoWizardConverter (com.kyj.fx.voeditor.visual.util.DaoWizardConverter)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 FXML (javafx.fxml.FXML)1 Pair (javafx.util.Pair)1 DaoWizard (kyj.Fx.dao.wizard.DaoWizard)1 TableModelDVO (kyj.Fx.dao.wizard.core.model.vo.TableModelDVO)1 TbmSysDaoDVO (kyj.Fx.dao.wizard.core.model.vo.TbmSysDaoDVO)1 TbpSysDaoColumnsDVO (kyj.Fx.dao.wizard.core.model.vo.TbpSysDaoColumnsDVO)1 TbpSysDaoFieldsDVO (kyj.Fx.dao.wizard.core.model.vo.TbpSysDaoFieldsDVO)1