List of usage examples for org.eclipse.jdt.internal.compiler.env NameEnvironmentAnswer getBinaryType
public IBinaryType getBinaryType()
From source file:com.codenvy.ide.ext.java.SearchableEnvironmentTest.java
License:Open Source License
private String processAnswer(NameEnvironmentAnswer answer, IJavaProject project, INameEnvironment environment) throws JavaModelException { if (answer == null) return null; if (answer.isBinaryType()) { IBinaryType binaryType = answer.getBinaryType(); return BinaryTypeConvector.toJsonBinaryType(binaryType); } else if (answer.isCompilationUnit()) { ICompilationUnit compilationUnit = answer.getCompilationUnit(); return getSourceTypeInfo(project, environment, compilationUnit); } else if (answer.isSourceType()) { ISourceType[] sourceTypes = answer.getSourceTypes(); if (sourceTypes.length == 1) { ISourceType sourceType = sourceTypes[0]; SourceTypeElementInfo elementInfo = (SourceTypeElementInfo) sourceType; IType handle = elementInfo.getHandle(); org.eclipse.jdt.core.ICompilationUnit unit = handle.getCompilationUnit(); return getSourceTypeInfo(project, environment, (ICompilationUnit) unit); }/* w w w . j a v a 2s. c om*/ } return null; }