Class EclipseContainer

    • Method Detail

      • unwrap

        public org.eclipse.core.resources.IContainer 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 EclipseResource
        See Also:
        Wrappers#unwrap(AAbstraction) for a way to unwrap potentially null abstractions.
      • getMembers

        public java.util.SortedSet<AResource> getMembers()
        Description copied from interface: AContainer
        Returns this container's members, sorted by their name.
        Specified by:
        getMembers in interface AContainer
        Returns:
        this container's members
      • getFile

        public AFile getFile​(java.nio.file.Path path)
        Description copied from interface: AContainer
        Returns the file that is a member of this container (or one of its members) denoted by the given path (interpreted as relative to this resource). It may not exist.
        Specified by:
        getFile in interface AContainer
        Parameters:
        path - a path, relative to this container
        Returns:
        the file identified by the path
      • getFolder

        public AFolder getFolder​(java.nio.file.Path path)
        Description copied from interface: AContainer
        Returns the folder that is a member of this container (or one of its members) denoted by the given path (interpreted as relative to this resource). It may not exist.
        Specified by:
        getFolder in interface AContainer
        Parameters:
        path - a path, relative to this container
        Returns:
        the folder identified by the path
      • findMember

        public AResource findMember​(java.lang.String path)
        Description copied from interface: AContainer
        Returns the member of this container (or one of its members) denoted by the given path (interpreted as relative to this resource), if it exists.
        Specified by:
        findMember in interface AContainer
        Parameters:
        path - a path, relative to this container
        Returns:
        the member identified by the path or null if no such member exists