|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jst.ws.jaxws.core.utils.JDTUtils
public final class JDTUtils
JDT Utility class.
Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
Method Summary | |
---|---|
static void |
addToClasspath(org.eclipse.jdt.core.IJavaProject javaProject,
org.eclipse.jdt.core.IClasspathEntry classpathEntry)
Add a IClasspathEntry to a IJavaProject |
static org.eclipse.jdt.core.IType |
findType(org.eclipse.jdt.core.IJavaProject javaProject,
java.lang.String fullyQualifiedClassName)
Returns the first type found following the given java project's classpath with the given fully qualified name or null if none is found. |
static org.eclipse.jdt.core.IType |
findType(java.lang.String projectName,
java.lang.String fullyQualifiedClassName)
Returns the first type found with the given fully qualified name following the classpath of the java project with the give project name or null if none is found. |
static org.eclipse.jdt.core.IJavaProject |
getJavaProject(java.lang.String projectName)
Returns the Java project corresponding to the given project name. |
static org.eclipse.core.runtime.IPath |
getJavaProjectOutputDirectoryPath(org.eclipse.jdt.core.IJavaProject javaProject)
Returns the absolute path in the local file system of the default output location for the given java project. |
static org.eclipse.core.runtime.IPath |
getJavaProjectOutputDirectoryPath(java.lang.String projectName)
Returns the absolute path in the local file system of the default output location for the given java project name. |
static org.eclipse.core.runtime.IPath |
getJavaProjectSourceDirectoryPath(org.eclipse.jdt.core.IJavaProject javaProject)
Returns the full, absolute path relative to the workspace of the first source folder found in the given java project. |
static org.eclipse.core.runtime.IPath |
getJavaProjectSourceDirectoryPath(org.eclipse.jdt.core.IType type)
Returns the full, absolute path relative to the workspace of the source folder that contains the given type. |
static org.eclipse.core.runtime.IPath |
getJavaProjectSourceDirectoryPath(java.lang.String projectName)
Returns the full, absolute path relative to the workspace of the first source folder found in the java project with the given name. |
static org.eclipse.jdt.core.IMethod[] |
getPublicMethods(org.eclipse.jdt.core.IType type)
If the given IType is an interface all methods declared in that interface are returned. |
static java.lang.String |
getTargetNamespaceFromPackageName(java.lang.String packageName)
Constructs a target namespace string from the given package name by splitting the dot '.' separated package name, reversing the order of the package name segments followed by prefixing the string with 'http://' and appending a forward slash '/' to the end. |
static boolean |
isJavaProject(org.eclipse.core.resources.IProject project)
Returns whether the given project has the java nature. |
static boolean |
isPublicMethod(org.eclipse.jdt.core.IMethod method)
Returns true if the given method isn't a main method or constructor and if it has the public modifier. |
static void |
removeFromClasspath(org.eclipse.jdt.core.IJavaProject javaProject,
org.eclipse.jdt.core.IClasspathEntry classpathEntry)
Remove a IClasspathEntry from a IJavaProject |
static org.eclipse.core.runtime.IStatus |
validateIdentifier(java.lang.String id)
Validates the given Java identifier with the workspace source and compliance levels. |
static org.eclipse.core.runtime.IStatus |
validateJavaTypeName(java.lang.String name)
Validates the given Java type name, either simple or qualified, using the workspace source and compliance levels. |
static org.eclipse.core.runtime.IStatus |
validateJavaTypeName(java.lang.String projectName,
java.lang.String name)
Validates the given Java type name, either simple or qualified, using the given projects source and compliance levels. |
static org.eclipse.core.runtime.IStatus |
validatePackageName(java.lang.String projectName,
java.lang.String packageName)
Validate the given package name using the given projects source and compliance levels. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void addToClasspath(org.eclipse.jdt.core.IJavaProject javaProject, org.eclipse.jdt.core.IClasspathEntry classpathEntry)
IClasspathEntry
to a IJavaProject
javaProject
- the IJavaProject
to add the classpath entry toclasspathEntry
- the IClasspathEntry
to addpublic static void removeFromClasspath(org.eclipse.jdt.core.IJavaProject javaProject, org.eclipse.jdt.core.IClasspathEntry classpathEntry)
IClasspathEntry
from a IJavaProject
javaProject
- the IJavaProject
to remove the classpath entry fromclasspathEntry
- the IClasspathEntry
to removepublic static org.eclipse.jdt.core.IJavaProject getJavaProject(java.lang.String projectName)
projectName
- the project name
public static org.eclipse.core.runtime.IPath getJavaProjectOutputDirectoryPath(org.eclipse.jdt.core.IJavaProject javaProject)
javaProject
- the java project
public static org.eclipse.core.runtime.IPath getJavaProjectOutputDirectoryPath(java.lang.String projectName)
projectName
- the name of the java project
public static org.eclipse.core.runtime.IPath getJavaProjectSourceDirectoryPath(org.eclipse.jdt.core.IType type)
type
- the IType
IType
source folderpublic static org.eclipse.core.runtime.IPath getJavaProjectSourceDirectoryPath(java.lang.String projectName)
projectName
- the name of the java project
public static org.eclipse.core.runtime.IPath getJavaProjectSourceDirectoryPath(org.eclipse.jdt.core.IJavaProject javaProject)
javaProject
- the IJavaProject
public static org.eclipse.jdt.core.IMethod[] getPublicMethods(org.eclipse.jdt.core.IType type)
IType
is an interface all methods declared in that interface are returned.
Alternatively if the given given IType
is a class, only methods that are explicitly marked
public are returned.
type
- the IType
public static java.lang.String getTargetNamespaceFromPackageName(java.lang.String packageName)
E.g., the Java package Òcom.example.wsÓ would return the target namespace Òhttp://ws.example.com/Ó.
If the package name is null or is of zero length "http://default_package/" is returned.
packageName
- the package name
public static org.eclipse.jdt.core.IType findType(org.eclipse.jdt.core.IJavaProject javaProject, java.lang.String fullyQualifiedClassName)
javaProject
- the given IJavaProject
fullyQualifiedClassName
- the given fully qualified name
public static org.eclipse.jdt.core.IType findType(java.lang.String projectName, java.lang.String fullyQualifiedClassName)
projectName
- the name of the java projectfullyQualifiedClassName
- the given fully qualified name
public static boolean isJavaProject(org.eclipse.core.resources.IProject project)
project
- the given project
true
if the project has the java naturepublic static boolean isPublicMethod(org.eclipse.jdt.core.IMethod method)
method
- the given method
true
if the given method is publicpublic static org.eclipse.core.runtime.IStatus validateJavaTypeName(java.lang.String name)
name
- the name of a type
public static org.eclipse.core.runtime.IStatus validateJavaTypeName(java.lang.String projectName, java.lang.String name)
projectName
- the name of the java projectname
- the name of a type
public static org.eclipse.core.runtime.IStatus validatePackageName(java.lang.String projectName, java.lang.String packageName)
projectName
- the name of the java projectpackageName
- the name of a package
public static org.eclipse.core.runtime.IStatus validateIdentifier(java.lang.String id)
id
- the Java identifier
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |