<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_Tutorial%2FReflection%2FInterface</id>
		<title>Java Tutorial/Reflection/Interface - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_Tutorial%2FReflection%2FInterface"/>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java_Tutorial/Reflection/Interface&amp;action=history"/>
		<updated>2026-04-07T20:23:28Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://jexp.ru/index.php?title=Java_Tutorial/Reflection/Interface&amp;diff=2955&amp;oldid=prev</id>
		<title> в 17:44, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java_Tutorial/Reflection/Interface&amp;diff=2955&amp;oldid=prev"/>
				<updated>2010-05-31T17:44:26Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 17:44, 31 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://jexp.ru/index.php?title=Java_Tutorial/Reflection/Interface&amp;diff=2956&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java_Tutorial/Reflection/Interface&amp;diff=2956&amp;oldid=prev"/>
				<updated>2010-05-31T15:19:27Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==  Although the type of o2 is an interface, getSuperclass() returns the object&amp;quot;s superclass ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class Main {&lt;br /&gt;
  public static void main(String[] argv) throws Exception {&lt;br /&gt;
    Runnable o2 = new Runnable() {&lt;br /&gt;
      public void run() {&lt;br /&gt;
      }&lt;br /&gt;
    };&lt;br /&gt;
    Class sup = o2.getClass().getSuperclass(); // java.lang.Object&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Checking whether String is an interface or class ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class Main {&lt;br /&gt;
  public static void main(String[] argv) throws Exception {&lt;br /&gt;
    Class clazz = String.class;&lt;br /&gt;
    boolean isInterface = clazz.isInterface();&lt;br /&gt;
    System.out.println(&amp;quot;Is Interface = &amp;quot; + isInterface);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Get all interface and object classes that are generalizations of the provided class ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * The contents of this file are subject to the Sapient Public License&lt;br /&gt;
 * Version 1.0 (the &amp;quot;License&amp;quot;); you may not use this file except in compliance&lt;br /&gt;
 * with the License. You may obtain a copy of the License at&lt;br /&gt;
 * http://carbon.sf.net/License.html.&lt;br /&gt;
 *&lt;br /&gt;
 * Software distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; basis,&lt;br /&gt;
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for&lt;br /&gt;
 * the specific language governing rights and limitations under the License.&lt;br /&gt;
 *&lt;br /&gt;
 * The Original Code is The Carbon Component Framework.&lt;br /&gt;
 *&lt;br /&gt;
 * The Initial Developer of the Original Code is Sapient Corporation&lt;br /&gt;
 *&lt;br /&gt;
 * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
import java.util.ArrayList;&lt;br /&gt;
import java.util.Arrays;&lt;br /&gt;
import java.util.HashSet;&lt;br /&gt;
import java.util.List;&lt;br /&gt;
import java.util.Set;&lt;br /&gt;
/**&lt;br /&gt;
 *&lt;br /&gt;
 *&lt;br /&gt;
 * Copyright 2003 Sapient&lt;br /&gt;
 * @since carbon 2.0&lt;br /&gt;
 * @author Greg Hinkle, March 2003&lt;br /&gt;
 * @version $Revision: 1.5 $($Author: dvoet $ / $Date: 2003/05/05 21:21:23 $)&lt;br /&gt;
 */&lt;br /&gt;
public class ClassUtil {&lt;br /&gt;
    /**&lt;br /&gt;
     * Retrieves all interfaces implemented by a specified interface&lt;br /&gt;
     * including all recursively extended interfaces and the classes supplied&lt;br /&gt;
     * int the parameter.&lt;br /&gt;
     * @param childInterfaces a set of interfaces&lt;br /&gt;
     * @return Class[] an array of interfaces that includes those specifed&lt;br /&gt;
     * in childInterfaces plus all of those interfaces&amp;quot; super interfaces&lt;br /&gt;
     */&lt;br /&gt;
    public static Class[] getSuperInterfaces(Class[] childInterfaces) {&lt;br /&gt;
        List allInterfaces = new ArrayList();&lt;br /&gt;
        for (int i = 0; i &amp;lt; childInterfaces.length; i++) {&lt;br /&gt;
            allInterfaces.add(childInterfaces[i]);&lt;br /&gt;
            allInterfaces.addAll(&lt;br /&gt;
                Arrays.asList(&lt;br /&gt;
                    getSuperInterfaces(childInterfaces[i].getInterfaces())));&lt;br /&gt;
        }&lt;br /&gt;
        return (Class[]) allInterfaces.toArray(new Class[allInterfaces.size()]);&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Builds an &amp;lt;b&amp;gt;unordered&amp;lt;/b&amp;gt; set of all interface and object classes that&lt;br /&gt;
     * are generalizations of the provided class.&lt;br /&gt;
     * @param classObject the class to find generalization of.&lt;br /&gt;
     * @return a Set of class objects.&lt;br /&gt;
     */&lt;br /&gt;
    public static Set getGeneralizations(Class classObject) {&lt;br /&gt;
        Set generalizations = new HashSet();&lt;br /&gt;
        generalizations.add(classObject);&lt;br /&gt;
        Class superClass = classObject.getSuperclass();&lt;br /&gt;
        if (superClass != null) {&lt;br /&gt;
            generalizations.addAll(getGeneralizations(superClass));&lt;br /&gt;
        }&lt;br /&gt;
        Class[] superInterfaces = classObject.getInterfaces();&lt;br /&gt;
        for (int i = 0; i &amp;lt; superInterfaces.length; i++) {&lt;br /&gt;
            Class superInterface = superInterfaces[i];&lt;br /&gt;
            generalizations.addAll(getGeneralizations(superInterface));&lt;br /&gt;
        }&lt;br /&gt;
        return generalizations;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Get Super Interfaces ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * The contents of this file are subject to the Sapient Public License&lt;br /&gt;
 * Version 1.0 (the &amp;quot;License&amp;quot;); you may not use this file except in compliance&lt;br /&gt;
 * with the License. You may obtain a copy of the License at&lt;br /&gt;
 * http://carbon.sf.net/License.html.&lt;br /&gt;
 *&lt;br /&gt;
 * Software distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; basis,&lt;br /&gt;
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for&lt;br /&gt;
 * the specific language governing rights and limitations under the License.&lt;br /&gt;
 *&lt;br /&gt;
 * The Original Code is The Carbon Component Framework.&lt;br /&gt;
 *&lt;br /&gt;
 * The Initial Developer of the Original Code is Sapient Corporation&lt;br /&gt;
 *&lt;br /&gt;
 * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
import java.util.ArrayList;&lt;br /&gt;
import java.util.Arrays;&lt;br /&gt;
import java.util.HashSet;&lt;br /&gt;
import java.util.List;&lt;br /&gt;
import java.util.Set;&lt;br /&gt;
/**&lt;br /&gt;
 *&lt;br /&gt;
 *&lt;br /&gt;
 * Copyright 2003 Sapient&lt;br /&gt;
 * @since carbon 2.0&lt;br /&gt;
 * @author Greg Hinkle, March 2003&lt;br /&gt;
 * @version $Revision: 1.5 $($Author: dvoet $ / $Date: 2003/05/05 21:21:23 $)&lt;br /&gt;
 */&lt;br /&gt;
public class ClassUtil {&lt;br /&gt;
    /**&lt;br /&gt;
     * Retrieves all interfaces implemented by a specified interface&lt;br /&gt;
     * including all recursively extended interfaces and the classes supplied&lt;br /&gt;
     * int the parameter.&lt;br /&gt;
     * @param childInterfaces a set of interfaces&lt;br /&gt;
     * @return Class[] an array of interfaces that includes those specifed&lt;br /&gt;
     * in childInterfaces plus all of those interfaces&amp;quot; super interfaces&lt;br /&gt;
     */&lt;br /&gt;
    public static Class[] getSuperInterfaces(Class[] childInterfaces) {&lt;br /&gt;
        List allInterfaces = new ArrayList();&lt;br /&gt;
        for (int i = 0; i &amp;lt; childInterfaces.length; i++) {&lt;br /&gt;
            allInterfaces.add(childInterfaces[i]);&lt;br /&gt;
            allInterfaces.addAll(&lt;br /&gt;
                Arrays.asList(&lt;br /&gt;
                    getSuperInterfaces(childInterfaces[i].getInterfaces())));&lt;br /&gt;
        }&lt;br /&gt;
        return (Class[]) allInterfaces.toArray(new Class[allInterfaces.size()]);&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Builds an &amp;lt;b&amp;gt;unordered&amp;lt;/b&amp;gt; set of all interface and object classes that&lt;br /&gt;
     * are generalizations of the provided class.&lt;br /&gt;
     * @param classObject the class to find generalization of.&lt;br /&gt;
     * @return a Set of class objects.&lt;br /&gt;
     */&lt;br /&gt;
    public static Set getGeneralizations(Class classObject) {&lt;br /&gt;
        Set generalizations = new HashSet();&lt;br /&gt;
        generalizations.add(classObject);&lt;br /&gt;
        Class superClass = classObject.getSuperclass();&lt;br /&gt;
        if (superClass != null) {&lt;br /&gt;
            generalizations.addAll(getGeneralizations(superClass));&lt;br /&gt;
        }&lt;br /&gt;
        Class[] superInterfaces = classObject.getInterfaces();&lt;br /&gt;
        for (int i = 0; i &amp;lt; superInterfaces.length; i++) {&lt;br /&gt;
            Class superInterface = superInterfaces[i];&lt;br /&gt;
            generalizations.addAll(getGeneralizations(superInterface));&lt;br /&gt;
        }&lt;br /&gt;
        return generalizations;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  If a class object is an interface or a class ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class Main {&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    // Checking whether Cloneable is an interface or class&lt;br /&gt;
    Class clazz = Cloneable.class;&lt;br /&gt;
    boolean isInterface = clazz.isInterface();&lt;br /&gt;
    System.out.println(&amp;quot;Is Interface = &amp;quot; + isInterface);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Listing the Interfaces That a Class Implements ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class Main {&lt;br /&gt;
  public static void main(String[] argv) throws Exception {&lt;br /&gt;
    Class cls = java.lang.String.class;&lt;br /&gt;
    Class[] intfs = cls.getInterfaces();&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Listing the Interfaces That an Interface Extends ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class Main {&lt;br /&gt;
  public static void main(String[] argv) throws Exception {&lt;br /&gt;
    Class cls = java.util.List.class;&lt;br /&gt;
    Class[] intfs = cls.getInterfaces(); // java.util.Collection&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Return Returns true if type is implementing Map ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
// $Id: ReflectionHelper.java 16271 2009-04-07 20:20:12Z hardy.ferentschik $&lt;br /&gt;
/*&lt;br /&gt;
* JBoss, Home of Professional Open Source&lt;br /&gt;
* Copyright 2008, Red Hat Middleware LLC, and individual contributors&lt;br /&gt;
* by the @authors tag. See the copyright.txt in the distribution for a&lt;br /&gt;
* full listing of individual contributors.&lt;br /&gt;
*&lt;br /&gt;
* Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;quot;);&lt;br /&gt;
* you may not use this file except in compliance with the License.&lt;br /&gt;
* You may obtain a copy of the License at&lt;br /&gt;
* http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
* Unless required by applicable law or agreed to in writing, software&lt;br /&gt;
* distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; BASIS,  &lt;br /&gt;
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;br /&gt;
* See the License for the specific language governing permissions and&lt;br /&gt;
* limitations under the License.&lt;br /&gt;
*/&lt;br /&gt;
import java.beans.Introspector;&lt;br /&gt;
import java.lang.annotation.Annotation;&lt;br /&gt;
import java.lang.reflect.AccessibleObject;&lt;br /&gt;
import java.lang.reflect.Field;&lt;br /&gt;
import java.lang.reflect.InvocationTargetException;&lt;br /&gt;
import java.lang.reflect.Member;&lt;br /&gt;
import java.lang.reflect.Method;&lt;br /&gt;
import java.lang.reflect.Modifier;&lt;br /&gt;
import java.lang.reflect.ParameterizedType;&lt;br /&gt;
import java.lang.reflect.Type;&lt;br /&gt;
import java.lang.reflect.WildcardType;&lt;br /&gt;
import java.util.ArrayList;&lt;br /&gt;
import java.util.Arrays;&lt;br /&gt;
import java.util.Iterator;&lt;br /&gt;
import java.util.List;&lt;br /&gt;
import java.util.Map;&lt;br /&gt;
/**&lt;br /&gt;
 * Some reflection utility methods.&lt;br /&gt;
 *&lt;br /&gt;
 * @author Hardy Ferentschik&lt;br /&gt;
 */&lt;br /&gt;
public class ReflectionHelper {&lt;br /&gt;
  /**&lt;br /&gt;
   * @param type the type to check.&lt;br /&gt;
   *&lt;br /&gt;
   * @return Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; is implementing &amp;lt;code&amp;gt;Map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
   */&lt;br /&gt;
  public static boolean isMap(Type type) {&lt;br /&gt;
    if ( type instanceof Class &amp;amp;&amp;amp; isMapClass( ( Class ) type ) ) {&lt;br /&gt;
      return true;&lt;br /&gt;
    }&lt;br /&gt;
    if ( type instanceof ParameterizedType ) {&lt;br /&gt;
      return isMap( ( ( ParameterizedType ) type ).getRawType() );&lt;br /&gt;
    }&lt;br /&gt;
    if ( type instanceof WildcardType ) {&lt;br /&gt;
      Type[] upperBounds = ( ( WildcardType ) type ).getUpperBounds();&lt;br /&gt;
      return upperBounds.length != 0 &amp;amp;&amp;amp; isMap( upperBounds[0] );&lt;br /&gt;
    }&lt;br /&gt;
    return false;&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Checks whether the specified class parameter is an instance of a collection class.&lt;br /&gt;
   *&lt;br /&gt;
   * @param clazz &amp;lt;code&amp;gt;Class&amp;lt;/code&amp;gt; to check.&lt;br /&gt;
   *&lt;br /&gt;
   * @return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;clazz&amp;lt;/code&amp;gt; is instance of a collection class, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
   */&lt;br /&gt;
  private static boolean isMapClass(Class&amp;lt;?&amp;gt; clazz) {&lt;br /&gt;
    List&amp;lt;Class&amp;lt;?&amp;gt;&amp;gt; classes = new ArrayList&amp;lt;Class&amp;lt;?&amp;gt;&amp;gt;();&lt;br /&gt;
    computeClassHierarchy( clazz, classes );&lt;br /&gt;
    return classes.contains( Map.class );&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Get all superclasses and interfaces recursively.&lt;br /&gt;
   *&lt;br /&gt;
   * @param clazz The class to start the search with.&lt;br /&gt;
   * @param classes List of classes to which to add all found super classes and interfaces.&lt;br /&gt;
   */&lt;br /&gt;
  private static void computeClassHierarchy(Class&amp;lt;?&amp;gt; clazz, List&amp;lt;Class&amp;lt;?&amp;gt;&amp;gt; classes) {&lt;br /&gt;
    for ( Class current = clazz; current != null; current = current.getSuperclass() ) {&lt;br /&gt;
      if ( classes.contains( current ) ) {&lt;br /&gt;
        return;&lt;br /&gt;
      }&lt;br /&gt;
      classes.add( current );&lt;br /&gt;
      for ( Class currentInterface : current.getInterfaces() ) {&lt;br /&gt;
        computeClassHierarchy( currentInterface, classes );&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Returns true if a class implements Serializable and false otherwise. ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
import java.io.Serializable;&lt;br /&gt;
/* &lt;br /&gt;
 * JCommon : a free general purpose class library for the Java(tm) platform&lt;br /&gt;
 * &lt;br /&gt;
 *&lt;br /&gt;
 * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.&lt;br /&gt;
 * &lt;br /&gt;
 * Project Info:  http://www.jfree.org/jcommon/index.html&lt;br /&gt;
 *&lt;br /&gt;
 * This library is free software; you can redistribute it and/or modify it &lt;br /&gt;
 * under the terms of the GNU Lesser General Public License as published by &lt;br /&gt;
 * the Free Software Foundation; either version 2.1 of the License, or &lt;br /&gt;
 * (at your option) any later version.&lt;br /&gt;
 *&lt;br /&gt;
 * This library is distributed in the hope that it will be useful, but &lt;br /&gt;
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY &lt;br /&gt;
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public &lt;br /&gt;
 * License for more details.&lt;br /&gt;
 *&lt;br /&gt;
 * You should have received a copy of the GNU Lesser General Public&lt;br /&gt;
 * License along with this library; if not, write to the Free Software&lt;br /&gt;
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, &lt;br /&gt;
 * USA.  &lt;br /&gt;
 *&lt;br /&gt;
 * [Java is a trademark or registered trademark of Sun Microsystems, Inc. &lt;br /&gt;
 * in the United States and other countries.]&lt;br /&gt;
 * &lt;br /&gt;
 * ------------&lt;br /&gt;
 * IOUtils.java&lt;br /&gt;
 * ------------&lt;br /&gt;
 * (C)opyright 2002-2004, by Thomas Morgner and Contributors.&lt;br /&gt;
 *&lt;br /&gt;
 * Original Author:  Thomas Morgner;&lt;br /&gt;
 * Contributor(s):   David Gilbert (for Object Refinery Limited);&lt;br /&gt;
 *&lt;br /&gt;
 * $Id: IOUtils.java,v 1.8 2009/01/22 08:34:58 taqua Exp $&lt;br /&gt;
 *&lt;br /&gt;
 * Changes&lt;br /&gt;
 * -------&lt;br /&gt;
 * 26-Jan-2003 : Initial version&lt;br /&gt;
 * 23-Feb-2003 : Documentation&lt;br /&gt;
 * 25-Feb-2003 : Fixed Checkstyle issues (DG);&lt;br /&gt;
 * 29-Apr-2003 : Moved to jcommon&lt;br /&gt;
 * 04-Jan-2004 : Fixed JDK 1.2.2 issues with createRelativeURL;&lt;br /&gt;
 *               added support for query strings within these urls (TM);&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
public class Main {&lt;br /&gt;
  /**&lt;br /&gt;
   * Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if a class implements &amp;lt;code&amp;gt;Serializable&amp;lt;/code&amp;gt;&lt;br /&gt;
   * and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
   *&lt;br /&gt;
   * @param c  the class.&lt;br /&gt;
   *&lt;br /&gt;
   * @return A boolean.&lt;br /&gt;
   */&lt;br /&gt;
  public static boolean isSerializable(final Class c) {&lt;br /&gt;
      /**&lt;br /&gt;
      final Class[] interfaces = c.getInterfaces();&lt;br /&gt;
      for (int i = 0; i &amp;lt; interfaces.length; i++) {&lt;br /&gt;
          if (interfaces[i].equals(Serializable.class)) {&lt;br /&gt;
              return true;&lt;br /&gt;
          }&lt;br /&gt;
      }&lt;br /&gt;
      Class cc = c.getSuperclass();&lt;br /&gt;
      if (cc != null) {&lt;br /&gt;
          return isSerializable(cc);&lt;br /&gt;
      }&lt;br /&gt;
       */&lt;br /&gt;
      return (Serializable.class.isAssignableFrom(c));&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  The interfaces for a primitive type is an empty array ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class Main {&lt;br /&gt;
  public static void main(String[] argv) throws Exception {&lt;br /&gt;
    Class cls = int.class;&lt;br /&gt;
    Class[] intfs = cls.getInterfaces(); // []&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  The superclass of interfaces is always null ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class Main {&lt;br /&gt;
  public static void main(String[] argv) throws Exception {&lt;br /&gt;
    Class cls = java.lang.Cloneable.class;&lt;br /&gt;
    Class sup = cls.getSuperclass(); // null&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>