KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > java > lang > Package

java.lang
Class Package

java.lang.Object
  extended by java.lang.Package
All Implemented Interfaces:
AnnotatedElement
See Also:
Top Examples, Source Code, Character.isDigit(char), isCompatibleWith, ClassLoader.definePackage(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String java.net.URL)

public <A extends Annotation> A getAnnotation(Class<A> annotationClass)
See Also:
AnnotatedElement
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Annotation[] getAnnotations()
See Also:
AnnotatedElement
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Annotation[] getDeclaredAnnotations()
See Also:
AnnotatedElement
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public String getImplementationTitle()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public String getImplementationVendor()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public String getImplementationVersion()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public String getName()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Package getPackage(String name)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Package[] getPackages()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[1522]Find possible class names
By Anonymous on 2005/08/25 12:14:18  Rate
/** 
  * Answers a list of all possible fully-qualified class names for the 
  * given short class name, based on the packages known by thecaller's 
  * ClassLoader. 
  *  < P/ >  
  * @param aShortClassName the given short class name  ( no package prefix! )  
  * @return a list of fully qualified class names that match the given short 
  * class name 
  **/
 
 public List findPossibleClassNames ( String aShortClassName )  
  {  
     List possibleClassNames; 
     ClassLoader loader; 
     Package [  ]    packages; 
     String fullClassName; 
     Class possibleClass; 
      
     possibleClassNames = new ArrayList (  ) ; 
      
     // get all the packages the current loader knows about 
     packages = Package.getPackages (  ) ; 
     // get this class's loader  
     loader = this.getClass (  ) .getClassLoader (  ) ; 
  >   
     // try to find your class in these packages... 
     for  ( int i=0; i  <  packages.length; i++ )  
      {  
         fullClassName = packages [ i ] .getName (  )  + "." + aShortClassName; 
         System.out.println ( "Trying: " + fullClassName ) ; 
         try 
          {  
             possibleClass = loader.loadClass ( fullClassName ) ; 
             possibleClassNames.add (  possibleClass.getName (  )   ) ; 
          }  
         catch ( ClassNotFoundException cnf )  
          {  
             // no biggie, try the next one... 
          }  
      }  
      
     return possibleClassNames; 
  } 


public String getSpecificationTitle()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public String getSpecificationVendor()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public String getSpecificationVersion()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int hashCode()
See Also:
Hashtable, Object.equals(java.lang.Object)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
See Also:
AnnotatedElement
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public boolean isCompatibleWith(String desired)
                         throws NumberFormatException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public boolean isSealed()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public boolean isSealed(URL url)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public String toString()
See Also:
Object
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags