Package de.loskutov.anyedit.jdt
Class TypeFactory
- java.lang.Object
-
- de.loskutov.anyedit.jdt.TypeFactory
-
public class TypeFactory extends java.lang.Object
Replacement for TypeInfoFactory which is internal in 3.2 and removed or partly not more accessible in 3.3. The class contains a limited features subset from original one
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
TypeFactory.IFileTypeInfo
private static class
TypeFactory.JarFileEntryTypeInfo
-
Field Summary
Fields Modifier and Type Field Description private char[][]
enclosingNames
(package private) static char
EXTENSION_SEPARATOR
private java.lang.String[]
fProjects
(package private) static char
PACKAGE_PART_SEPARATOR
(package private) static char
SEPARATOR
private java.lang.String
simpleTypeName
-
Constructor Summary
Constructors Constructor Description TypeFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.jdt.core.IType
create(char[] packageName, char[] simpleTypeName1, char[][] enclosingName, int modifiers, java.lang.String path, org.eclipse.jdt.core.search.IJavaSearchScope searchScope, boolean found)
Will be called at most two times if the return value was not null.private org.eclipse.jdt.core.IType
createIFileTypeInfo(java.lang.String packageName, java.lang.String typeName, char[][] enclosingName, int modifiers, java.lang.String path, java.lang.String project, org.eclipse.jdt.core.search.IJavaSearchScope searchScope)
protected org.eclipse.jdt.core.IType
createJarFileEntryTypeInfo(java.lang.String packageName, java.lang.String typeName, char[][] enclosingName, int modifiers, java.lang.String path, int index, org.eclipse.jdt.core.search.IJavaSearchScope searchScope)
private static org.eclipse.jdt.core.IType
findTypeInCompilationUnit(org.eclipse.jdt.core.ICompilationUnit cu, java.lang.String typeQualifiedName)
Finds a type in a compilation unit.private java.lang.String
getProject(java.lang.String path)
private static java.lang.String[]
getProjectList()
private org.eclipse.jdt.core.IType
getType(org.eclipse.jdt.core.search.IJavaSearchScope searchScope, org.eclipse.jdt.core.IJavaElement container)
java.lang.String
getTypeQualifiedName()
private static java.lang.String
getTypeQualifiedName(org.eclipse.jdt.core.IType type)
Returns the qualified type name of the given type using '.' as separators.
-
-
-
Field Detail
-
SEPARATOR
static final char SEPARATOR
- See Also:
- Constant Field Values
-
EXTENSION_SEPARATOR
static final char EXTENSION_SEPARATOR
- See Also:
- Constant Field Values
-
PACKAGE_PART_SEPARATOR
static final char PACKAGE_PART_SEPARATOR
- See Also:
- Constant Field Values
-
fProjects
private final java.lang.String[] fProjects
-
enclosingNames
private char[][] enclosingNames
-
simpleTypeName
private java.lang.String simpleTypeName
-
-
Method Detail
-
getType
private org.eclipse.jdt.core.IType getType(org.eclipse.jdt.core.search.IJavaSearchScope searchScope, org.eclipse.jdt.core.IJavaElement container)
-
getTypeQualifiedName
public java.lang.String getTypeQualifiedName()
-
create
public org.eclipse.jdt.core.IType create(char[] packageName, char[] simpleTypeName1, char[][] enclosingName, int modifiers, java.lang.String path, org.eclipse.jdt.core.search.IJavaSearchScope searchScope, boolean found)
Will be called at most two times if the return value was not null.- Parameters:
searchScope
-found
- true if we do not really need a second type, if second exists, we could just return any non-null value.
-
createIFileTypeInfo
private org.eclipse.jdt.core.IType createIFileTypeInfo(java.lang.String packageName, java.lang.String typeName, char[][] enclosingName, int modifiers, java.lang.String path, java.lang.String project, org.eclipse.jdt.core.search.IJavaSearchScope searchScope)
-
createJarFileEntryTypeInfo
protected org.eclipse.jdt.core.IType createJarFileEntryTypeInfo(java.lang.String packageName, java.lang.String typeName, char[][] enclosingName, int modifiers, java.lang.String path, int index, org.eclipse.jdt.core.search.IJavaSearchScope searchScope)
-
getProject
private java.lang.String getProject(java.lang.String path)
-
getProjectList
private static java.lang.String[] getProjectList()
-
getTypeQualifiedName
private static java.lang.String getTypeQualifiedName(org.eclipse.jdt.core.IType type)
Returns the qualified type name of the given type using '.' as separators. This is a replace for IType.getTypeQualifiedName() which uses '$' as separators. As '$' is also a valid character in an id this is ambiguous. JavaCore PR: 1GCFUNT
-
findTypeInCompilationUnit
private static org.eclipse.jdt.core.IType findTypeInCompilationUnit(org.eclipse.jdt.core.ICompilationUnit cu, java.lang.String typeQualifiedName) throws org.eclipse.jdt.core.JavaModelException
Finds a type in a compilation unit. Typical usage is to find the corresponding type in a working copy.- Parameters:
cu
- the compilation unit to search intypeQualifiedName
- the type qualified name (type name with enclosing type names (separated by dots))- Returns:
- the type found, or null if not existing
- Throws:
org.eclipse.jdt.core.JavaModelException
-
-