Class PlainJavaJavaProject
- java.lang.Object
-
- org.faktorips.devtools.abstraction.AWrapper<java.io.File>
-
- org.faktorips.devtools.abstraction.plainjava.internal.PlainJavaJavaElement
-
- org.faktorips.devtools.abstraction.plainjava.internal.PlainJavaJavaProject
-
- All Implemented Interfaces:
AAbstraction,AJavaElement,AJavaProject
public class PlainJavaJavaProject extends PlainJavaJavaElement implements AJavaProject
-
-
Constructor Summary
Constructors Constructor Description PlainJavaJavaProject(java.io.File project)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexists()A Java element exists if its corresponding resource exists and contains information for this element.java.util.Set<APackageFragmentRoot>getAllPackageFragmentRoots()Returns all of the existing package fragment roots that exist on the classpath, in the order they are defined by the classpath.java.util.Map<java.lang.String,java.lang.String>getOptions()Returns the options for this project.java.nio.file.PathgetOutputLocation()Returns the default output location for this project as a path relative to the containing workspace.AProjectgetProject()Returns the corresponding project.java.util.Set<AJavaProject>getReferencedJavaProjects()Returns all other Java projects referenced by this project.java.lang.Runtime.VersiongetSourceVersion()Returns the Java version number for this project's source code.booleanhasBuildState()Returns whether this project has previously been built and retains some information about that build.booleanisJavaFolder(AResource resource)Returns whether the given resource is a Java folder.APackageFragmentRoottoPackageFragmentRoot(java.lang.String externalLibraryPath)Returns the package fragment root for an external library.APackageFragmentRoottoPackageFragmentRoot(AResource resource)Returns theresourceas package fragment root.java.io.Fileunwrap()Returns the platform-specific object corresponding to this abstraction.org.faktorips.runtime.MessageListvalidateJavaProjectBuildPath()Validates whether this project's build path is configured correctly, adding any errors to the returned list.-
Methods inherited from class org.faktorips.devtools.abstraction.plainjava.internal.PlainJavaJavaElement
getJavaProject, getPath, getResource
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.faktorips.devtools.abstraction.AJavaElement
getJavaProject, getPath, getResource
-
-
-
-
Method Detail
-
unwrap
public java.io.File 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 classAWrapper<java.io.File>- See Also:
Wrappers#unwrap(AAbstraction) for a way to unwrap potentially null abstractions.
-
getProject
public AProject getProject()
Description copied from interface:AJavaProjectReturns the corresponding project.- Specified by:
getProjectin interfaceAJavaProject
-
exists
public boolean exists()
Description copied from interface:AJavaElementA Java element exists if its corresponding resource exists and contains information for this element.- Specified by:
existsin interfaceAJavaElement- Specified by:
existsin interfaceAJavaProject- Overrides:
existsin classPlainJavaJavaElement- Returns:
- whether this element exists
-
hasBuildState
public boolean hasBuildState()
Description copied from interface:AJavaProjectReturns whether this project has previously been built and retains some information about that build.- Specified by:
hasBuildStatein interfaceAJavaProject
-
getOutputLocation
public java.nio.file.Path getOutputLocation()
Description copied from interface:AJavaProjectReturns the default output location for this project as a path relative to the containing workspace.- Specified by:
getOutputLocationin interfaceAJavaProject
-
toPackageFragmentRoot
public APackageFragmentRoot toPackageFragmentRoot(java.lang.String externalLibraryPath)
Description copied from interface:AJavaProjectReturns the package fragment root for an external library. The Path must either be a file or a folder outside of the workspace.- Specified by:
toPackageFragmentRootin interfaceAJavaProject- Parameters:
externalLibraryPath- the path to the external library, either a folder or archive file
-
toPackageFragmentRoot
public APackageFragmentRoot toPackageFragmentRoot(AResource resource)
Description copied from interface:AJavaProjectReturns theresourceas package fragment root. Every sub folder of theresourcewill be considered as java package and therefore must be excluded in the path of theresource.For example the path of the
resourcein a typical eclipse project would besrc. In a maven project the path would besrc/main/java- Specified by:
toPackageFragmentRootin interfaceAJavaProject- Parameters:
resource- the path to the root, either a folder or archive file
-
getSourceVersion
public java.lang.Runtime.Version getSourceVersion()
Description copied from interface:AJavaProjectReturns the Java version number for this project's source code.- Specified by:
getSourceVersionin interfaceAJavaProject
-
getReferencedJavaProjects
public java.util.Set<AJavaProject> getReferencedJavaProjects()
Description copied from interface:AJavaProjectReturns all other Java projects referenced by this project.- Specified by:
getReferencedJavaProjectsin interfaceAJavaProject
-
isJavaFolder
public boolean isJavaFolder(AResource resource)
Description copied from interface:AJavaProjectReturns whether the given resource is a Java folder.- Specified by:
isJavaFolderin interfaceAJavaProject
-
validateJavaProjectBuildPath
public org.faktorips.runtime.MessageList validateJavaProjectBuildPath()
Description copied from interface:AJavaProjectValidates whether this project's build path is configured correctly, adding any errors to the returned list.- Specified by:
validateJavaProjectBuildPathin interfaceAJavaProject
-
getOptions
public java.util.Map<java.lang.String,java.lang.String> getOptions()
Description copied from interface:AJavaProjectReturns the options for this project.- Specified by:
getOptionsin interfaceAJavaProject
-
getAllPackageFragmentRoots
public java.util.Set<APackageFragmentRoot> getAllPackageFragmentRoots()
Description copied from interface:AJavaProjectReturns all of the existing package fragment roots that exist on the classpath, in the order they are defined by the classpath.- Specified by:
getAllPackageFragmentRootsin interfaceAJavaProject
-
-