Example usage for java.lang TypeNotPresentException printStackTrace

List of usage examples for java.lang TypeNotPresentException printStackTrace

Introduction

In this page you can find the example usage for java.lang TypeNotPresentException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:org.netbeans.jpa.modeler.properties.implement.JavaClassArtifactPanel.java

private void importFields(ElementHandle<TypeElement> classHandle) {
    FileObject pkg = SourceGroupSupport.findSourceGroupForFile(modelerFile.getFileObject()).getRootFolder();
    try {//from  w w  w.j  a v a2  s  . co  m
        JavaSource javaSource = JavaSource.create(ClasspathInfo.create(pkg));
        javaSource.runUserActionTask((CompilationController controller) -> {
            try {
                controller.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);//classHandle.resolve(controller);//
                TypeElement jc = controller.getElements().getTypeElement(classHandle.getQualifiedName());
                if (jc != null) {
                    Map<String, String> elements = new LinkedHashMap<>();
                    for (ExecutableElement method : JavaSourceParserUtil.getMethods(jc)) {
                        try {
                            String methodName = method.getSimpleName().toString();
                            if (methodName.startsWith("get") || methodName.startsWith("is")) {
                                //                                    elements.put
                            }
                        } catch (TypeNotPresentException ex) {
                            ex.printStackTrace();
                        }
                    }

                } else {
                    JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
                            NbBundle.getMessage(JavaClassArtifactPanel.class, "MSG_ARTIFACT_NOT_FOUND"));
                }
            } catch (IOException t) {
                ExceptionUtils.printStackTrace(t);
            }
        }, true);
    } catch (IOException ex) {
        Exceptions.printStackTrace(ex);
    }
}