/** * {@inheritDoc} * * @since 3.7 */ public ISourceRange getSourceRange() throws JavaModelException { if (this.declarationSourceEnd == -1) { SourceMapper mapper = getSourceMapper(); if (mapper != null) { // ensure the class file's buffer is open so that source ranges are computed ClassFile classFile = (ClassFile) getClassFile(); if (classFile != null) { classFile.getBuffer(); return mapper.getSourceRange(this); } } return SourceMapper.UNKNOWN_RANGE; } return new SourceRange( this.declarationSourceStart, this.declarationSourceEnd - this.declarationSourceStart + 1); }
/** * {@inheritDoc} * * @since 3.7 */ public ISourceRange getNameRange() { if (this.nameEnd == -1) { SourceMapper mapper = getSourceMapper(); if (mapper != null) { try { // ensure the class file's buffer is open so that source ranges are computed ClassFile classFile = (ClassFile) getClassFile(); if (classFile != null) { classFile.getBuffer(); return mapper.getNameRange(this); } } catch (JavaModelException e) { // ignore } } return SourceMapper.UNKNOWN_RANGE; } return new SourceRange(this.nameStart, this.nameEnd - this.nameStart + 1); }
/** * {@inheritDoc} * * @since 3.7 */ public int getFlags() { if (this.flags == -1) { SourceMapper mapper = getSourceMapper(); if (mapper != null) { try { // ensure the class file's buffer is open so that source ranges are computed ClassFile classFile = (ClassFile) getClassFile(); if (classFile != null) { classFile.getBuffer(); return mapper.getFlags(this); } } catch (JavaModelException e) { // ignore } } return 0; } return this.flags & ExtraCompilerModifiers.AccJustFlag; }