|
Forge - Parent 1.0.6-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.forge.project.facets.BaseFacet
org.jboss.forge.maven.facets.MavenJavaSourceFacet
@Dependent @Alias(value="forge.maven.JavaSourceFacet") @RequiresFacet(value=MavenCoreFacet.class) public class MavenJavaSourceFacet
Field Summary |
---|
Fields inherited from class org.jboss.forge.project.facets.BaseFacet |
---|
project |
Constructor Summary | |
---|---|
MavenJavaSourceFacet()
|
Method Summary | |
---|---|
String |
calculateName(JavaResource resource)
Return the class name for the given JavaResource whether it exists or not. |
String |
calculatePackage(JavaResource resource)
Return the package for the given JavaResource whether it exists or not. |
String |
getBasePackage()
Return the base Java Package for this project, returned as a String |
DirectoryResource |
getBasePackageResource()
Return the base Java Package for this project, returned as a directory File |
JavaResource |
getEnumTypeResource(JavaEnum javaEnum)
Attempt to locate and re-parse the given JavaEnum from its location on disk, relative to
JavaSourceFacet.getSourceFolder() . |
JavaResource |
getEnumTypeResource(String relativePath)
Return the JavaEnum at the given path relative to JavaSourceFacet.getSourceFolder() . |
JavaResource |
getJavaResource(JavaSource<?> javaClass)
Attempt to locate and re-parse the given JavaClass from its location on disk, relative to
JavaSourceFacet.getSourceFolder() . |
JavaResource |
getJavaResource(String relativePath)
Return the JavaClass at the given path relative to JavaSourceFacet.getSourceFolder() . |
DirectoryResource |
getSourceFolder()
Get the DirectoryResource this Project uses to store package-able source documents (such as .java
files.) |
List<DirectoryResource> |
getSourceFolders()
Get a list of DirectoryResource s this project uses to contain Project source documents (such as
.java files.) |
JavaResource |
getTestJavaResource(JavaSource<?> javaClass)
Attempt to locate and re-parse the given JavaClass from its location on disk, relative to
JavaSourceFacet.getTestSourceFolder() . |
JavaResource |
getTestJavaResource(String relativePath)
Return the JavaClass at the given path relative to JavaSourceFacet.getTestSourceFolder() . |
DirectoryResource |
getTestSourceFolder()
Get the DirectoryResource this Project uses to store test-scoped source documents (such as .java
files.) Files in this directory will never be packaged or deployed except when running Unit Tests. |
boolean |
install()
Perform necessary setup for this Facet to be considered installed in the given Project . |
boolean |
isInstalled()
Return true if the Facet is available for the given Project , false if otherwise. |
JavaResource |
saveEnumTypeSource(JavaEnum source)
Create or update a Java file in the primary source directory: JavaSourceFacet.getSourceFolder() - use information in the
given JavaEnum to determine the appropriate package; packages will be created if necessary. |
JavaResource |
saveJavaSource(JavaSource<?> source)
Create or update a Java file in the primary source directory: JavaSourceFacet.getSourceFolder() - use information in the
given JavaSource to determine the appropriate package; packages will be created if necessary. |
JavaResource |
saveTestJavaSource(JavaSource<?> source)
Create or update a Java file in the primary test source directory: JavaSourceFacet.getTestSourceFolder() - use
information in the given JavaSource to determine the appropriate package; packages will be created if
necessary. |
void |
visitJavaSources(JavaResourceVisitor visitor)
Recursively loops over all the source directories and for each java file it finds, calls the visitor. |
void |
visitJavaTestSources(JavaResourceVisitor visitor)
Recursively loops over all the test source directories and for each java file it finds, calls the visitor. |
Methods inherited from class org.jboss.forge.project.facets.BaseFacet |
---|
equals, getProject, hashCode, setProject, uninstall |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.forge.project.Facet |
---|
getProject, setProject, uninstall |
Constructor Detail |
---|
public MavenJavaSourceFacet()
Method Detail |
---|
public List<DirectoryResource> getSourceFolders()
JavaSourceFacet
DirectoryResource
s this project uses to contain Project
source documents (such as
.java files.)
getSourceFolders
in interface JavaSourceFacet
public String calculateName(JavaResource resource)
JavaSourceFacet
JavaResource
whether it exists or not.
calculateName
in interface JavaSourceFacet
public String calculatePackage(JavaResource resource)
JavaSourceFacet
JavaResource
whether it exists or not.
calculatePackage
in interface JavaSourceFacet
public String getBasePackage()
JavaSourceFacet
Package
for this project, returned as a String
getBasePackage
in interface JavaSourceFacet
public DirectoryResource getBasePackageResource()
JavaSourceFacet
Package
for this project, returned as a directory File
getBasePackageResource
in interface JavaSourceFacet
public DirectoryResource getSourceFolder()
JavaSourceFacet
DirectoryResource
this Project
uses to store package-able source documents (such as .java
files.)
getSourceFolder
in interface JavaSourceFacet
public DirectoryResource getTestSourceFolder()
JavaSourceFacet
DirectoryResource
this Project
uses to store test-scoped source documents (such as .java
files.) Files in this directory will never be packaged or deployed except when running Unit Tests.
getTestSourceFolder
in interface JavaSourceFacet
public boolean isInstalled()
Facet
Facet
is available for the given Project
, false if otherwise.
isInstalled
in interface Facet
public boolean install()
Facet
Facet
to be considered installed in the given Project
. This
method should NOT register the facet; facet registration is handled by the project if installation is successful.
install
in interface Facet
public JavaResource getJavaResource(JavaSource<?> javaClass) throws FileNotFoundException
JavaSourceFacet
JavaClass
from its location on disk, relative to
JavaSourceFacet.getSourceFolder()
. The given instance will not be modified, and a new instance will be returned.
getJavaResource
in interface JavaSourceFacet
javaClass
- The JavaClass
to re-parse.
FileNotFoundException
- if the target JavaResource
does not existpublic JavaResource getEnumTypeResource(JavaEnum javaEnum) throws FileNotFoundException
JavaSourceFacet
JavaEnum
from its location on disk, relative to
JavaSourceFacet.getSourceFolder()
. The given instance will not be modified, and a new instance will be returned.
getEnumTypeResource
in interface JavaSourceFacet
FileNotFoundException
- if the target JavaResource
does not existpublic JavaResource getTestJavaResource(JavaSource<?> javaClass) throws FileNotFoundException
JavaSourceFacet
JavaClass
from its location on disk, relative to
JavaSourceFacet.getTestSourceFolder()
. The given instance will not be modified, and a new instance will be returned.
getTestJavaResource
in interface JavaSourceFacet
javaClass
- The JavaClass
to re-parse.
FileNotFoundException
- if the target JavaResource
does not existpublic JavaResource getJavaResource(String relativePath) throws FileNotFoundException
JavaSourceFacet
JavaClass
at the given path relative to JavaSourceFacet.getSourceFolder()
.
getJavaResource
in interface JavaSourceFacet
relativePath
- The file or package path of the target Java source file.
FileNotFoundException
- if the target JavaResource
does not existpublic JavaResource getEnumTypeResource(String relativePath) throws FileNotFoundException
JavaSourceFacet
JavaEnum
at the given path relative to JavaSourceFacet.getSourceFolder()
.
getEnumTypeResource
in interface JavaSourceFacet
relativePath
- The file or package path of the target Java source file.
FileNotFoundException
- if the target JavaResource
does not existpublic JavaResource getTestJavaResource(String relativePath) throws FileNotFoundException
JavaSourceFacet
JavaClass
at the given path relative to JavaSourceFacet.getTestSourceFolder()
.
getTestJavaResource
in interface JavaSourceFacet
relativePath
- The package path of the target Java source JavaResource
.
FileNotFoundException
public JavaResource saveJavaSource(JavaSource<?> source) throws FileNotFoundException
JavaSourceFacet
JavaSourceFacet.getSourceFolder()
- use information in the
given JavaSource
to determine the appropriate package; packages will be created if necessary.
saveJavaSource
in interface JavaSourceFacet
source
- The java class to create
JavaResource
FileNotFoundException
public JavaResource saveEnumTypeSource(JavaEnum source) throws FileNotFoundException
JavaSourceFacet
JavaSourceFacet.getSourceFolder()
- use information in the
given JavaEnum
to determine the appropriate package; packages will be created if necessary.
saveEnumTypeSource
in interface JavaSourceFacet
source
- The java enum type to create
EnumTypeResource
FileNotFoundException
public JavaResource saveTestJavaSource(JavaSource<?> source) throws FileNotFoundException
JavaSourceFacet
JavaSourceFacet.getTestSourceFolder()
- use
information in the given JavaSource
to determine the appropriate package; packages will be created if
necessary.
saveTestJavaSource
in interface JavaSourceFacet
source
- The java class to create
JavaResource
FileNotFoundException
public void visitJavaSources(JavaResourceVisitor visitor)
JavaSourceFacet
visitJavaSources
in interface JavaSourceFacet
visitor
- The JavaResourceVisitor
that processes all the found java files. Cannot be null.public void visitJavaTestSources(JavaResourceVisitor visitor)
JavaSourceFacet
visitJavaTestSources
in interface JavaSourceFacet
visitor
- The JavaResourceVisitor
that processes all the found java files. Cannot be null.
|
Forge - Parent 1.0.6-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |