org.rhq.bindings.util
Class InterfaceSimplifier

java.lang.Object
  extended by org.rhq.bindings.util.InterfaceSimplifier

public class InterfaceSimplifier
extends Object

The scripts can use simplified interfaces that omit the first "Subject" argument to most methods from RHQ's remote API. This helper class prepares such simplified interfaces.

Author:
Greg Hinkle, Lukas Krejci

Method Summary
static Method getOriginalMethod(Method method)
          Returns the method on the original interface that the simplified interface with given method was generated from using the simplify(Class) method (i.e.
static boolean isSimplified(Class<?> cls)
          Determines whether given class is simplified or not.
static boolean isSimplified(Method method)
          Determines whether the method (declared on the simplified interface, i.e.
static Class<?> simplify(Class<?> intf)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getOriginalMethod

public static Method getOriginalMethod(Method method)
Returns the method on the original interface that the simplified interface with given method was generated from using the simplify(Class) method (i.e. this method is kind of reverse to the simplify(Class) method).

The returned method may or may not have different signature from the supplied method - that depends on whether the simplify(Class) simplified the method or not.

Parameters:
method - the potentially simplified method
Returns:
null if the method doesn't come from a simplified class, otherwise a method on the original interface that the supplied method was generated from.

isSimplified

public static boolean isSimplified(Class<?> cls)
Determines whether given class is simplified or not. This method will return true for any class returned from simplify(Class).

Parameters:
cls - the class
Returns:
true if the class object was created by the simplify(Class) method, false otherwise.

isSimplified

public static boolean isSimplified(Method method)
Determines whether the method (declared on the simplified interface, i.e. isSimplified(method.getDeclaringClass() returns true) has been "tampered with" by the simplifier or has been left intact.

If you want to get the original method that the supplied method corresponds to, use the getOriginalMethod(Method) method.

Parameters:
method - the potentially simplified method present on a simplified class
Returns:
true if the method's signature has been modified by the simplifier, false otherwise.

simplify

public static Class<?> simplify(Class<?> intf)


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.