Class EclipseWorkspaceRoot

    • Method Detail

      • unwrap

        public org.eclipse.core.resources.IWorkspaceRoot unwrap()
        Description copied from interface: AAbstraction
        Returns the platform-specific object corresponding to this abstraction. The generic type parameter is used to avoid casts when assigning to platform-specific objects. It is the obligation of the caller to make sure the right type is used, otherwise a ClassCastException will be thrown.

        Sample usage:

         
         interface ACalendar extends AAbstraction[...]
         class LocalDateAsCalendarWrapper extends AWrapper<LocalDate>[...]
         [...]
         ACalendar calendar = Wrappers.of(LocalDate.now()).as(ACalendar.class);
         [...]
         LocalDate date = calendar.unwrap();
         
         
        Specified by:
        unwrap in interface AAbstraction
        Overrides:
        unwrap in class EclipseContainer
        See Also:
        Wrappers#unwrap(AAbstraction) for a way to unwrap potentially null abstractions.
      • getProject

        public AProject getProject​(java.lang.String name)
        Description copied from interface: AWorkspaceRoot
        Returns the project with the given name in this workspace. It may not exist.
        Specified by:
        getProject in interface AWorkspaceRoot
        Parameters:
        name - a project's name
      • getFileForLocation

        public AFile getFileForLocation​(java.nio.file.Path location)
        Description copied from interface: AWorkspaceRoot
        Returns the file with the given name in a project inside this workspace.
        Specified by:
        getFileForLocation in interface AWorkspaceRoot
        Parameters:
        location - a file location; should reference a resource in one of the projects of this workspace
        Returns:
        the resource corresponding to the file, or null if no such file exists in this workspace