public char[][] fullExclusionPatternChars() { try { if (isOpen() && getKind() != IPackageFragmentRoot.K_SOURCE) return null; ClasspathEntry entry = (ClasspathEntry) getRawClasspathEntry(); if (entry == null) { return null; } else { return entry.fullExclusionPatternChars(); } } catch (JavaModelException e) { return null; } }
public char[][] fullExclusionPatternChars() { try { if (isOpen() && getKind() != IPackageFragmentRoot.K_SOURCE) return null; ClasspathEntry entry = (ClasspathEntry) getRawClasspathEntry(); if (entry == null) { return null; } else { return entry.fullExclusionPatternChars(); } } catch (JavaModelException e) { return null; } }
public char[][] fullExclusionPatternChars() { try { if (isOpen() && getKind() != IPackageFragmentRoot.K_SOURCE) return null; ClasspathEntry entry = (ClasspathEntry) getRawClasspathEntry(); if (entry == null) { return null; } else { return entry.fullExclusionPatternChars(); } } catch (JavaModelException e) { return null; } }
public char[][] fullInclusionPatternChars() { try { if (isOpen() && getKind() != IPackageFragmentRoot.K_SOURCE) return null; ClasspathEntry entry = (ClasspathEntry)getRawClasspathEntry(); if (entry == null) { return null; } else { return entry.fullInclusionPatternChars(); } } catch (JavaModelException e) { return null; } } public String getElementName() {
public char[][] fullExclusionPatternChars() { try { if (isOpen() && getKind() != IPackageFragmentRoot.K_SOURCE) return null; ClasspathEntry entry = (ClasspathEntry) getRawClasspathEntry(); if (entry == null) { return null; } else { return entry.fullExclusionPatternChars(); } } catch (JavaModelException e) { return null; } }
public char[][] fullExclusionPatternChars() { try { if (isOpen() && getKind() != IPackageFragmentRoot.K_SOURCE) return null; ClasspathEntry entry = (ClasspathEntry) getRawClasspathEntry(); if (entry == null) { return null; } else { return entry.fullExclusionPatternChars(); } } catch (JavaModelException e) { return null; } }
public char[][] fullInclusionPatternChars() { try { if (isOpen() && getKind() != IPackageFragmentRoot.K_SOURCE) return null; ClasspathEntry entry = (ClasspathEntry)getRawClasspathEntry(); if (entry == null) { return null; } else { return entry.fullInclusionPatternChars(); } } catch (JavaModelException e) { return null; } } @Override
public char[][] fullExclusionPatternChars() { try { if (isOpen() && getKind() != IPackageFragmentRoot.K_SOURCE) return null; ClasspathEntry entry = (ClasspathEntry) getRawClasspathEntry(); if (entry == null) { return null; } else { return entry.fullExclusionPatternChars(); } } catch (JavaModelException e) { return null; } }
public char[][] fullInclusionPatternChars() { try { if (isOpen() && getKind() != IPackageFragmentRoot.K_SOURCE) return null; ClasspathEntry entry = (ClasspathEntry)getRawClasspathEntry(); if (entry == null) { return null; } else { return entry.fullInclusionPatternChars(); } } catch (JavaModelException e) { return null; } } public String getElementName() {
public char[][] fullInclusionPatternChars() { try { if (isOpen() && getKind() != IPackageFragmentRoot.K_SOURCE) return null; ClasspathEntry entry = (ClasspathEntry)getRawClasspathEntry(); if (entry == null) { return null; } else { return entry.fullInclusionPatternChars(); } } catch (JavaModelException e) { return null; } } public String getElementName() {
public char[][] fullInclusionPatternChars() { try { if (isOpen() && getKind() != IPackageFragmentRoot.K_SOURCE) return null; ClasspathEntry entry = (ClasspathEntry)getRawClasspathEntry(); if (entry == null) { return null; } else { return entry.fullInclusionPatternChars(); } } catch (JavaModelException e) { return null; } } public String getElementName() {
public char[][] fullInclusionPatternChars() { try { if (isOpen() && getKind() != IPackageFragmentRoot.K_SOURCE) return null; ClasspathEntry entry = (ClasspathEntry)getRawClasspathEntry(); if (entry == null) { return null; } else { return entry.fullInclusionPatternChars(); } } catch (JavaModelException e) { return null; } } public String getElementName() {
if (getKind() != K_BINARY) return null;
/** * Possible failures: <ul> * <li>ELEMENT_NOT_PRESENT - the root supplied to the operation * does not exist * <li>INVALID_ELEMENT_TYPES - the root is not of kind K_BINARY * <li>RELATIVE_PATH - the path supplied to this operation must be * an absolute path * </ul> */ protected void verifyAttachSource(IPath sourcePath) throws JavaModelException { if (!exists()) { throw newNotPresentException(); } else if (getKind() != K_BINARY) { throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_ELEMENT_TYPES, this)); } else if (sourcePath != null && !sourcePath.isAbsolute()) { throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.RELATIVE_PATH, sourcePath)); } }
/** * Possible failures: <ul> * <li>ELEMENT_NOT_PRESENT - the root supplied to the operation * does not exist * <li>INVALID_ELEMENT_TYPES - the root is not of kind K_BINARY * <li>RELATIVE_PATH - the path supplied to this operation must be * an absolute path * </ul> */ protected void verifyAttachSource(IPath sourcePath) throws JavaModelException { if (!exists()) { throw newNotPresentException(); } else if (getKind() != K_BINARY) { throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_ELEMENT_TYPES, this)); } else if (sourcePath != null && !sourcePath.isAbsolute()) { throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.RELATIVE_PATH, sourcePath)); } }
/** * Possible failures: <ul> * <li>ELEMENT_NOT_PRESENT - the root supplied to the operation * does not exist * <li>INVALID_ELEMENT_TYPES - the root is not of kind K_BINARY * <li>RELATIVE_PATH - the path supplied to this operation must be * an absolute path * </ul> */ protected void verifyAttachSource(IPath sourcePath) throws JavaModelException { if (!exists()) { throw newNotPresentException(); } else if (getKind() != K_BINARY) { throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_ELEMENT_TYPES, this)); } else if (sourcePath != null && !sourcePath.isAbsolute()) { throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.RELATIVE_PATH, sourcePath)); } }
/** * Possible failures: <ul> * <li>ELEMENT_NOT_PRESENT - the root supplied to the operation * does not exist * <li>INVALID_ELEMENT_TYPES - the root is not of kind K_BINARY * <li>RELATIVE_PATH - the path supplied to this operation must be * an absolute path * </ul> */ protected void verifyAttachSource(IPath sourcePath) throws JavaModelException { if (!exists()) { throw newNotPresentException(); } else if (getKind() != K_BINARY) { throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_ELEMENT_TYPES, this)); } else if (sourcePath != null && !sourcePath.isAbsolute()) { throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.RELATIVE_PATH, sourcePath)); } } /**
/** * Possible failures: <ul> * <li>ELEMENT_NOT_PRESENT - the root supplied to the operation * does not exist * <li>INVALID_ELEMENT_TYPES - the root is not of kind K_BINARY * <li>RELATIVE_PATH - the path supplied to this operation must be * an absolute path * </ul> */ protected void verifyAttachSource(IPath sourcePath) throws JavaModelException { if (!exists()) { throw newNotPresentException(); } else if (getKind() != K_BINARY) { throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_ELEMENT_TYPES, this)); } else if (sourcePath != null && !sourcePath.isAbsolute()) { throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.RELATIVE_PATH, sourcePath)); } }
/** * Possible failures: <ul> * <li>ELEMENT_NOT_PRESENT - the root supplied to the operation * does not exist * <li>INVALID_ELEMENT_TYPES - the root is not of kind K_BINARY * <li>RELATIVE_PATH - the path supplied to this operation must be * an absolute path * </ul> */ protected void verifyAttachSource(IPath sourcePath) throws JavaModelException { if (!exists()) { throw newNotPresentException(); } else if (getKind() != K_BINARY) { throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_ELEMENT_TYPES, this)); } else if (sourcePath != null && !sourcePath.isAbsolute()) { throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.RELATIVE_PATH, sourcePath)); } } /**
private ClasspathLocation mapToClassPathLocation( JavaModelManager manager, PackageFragmentRoot root) { ClasspathLocation cp = null; IPath path = root.getPath(); try { if (root.isArchive()) { ClasspathEntry rawClasspathEntry = (ClasspathEntry) root.getRawClasspathEntry(); cp = new ClasspathJar(manager.getZipFile(path), rawClasspathEntry.getAccessRuleSet(), ClasspathEntry.getExternalAnnotationPath(rawClasspathEntry, ((IJavaProject)root.getParent()).getProject(), true)); } else { Object target = JavaModel.getTarget(path, true); if (target != null) { if (root.getKind() == IPackageFragmentRoot.K_SOURCE) { cp = new ClasspathSourceDirectory((IContainer)target, root.fullExclusionPatternChars(), root.fullInclusionPatternChars()); } else { ClasspathEntry rawClasspathEntry = (ClasspathEntry) root.getRawClasspathEntry(); cp = ClasspathLocation.forBinaryFolder((IContainer) target, false, rawClasspathEntry.getAccessRuleSet(), ClasspathEntry.getExternalAnnotationPath(rawClasspathEntry, ((IJavaProject)root.getParent()).getProject(), true)); } } } } catch (CoreException e1) { // problem opening zip file or getting root kind // consider root corrupt and ignore } return cp; }