Search in sources :

Example 6 with ClassMeta

use of com.kyj.fx.voeditor.core.model.meta.ClassMeta in project Gargoyle by callakrsos.

the class FxDaoCommons method isDuplicated.

/**
	 * 파라미터 클래스정보에 동일한 클래스타입이 존재하는지 확인한다.
	 *
	 * @작성자 : KYJ
	 * @작성일 : 2015. 10. 28.
	 * @param params
	 * @return
	 */
public boolean isDuplicated(List<ClassMeta> params) {
    if (params != null) {
        Set<String> set = new HashSet<>();
        for (ClassMeta meta : params) {
            String key = meta.getPackageName() + meta.getName();
            if (set.contains(key))
                return true;
            set.add(key);
        }
    }
    return false;
}
Also used : ClassMeta(com.kyj.fx.voeditor.core.model.meta.ClassMeta) HashSet(java.util.HashSet)

Example 7 with ClassMeta

use of com.kyj.fx.voeditor.core.model.meta.ClassMeta 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

ClassMeta (com.kyj.fx.voeditor.core.model.meta.ClassMeta)7 FieldMeta (com.kyj.fx.voeditor.core.model.meta.FieldMeta)4 VoEditor (com.kyj.fx.voeditor.core.VoEditor)3 JavaTextView (com.kyj.fx.voeditor.visual.component.popup.JavaTextView)2 IOException (java.io.IOException)2 Pair (javafx.util.Pair)2 TbpSysDaoMethodsDVO (kyj.Fx.dao.wizard.core.model.vo.TbpSysDaoMethodsDVO)2 Test (org.junit.Test)2 ParseException (com.github.javaparser.ParseException)1 CompilationUnit (com.github.javaparser.ast.CompilationUnit)1 Node (com.github.javaparser.ast.Node)1 PackageDeclaration (com.github.javaparser.ast.PackageDeclaration)1 GargoyleFileAlreadyExistException (com.kyj.fx.voeditor.visual.exceptions.GargoyleFileAlreadyExistException)1 DaoWizardConverter (com.kyj.fx.voeditor.visual.util.DaoWizardConverter)1 VoEditorConverter (com.kyj.fx.voeditor.visual.util.VoEditorConverter)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 FXML (javafx.fxml.FXML)1