Class EclipseContainer
- java.lang.Object
-
- org.faktorips.devtools.abstraction.AWrapper<org.eclipse.core.resources.IResource>
-
- org.faktorips.devtools.abstraction.eclipse.internal.EclipseResource
-
- org.faktorips.devtools.abstraction.eclipse.internal.EclipseContainer
-
- All Implemented Interfaces:
java.lang.Comparable<AResource>,java.lang.Iterable<AResource>,org.eclipse.core.runtime.IAdaptable,AAbstraction,AContainer,AResource
- Direct Known Subclasses:
EclipseFolder,EclipseProject,EclipseWorkspaceRoot
public abstract class EclipseContainer extends EclipseResource implements AContainer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.faktorips.devtools.abstraction.AResource
AResource.AResourceTreeTraversalDepth, AResource.AResourceType
-
-
Field Summary
-
Fields inherited from interface org.faktorips.devtools.abstraction.AResource
COMPARING_BY_NAME
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AResourcefindMember(java.lang.String path)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.AFilegetFile(java.nio.file.Path path)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).AFoldergetFolder(java.nio.file.Path path)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).java.util.SortedSet<AResource>getMembers()Returns this container's members, sorted by their name.org.eclipse.core.resources.IContainerunwrap()Returns the platform-specific object corresponding to this abstraction.-
Methods inherited from class org.faktorips.devtools.abstraction.eclipse.internal.EclipseResource
copy, createMarker, delete, deleteMarkers, exists, findMarkers, getAdapter, getLocalTimeStamp, getLocation, getModificationStamp, getName, getParent, getProject, getProjectRelativePath, getType, getWorkspace, getWorkspaceRelativePath, isAccessible, isDerived, isSynchronized, move, refreshLocal, setDerived, touch
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.faktorips.devtools.abstraction.AContainer
iterator
-
Methods inherited from interface org.faktorips.devtools.abstraction.AResource
compareTo, copy, createMarker, delete, deleteMarkers, exists, findMarkers, getLocalTimeStamp, getLocation, getModificationStamp, getName, getParent, getProject, getProjectRelativePath, getType, getWorkspace, getWorkspaceRelativePath, isAccessible, isDerived, isSynchronized, move, refreshLocal, setDerived, touch
-
-
-
-
Method Detail
-
unwrap
public org.eclipse.core.resources.IContainer unwrap()
Description copied from interface:AAbstractionReturns 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 aClassCastExceptionwill 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:
unwrapin interfaceAAbstraction- Overrides:
unwrapin classEclipseResource- See Also:
Wrappers#unwrap(AAbstraction) for a way to unwrap potentially null abstractions.
-
getMembers
public java.util.SortedSet<AResource> getMembers()
Description copied from interface:AContainerReturns this container's members, sorted by their name.- Specified by:
getMembersin interfaceAContainer- Returns:
- this container's members
-
getFile
public AFile getFile(java.nio.file.Path path)
Description copied from interface:AContainerReturns 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 notexist.- Specified by:
getFilein interfaceAContainer- 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:AContainerReturns 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 notexist.- Specified by:
getFolderin interfaceAContainer- 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:AContainerReturns 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:
findMemberin interfaceAContainer- Parameters:
path- a path, relative to this container- Returns:
- the member identified by the path or
nullif no such member exists
-
-