Class 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
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • fProjects

        private final java.lang.String[] fProjects
      • enclosingNames

        private char[][] enclosingNames
      • simpleTypeName

        private java.lang.String simpleTypeName
    • Constructor Detail

      • TypeFactory

        public TypeFactory()
    • 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 in
        typeQualifiedName - 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