Class CompositeSourceContainer

    • Constructor Detail

      • CompositeSourceContainer

        public CompositeSourceContainer()
    • Method Detail

      • isComposite

        public boolean isComposite()
        Description copied from interface: ISourceContainer
        Returns whether this container is a composite container. A composite container is composed of other source containers. For example, a workspace source container may be composed of project source containers.
        Specified by:
        isComposite in interface ISourceContainer
        Overrides:
        isComposite in class AbstractSourceContainer
        Returns:
        whether this container is a composite container
      • findSourceElements

        public Object[] findSourceElements​(String name)
                                    throws CoreException
        Description copied from interface: ISourceContainer
        Returns a collection of source elements in this container corresponding to the given name. Returns an empty collection if no source elements are found. This source container's source lookup director specifies if duplicate source elements should be searched for, via isFindDuplicates(). When false the returned collection should contain at most one source element. If this is a composite container, the containers contained by this container are also searched.

        The format of the given name is implementation specific but generally conforms to the format of a file name. If a source container does not recognize the name format provided, an empty collection should be returned. A source container may or may not require names to be fully qualified (i.e. be qualified with directory names).

        Parameters:
        name - the name of the source element to search for
        Returns:
        a collection of source elements corresponding to the given name
        Throws:
        CoreException - if an exception occurs while searching for source elements
      • findSourceElements

        protected Object[] findSourceElements​(String name,
                                              ISourceContainer[] containers)
                                       throws CoreException
        Returns a collection of source elements in the given containers corresponding to the given name. Returns an empty collection if no source elements are found. This source container's source lookup director specifies if duplicate source elements should be searched for, via isFindDuplicates(). When false the returned collection should contain at most one source element. If this is a composite container, the containers contained by this container are also searched.

        The format of the given name is implementation specific but generally conforms to the format of a file name. If a source container does not recognize the name format provided, an empty collection should be returned. A source container may or may not require names to be fully qualified (i.e. be qualified with directory names).

        Parameters:
        name - the name of the source element to search for
        containers - the containers to search
        Returns:
        a collection of source elements corresponding to the given name
        Throws:
        CoreException - if an exception occurs while searching for source elements
      • createSourceContainers

        protected abstract ISourceContainer[] createSourceContainers()
                                                              throws CoreException
        Creates the source containers in this composite container. Subclasses should override this methods.
        Returns:
        the array of ISourceContainers
        Throws:
        CoreException - if unable to create the containers