public IType getType(String typeName) { IClassFile classFile= getPackageFragment().getClassFile(getTypeQualifiedName() + "$" + typeName + SUFFIX_STRING_class); //$NON-NLS-1$ return new BinaryType((JavaElement)classFile, typeName); } public ITypeParameter getTypeParameter(String typeParameterName) {
/** * @see IType#codeComplete(char[], int, int, char[][], char[][], int[], boolean, ICompletionRequestor) * @deprecated */ @Override public void codeComplete(char[] snippet,int insertion,int position,char[][] localVariableTypeNames,char[][] localVariableNames,int[] localVariableModifiers,boolean isStatic,ICompletionRequestor requestor) throws JavaModelException { codeComplete(snippet, insertion, position, localVariableTypeNames, localVariableNames, localVariableModifiers, isStatic, requestor, DefaultWorkingCopyOwner.PRIMARY); }
public IMethod[] findMethods(IMethod method) { try { return findMethods(method, getMethods()); } catch (JavaModelException e) { // if type doesn't exist, no matching method can exist return null; } } public IAnnotation[] getAnnotations() throws JavaModelException {
throw new IllegalArgumentException("Completion requestor cannot be null"); //$NON-NLS-1$ JavaProject project = (JavaProject) getJavaProject(); SearchableEnvironment environment = project.newSearchableNameEnvironment(owner); CompletionEngine engine = new CompletionEngine(environment, requestor, project.getOptions(true), project, owner, monitor); String source = getClassFile().getSource(); if (source != null && insertion > -1 && insertion < source.length()) { fakeSource, null, getElementName(),
@Override public IJavaElement[] getChildrenForCategory(String category) throws JavaModelException { IJavaElement[] children = getChildren(); int length = children.length; if (length == 0) return children; SourceMapper mapper= getSourceMapper(); if (mapper != null) { getClassFile().getBuffer();
this.unknownFormatAnchorIndexes = new int[this.type.getChildren().length]; this.unknownFormatAnchorIndexesCount = 0; this.unknownFormatLastAnchorFoundIndex = this.childrenStart; } else { if (this.fieldAnchorIndexes == null) { this.fieldAnchorIndexes = new int[this.type.getFields().length]; this.fieldAnchorIndexesCount = 0; this.fieldLastAnchorFoundIndex = this.indexOfFieldDetails;
@Override public Object getElementInfo(IProgressMonitor monitor) throws JavaModelException { JavaModelManager manager = JavaModelManager.getJavaModelManager(); Object info = manager.getInfo(this); if (info != null && info != JavaModelCache.NON_EXISTING_JAR_TYPE_INFO) return info; return openWhenClosed(createElementInfo(), false, monitor); } /*
@Override public IAnnotation[] getAnnotations() throws JavaModelException { IBinaryType info = (IBinaryType) getElementInfo(); IBinaryAnnotation[] binaryAnnotations = info.getAnnotations(); return getAnnotations(binaryAnnotations, info.getTagBits()); }
private static String sourceFileName(AbstractClassFile classFile) { if (classFile instanceof ModularClassFile) return TypeConstants.MODULE_INFO_FILE_NAME_STRING; else return ((BinaryType) ((ClassFile) classFile).getType()).getSourceFileName(null/*no info available*/); }
@Override public IMethod[] getMethods() throws JavaModelException { ArrayList list = getChildrenOfType(METHOD); int size; if ((size = list.size()) == 0) { return NO_METHODS; } else { IMethod[] array= new IMethod[size]; list.toArray(array); return array; } }
public IJavaElement[] getChildren() throws JavaModelException { ClassFileInfo cfi = getClassFileInfo(); return cfi.binaryChildren; } public IJavaElement[] getChildrenForCategory(String category) throws JavaModelException {
public JavaElement unresolved() { SourceRefElement handle = new BinaryType(this.parent, this.name); handle.occurrenceCount = this.occurrenceCount; return handle; } }
throw new IllegalArgumentException("Completion requestor cannot be null"); //$NON-NLS-1$ JavaProject project = (JavaProject) getJavaProject(); SearchableEnvironment environment = project.newSearchableNameEnvironment(owner); CompletionEngine engine = new CompletionEngine(environment, requestor, project.getOptions(true), project, owner, monitor); String source = getClassFile().getSource(); if (source != null && insertion > -1 && insertion < source.length()) { fakeSource, null, getElementName(),
public IJavaElement[] getChildrenForCategory(String category) throws JavaModelException { IJavaElement[] children = getChildren(); int length = children.length; if (length == 0) return children; SourceMapper mapper= getSourceMapper(); if (mapper != null) { ((ClassFile)getClassFile()).getBuffer();
this.unknownFormatAnchorIndexes = new int[this.type.getChildren().length]; this.unknownFormatAnchorIndexesCount = 0; this.unknownFormatLastAnchorFoundIndex = this.childrenStart; } else { if (this.fieldAnchorIndexes == null) { this.fieldAnchorIndexes = new int[this.type.getFields().length]; this.fieldAnchorIndexesCount = 0; this.fieldLastAnchorFoundIndex = this.indexOfFieldDetails;
public Object getElementInfo(IProgressMonitor monitor) throws JavaModelException { JavaModelManager manager = JavaModelManager.getJavaModelManager(); Object info = manager.getInfo(this); if (info != null && info != JavaModelCache.NON_EXISTING_JAR_TYPE_INFO) return info; return openWhenClosed(createElementInfo(), false, monitor); } /*
public IAnnotation[] getAnnotations() throws JavaModelException { IBinaryType info = (IBinaryType) getElementInfo(); IBinaryAnnotation[] binaryAnnotations = info.getAnnotations(); return getAnnotations(binaryAnnotations, info.getTagBits()); } /*
private static String sourceFileName(AbstractClassFile classFile) { if (classFile instanceof ModularClassFile) return TypeConstants.MODULE_INFO_FILE_NAME_STRING; else return ((BinaryType) ((ClassFile) classFile).getType()).getSourceFileName(null/*no info available*/); }
public IField[] getFields() throws JavaModelException { ArrayList list = getChildrenOfType(FIELD); int size; if ((size = list.size()) == 0) { return NO_FIELDS; } else { IField[] array= new IField[size]; list.toArray(array); return array; } } /*
@Override public IJavaElement[] getChildren() throws JavaModelException { ClassFileInfo cfi = getClassFileInfo(); return cfi.binaryChildren; } @Override