/** * Returns the resolved classpath entry associated with this runtime * entry, resolving if required. * @return the resolved {@link IClasspathEntry} */ protected IClasspathEntry getResolvedClasspathEntry() { if (fResolvedEntry == null) { fResolvedEntry = JavaCore.getResolvedClasspathEntry(getClasspathEntry()); } return fResolvedEntry; }
/** * @see IRuntimeClasspathEntry#getSourceAttachmentRootPath() */ @Override public IPath getSourceAttachmentRootPath() { IClasspathEntry entry = getClasspathEntry(); IPath path = entry != null ? getClasspathEntry().getSourceAttachmentRootPath() : null; if (path == null && getSourceAttachmentPath() != null) { return Path.EMPTY; } return path; }
/** * @see IRuntimeClasspathEntry#getPath() */ @Override public IPath getPath() { IClasspathEntry entry = getClasspathEntry(); return entry != null ? entry.getPath() : fInvalidPath; }
/** * @see IRuntimeClasspathEntry#getPath() */ @Override public IPath getPath() { IClasspathEntry entry = getClasspathEntry(); return entry != null ? entry.getPath() : fInvalidPath; }
/** * @see IRuntimeClasspathEntry#getSourceAttachmentPath() */ @Override public IPath getSourceAttachmentPath() { IClasspathEntry entry = getClasspathEntry(); return entry != null ? entry.getSourceAttachmentPath() : null; }
/** * @see IRuntimeClasspathEntry#getSourceAttachmentPath() */ @Override public IPath getSourceAttachmentPath() { IClasspathEntry entry = getClasspathEntry(); return entry != null ? entry.getSourceAttachmentPath() : null; }
/** * @see IRuntimeClasspathEntry#getSourceAttachmentRootPath() */ @Override public IPath getSourceAttachmentRootPath() { IClasspathEntry entry = getClasspathEntry(); IPath path = entry != null ? getClasspathEntry().getSourceAttachmentRootPath() : null; if (path == null && getSourceAttachmentPath() != null) { return Path.EMPTY; } return path; }
/** * Returns the resolved classpath entry associated with this runtime * entry, resolving if required. * @return the resolved {@link IClasspathEntry} */ protected IClasspathEntry getResolvedClasspathEntry() { if (fResolvedEntry == null) { fResolvedEntry = JavaCore.getResolvedClasspathEntry(getClasspathEntry()); } return fResolvedEntry; }
@Override public IPath getExternalAnnotationsPath() { IClasspathEntry entry = getClasspathEntry(); if (null != entry) { String s = findClasspathAttribute(entry.getExtraAttributes(), IClasspathAttribute.EXTERNAL_ANNOTATION_PATH); if (null != s) { return new Path(s); } } return null; }
@Override public IPath getExternalAnnotationsPath() { IClasspathEntry entry = getClasspathEntry(); if (null != entry) { String s = findClasspathAttribute(entry.getExtraAttributes(), IClasspathAttribute.EXTERNAL_ANNOTATION_PATH); if (null != s) { return new Path(s); } } return null; }
@Override public boolean isAutomodule() { IClasspathAttribute[] extraAttributes = getClasspathEntry().getExtraAttributes(); for (IClasspathAttribute attribute : extraAttributes) { if (IClasspathAttribute.MODULE.equals(attribute.getName()) && Boolean.TRUE.toString().equals(attribute.getValue())) { return true; } } return false; } }
/** * Creates a new underlying classpath entry for this runtime classpath entry * with the given paths, due to a change in source attachment. * @param path the path * @param sourcePath the source path * @param rootPath the root path */ protected void updateClasspathEntry(IPath path, IPath sourcePath, IPath rootPath, IPath annotationsPath) { IClasspathEntry entry = null; IClasspathEntry original = getClasspathEntry(); switch (getType()) { case ARCHIVE: IClasspathAttribute[] extraAttributes = original.getExtraAttributes(); if (annotationsPath != null) { extraAttributes = setClasspathAttribute(extraAttributes, IClasspathAttribute.EXTERNAL_ANNOTATION_PATH, annotationsPath.toPortableString()); } entry = JavaCore.newLibraryEntry(path, sourcePath, rootPath, original.getAccessRules(), extraAttributes, original.isExported()); break; case VARIABLE: entry = JavaCore.newVariableEntry(path, sourcePath, rootPath); break; default: return; } setClasspathEntry(entry); }
/** * Creates a new underlying classpath entry for this runtime classpath entry * with the given paths, due to a change in source attachment. * @param path the path * @param sourcePath the source path * @param rootPath the root path */ protected void updateClasspathEntry(IPath path, IPath sourcePath, IPath rootPath, IPath annotationsPath) { IClasspathEntry entry = null; IClasspathEntry original = getClasspathEntry(); switch (getType()) { case ARCHIVE: IClasspathAttribute[] extraAttributes = original.getExtraAttributes(); if (annotationsPath != null) { extraAttributes = setClasspathAttribute(extraAttributes, IClasspathAttribute.EXTERNAL_ANNOTATION_PATH, annotationsPath.toPortableString()); } entry = JavaCore.newLibraryEntry(path, sourcePath, rootPath, original.getAccessRules(), extraAttributes, original.isExported()); break; case VARIABLE: entry = JavaCore.newVariableEntry(path, sourcePath, rootPath); break; default: return; } setClasspathEntry(entry); }