org.jboss.metadata.lang
Class ClassHelper
java.lang.Object
org.jboss.metadata.lang.ClassHelper
public class ClassHelper
- extends Object
Useful methods on classes.
- Version:
- $Revision: 74994 $
- Author:
- Carlo de Wolf
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClassHelper
public ClassHelper()
extractInterface
public static Class<?> extractInterface(Class<?>... interfaces)
- Extracts a single interface.
- Parameters:
interfaces
-
- Returns:
- The extracted interface class. null if there are none or more interfaces
getDefaultInterface
public static Class<?> getDefaultInterface(Class<?> cls)
- Find the default interface of a class. If a class implements one interface,
that interface is considered the default interface. If it does not implement
an interface it's super class is considered. If it implements multiple
interfaces or no interface can be found an IllegalArgumentException is thrown.
- Parameters:
cls
- the class to scan
- Returns:
- the default interface as defined above
- Throws:
IllegalArgumentException
- if the class does not implement a default interface
Copyright © 2009 JBoss Inc.. All Rights Reserved.