|
Forge - Parent 1.2.2-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)
Deprecated. |
JavaResource |
getEnumTypeResource(String relativePath)
Deprecated. Use the getJavaResource |
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 DirectoryResources 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)
Deprecated. use saveJavaSource(JavaSource) |
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()
JavaSourceFacetDirectoryResources this project uses to contain Project source documents (such as
.java files.)
getSourceFolders in interface JavaSourceFacetpublic String calculateName(JavaResource resource)
JavaSourceFacetJavaResource whether it exists or not.
calculateName in interface JavaSourceFacetpublic String calculatePackage(JavaResource resource)
JavaSourceFacetJavaResource whether it exists or not.
calculatePackage in interface JavaSourceFacetpublic String getBasePackage()
JavaSourceFacetPackage for this project, returned as a String
getBasePackage in interface JavaSourceFacetpublic DirectoryResource getBasePackageResource()
JavaSourceFacetPackage for this project, returned as a directory File
getBasePackageResource in interface JavaSourceFacetpublic DirectoryResource getSourceFolder()
JavaSourceFacetDirectoryResource this Project uses to store package-able source documents (such as .java
files.)
getSourceFolder in interface JavaSourceFacetpublic DirectoryResource getTestSourceFolder()
JavaSourceFacetDirectoryResource 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 JavaSourceFacetpublic boolean isInstalled()
FacetFacet is available for the given Project, false if otherwise.
isInstalled in interface Facetpublic boolean install()
FacetFacet 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
JavaSourceFacetJavaClass 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 JavaSourceFacetjavaClass - The JavaClass to re-parse.
FileNotFoundException - if the target JavaResource does not exist
@Deprecated
public JavaResource getEnumTypeResource(JavaEnum javaEnum)
throws FileNotFoundException
JavaSourceFacetJavaEnum 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 JavaSourceFacetFileNotFoundException - if the target JavaResource does not exist
public JavaResource getTestJavaResource(JavaSource<?> javaClass)
throws FileNotFoundException
JavaSourceFacetJavaClass 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 JavaSourceFacetjavaClass - The JavaClass to re-parse.
FileNotFoundException - if the target JavaResource does not exist
public JavaResource getJavaResource(String relativePath)
throws FileNotFoundException
JavaSourceFacetJavaClass at the given path relative to JavaSourceFacet.getSourceFolder().
getJavaResource in interface JavaSourceFacetrelativePath - The file or package path of the target Java source file.
FileNotFoundException - if the target JavaResource does not exist
@Deprecated
public JavaResource getEnumTypeResource(String relativePath)
throws FileNotFoundException
JavaSourceFacetJavaEnum at the given path relative to JavaSourceFacet.getSourceFolder().
getEnumTypeResource in interface JavaSourceFacetrelativePath - The file or package path of the target Java source file.
FileNotFoundException - if the target JavaResource does not exist
public JavaResource getTestJavaResource(String relativePath)
throws FileNotFoundException
JavaSourceFacetJavaClass at the given path relative to JavaSourceFacet.getTestSourceFolder().
getTestJavaResource in interface JavaSourceFacetrelativePath - The package path of the target Java source JavaResource.
FileNotFoundException
public JavaResource saveJavaSource(JavaSource<?> source)
throws FileNotFoundException
JavaSourceFacetJavaSourceFacet.getSourceFolder() - use information in the
given JavaSource to determine the appropriate package; packages will be created if necessary.
saveJavaSource in interface JavaSourceFacetsource - The java class to create
JavaResource
FileNotFoundException
@Deprecated
public JavaResource saveEnumTypeSource(JavaEnum source)
throws FileNotFoundException
saveJavaSource(JavaSource)
JavaSourceFacetJavaSourceFacet.getSourceFolder() - use information in the
given JavaEnum to determine the appropriate package; packages will be created if necessary.
saveEnumTypeSource in interface JavaSourceFacetsource - The java enum type to create
EnumTypeResource
FileNotFoundException
public JavaResource saveTestJavaSource(JavaSource<?> source)
throws FileNotFoundException
JavaSourceFacetJavaSourceFacet.getTestSourceFolder() - use
information in the given JavaSource to determine the appropriate package; packages will be created if
necessary.
saveTestJavaSource in interface JavaSourceFacetsource - The java class to create
JavaResource
FileNotFoundExceptionpublic void visitJavaSources(JavaResourceVisitor visitor)
JavaSourceFacet
visitJavaSources in interface JavaSourceFacetvisitor - The JavaResourceVisitor that processes all the found java files. Cannot be null.public void visitJavaTestSources(JavaResourceVisitor visitor)
JavaSourceFacet
visitJavaTestSources in interface JavaSourceFacetvisitor - The JavaResourceVisitor that processes all the found java files. Cannot be null.
|
Forge - Parent 1.2.2-SNAPSHOT | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||