public final class CommonProjectUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
J2SE_PLATFORM_TYPE
J2SE Java Platform Type.
|
Modifier and Type | Method and Description |
---|---|
static LibraryImplementation3 |
createJavaLibraryImplementation(String name,
URL[] classPath,
URL[] sources,
URL[] javadoc,
String[] mavendeps,
String[] mavenrepos)
Creates a
LibraryImplementation3 that can subsequently be used with
both Ant and Maven based Java projects. |
static JavaPlatform |
getActivePlatform(String activePlatformId)
Returns the active platform used by the project or null if the active
project platform is broken.
|
static JavaPlatform |
getActivePlatform(String activePlatformId,
String platformType)
Returns the active platform used by the project or null if the active
project platform is broken.
|
static String |
getAntPropertyName(String property)
Converts the ant reference to the name of the referenced property.
|
static String |
getBuildXmlName(PropertyEvaluator eval,
String propName)
Returns the name of the project's build script.
|
static Collection<ElementHandle<TypeElement>> |
getMainMethods(FileObject fo) |
static boolean |
hasMainMethod(FileObject fo)
Check if the given file object represents a source with the main method.
|
static boolean |
isMainClass(String className,
ClassPath bootPath,
ClassPath compilePath,
ClassPath sourcePath) |
public static final String J2SE_PLATFORM_TYPE
@CheckForNull public static JavaPlatform getActivePlatform(String activePlatformId)
activePlatformId
- the name of platform used by Ant script or null
for default platform.JavaPlatform
or null if the project's platform
is broken@CheckForNull public static JavaPlatform getActivePlatform(@NullAllowed String activePlatformId, @NullAllowed String platformType)
activePlatformId
- the name of platform used by Ant script or null
for default platform.platformType
- the type of JavaPlatform
JavaPlatform
or null if the project's platform
is brokenpublic static String getAntPropertyName(String property)
property
- the name of the referenced property.public static Collection<ElementHandle<TypeElement>> getMainMethods(FileObject fo)
public static boolean hasMainMethod(FileObject fo)
fo
- sourcepublic static boolean isMainClass(String className, ClassPath bootPath, ClassPath compilePath, ClassPath sourcePath)
@NonNull public static String getBuildXmlName(@NonNull PropertyEvaluator eval, @NullAllowed String propName)
eval
- the project's PropertyEvaluator
propName
- the name of property holding the reference to project build
script or null. In case of null the ProjectProperties.BUILD_SCRIPT
is used.public static LibraryImplementation3 createJavaLibraryImplementation(@NonNull String name, @NonNull URL[] classPath, @NonNull URL[] sources, @NonNull URL[] javadoc, @NonNull String[] mavendeps, @NonNull String[] mavenrepos)
LibraryImplementation3
that can subsequently be used with
both Ant and Maven based Java projects.classPath
- local library classpath for use by Antsources
- local library sources for use by Antjavadoc
- local Javadoc path for use by Antmavendeps
- list of maven dependencies in the form of groupId:artifactId:version:type,
for example org.eclipse.persistence:eclipselink:2.3.2:jarmavenrepos
- list of maven repositories in the form of layout:url,
for example default:http://download.eclipse.org/rt/eclipselink/maven.repo/LibraryImplementation3
representing the information passed as parameters