Tabnine Logo
CachedMethod.find
Code IndexAdd Tabnine to your IDE (free)

How to use
find
method
in
org.codehaus.groovy.reflection.CachedMethod

Best Java code snippets using org.codehaus.groovy.reflection.CachedMethod.find (Showing top 20 results out of 315)

origin: org.codehaus.groovy/groovy

  CachedMethod cachedGetter = CachedMethod.find(method);
  getter = cachedGetter == null ? null : findMethod(cachedGetter);
} else {
method = pd.getWriteMethod();
if (method != null) {
  CachedMethod cachedSetter = CachedMethod.find(method);
  setter = cachedSetter == null ? null : findMethod(cachedSetter);
} else {
origin: groovy/groovy-core

  protected NewInstanceMetaMethod createNewMetaMethod(Method method) {
    return new NewInstanceMetaMethod(CachedMethod.find(method));
  }
}
origin: org.codehaus.groovy/groovy

Method[] listenerMethods = descriptor.getListenerMethods();
for (Method listenerMethod : listenerMethods) {
  final MetaMethod metaMethod = CachedMethod.find(descriptor.getAddListenerMethod());
origin: org.codehaus.groovy/groovy

/**
 *Adds a static method to this metaclass.
 *
 * @param method The method to be added
 */
public void addNewStaticMethod(Method method) {
  final CachedMethod cachedMethod = CachedMethod.find(method);
  NewStaticMetaMethod newMethod = new NewStaticMetaMethod(cachedMethod);
  final CachedClass declaringClass = newMethod.getDeclaringClass();
  addNewStaticMethodToIndex(newMethod, metaMethodIndex.getHeader(declaringClass.getTheClass()));
}
origin: org.codehaus.groovy/groovy

/**
 *Adds an instance method to this metaclass.
 *
 * @param method The method to be added
 */
public void addNewInstanceMethod(Method method) {
  final CachedMethod cachedMethod = CachedMethod.find(method);
  NewInstanceMetaMethod newMethod = new NewInstanceMetaMethod(cachedMethod);
  final CachedClass declaringClass = newMethod.getDeclaringClass();
  addNewInstanceMethodToIndex(newMethod, metaMethodIndex.getHeader(declaringClass.getTheClass()));
}
origin: groovy/groovy-core

  static void doIt () {

    new A ().protectedMethod();

    try {
      CachedMethod m = CachedMethod.find(A.class.getDeclaredMethod("protectedMethod", new Class [0] ));
      Object[] arguments = new Object[0];
      m.setAccessible().invoke(new A(), arguments);
    } catch (NoSuchMethodException e) {
    } catch (IllegalAccessException e) {
    } catch (InvocationTargetException e) {
    }
  }
}
origin: org.codehaus.groovy/groovy-all-minimal

public static ParameterTypes getParameterTypes(Object methodOrConstructor) {
  if (methodOrConstructor instanceof ParameterTypes) {
    return (ParameterTypes) methodOrConstructor;
  }
  if (methodOrConstructor instanceof Method) {
    Method method = (Method) methodOrConstructor;
    return CachedMethod.find(method);
  }
  if (methodOrConstructor instanceof Constructor) {
    Constructor constructor = (Constructor) methodOrConstructor;
    return CachedConstructor.find(constructor);
  }
  throw new IllegalArgumentException("Must be a Method or Constructor");
}
origin: org.codehaus.groovy/groovy-all-minimal

private void applyPropertyDescriptors(PropertyDescriptor[] propertyDescriptors) {
  // now iterate over the map of property descriptors and generate
  // MetaBeanProperty objects
  for (int i = 0; i < propertyDescriptors.length; i++) {
    PropertyDescriptor pd = propertyDescriptors[i];
    // skip if the property type is unknown (this seems to be the case if the
    // property descriptor is based on a setX() method that has two parameters,
    // which is not a valid property)
    if (pd.getPropertyType() == null)
      continue;
    // get the getter method
    Method method = pd.getReadMethod();
    MetaMethod getter;
    if (method != null)
      getter = findMethod(CachedMethod.find(method));
    else
      getter = null;
    // get the setter method
    MetaMethod setter;
    method = pd.getWriteMethod();
    if (method != null)
      setter = findMethod(CachedMethod.find(method));
    else
      setter = null;
    // now create the MetaProperty object
    MetaBeanProperty mp = new MetaBeanProperty(pd.getName(), pd.getPropertyType(), getter, setter);
    addMetaBeanProperty(mp);
  }
}
origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

  CachedMethod cachedGetter = CachedMethod.find(method);
  getter = cachedGetter == null ? null : findMethod(cachedGetter);
} else {
method = pd.getWriteMethod();
if (method != null) {
  CachedMethod cachedSetter = CachedMethod.find(method);
  setter = cachedSetter == null ? null : findMethod(cachedSetter);
} else {
origin: org.codehaus.groovy/groovy-jdk14

  CachedMethod cachedGetter = CachedMethod.find(method);
  getter = cachedGetter == null ? null : findMethod(cachedGetter);
} else {
method = pd.getWriteMethod();
if (method != null) {
  CachedMethod cachedSetter = CachedMethod.find(method);
  setter = cachedSetter == null ? null : findMethod(cachedSetter);
} else {
origin: org.kohsuke.droovy/groovy

  CachedMethod cachedGetter = CachedMethod.find(method);
  getter = cachedGetter == null ? null : findMethod(cachedGetter);
} else {
method = pd.getWriteMethod();
if (method != null) {
  CachedMethod cachedSetter = CachedMethod.find(method);
  setter = cachedSetter == null ? null : findMethod(cachedSetter);
} else {
origin: org.codehaus.groovy/groovy-all-minimal

/**
 * Delegated to from the global use(CategoryClass) method.  It scans the Category class for static methods
 * that take 1 or more parameters.  The first parameter is the class you are adding the category method to,
 * additional parameters are those parameters needed by that method.  A use statement cannot be undone and
 * is valid only for the current thread.
 *
 * @param categoryClass the class containing category methods
 */
private static void use(Class categoryClass) {
  Map properties = getProperties();
  List stack = (List) LOCAL.get();
  LinkedList clonedLists = new LinkedList();
  
  Method[] methods = categoryClass.getMethods();
  for (int i = 0; i < methods.length; i++) {
    Method method = methods[i];
    if (Modifier.isStatic(method.getModifiers())) {
      final CachedMethod cachedMethod = CachedMethod.find(method);
      CachedClass[] paramTypes = cachedMethod.getParameterTypes();
      if (paramTypes.length > 0) {
        CachedClass metaClass = paramTypes[0];
        Map metaMethodsMap = getMetaMethods(properties, metaClass.getTheClass());
        List methodList = getMethodList(metaMethodsMap, method.getName());
        MetaMethod mmethod = new CategoryMethod(cachedMethod, metaClass.getTheClass());
        methodList.add(mmethod);
        Collections.sort(methodList);
      }
    }
  }
}
origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

public void addNewStaticMethod(Method method) {
  final CachedMethod cachedMethod = CachedMethod.find(method);
  NewStaticMetaMethod newMethod = new NewStaticMetaMethod(cachedMethod);
  final CachedClass declaringClass = newMethod.getDeclaringClass();
  addNewStaticMethodToIndex(newMethod, metaMethodIndex.getHeader(declaringClass.getTheClass()));
}
origin: org.codehaus.groovy/groovy-all-minimal

public void addNewStaticMethod(Method method) {
  final CachedMethod cachedMethod = CachedMethod.find(method);
  NewStaticMetaMethod newMethod = new NewStaticMetaMethod(cachedMethod);
  final CachedClass declaringClass = newMethod.getDeclaringClass();
  addNewStaticMethodToIndex(newMethod, metaMethodIndex.getHeader(declaringClass.getTheClass()));
}
origin: org.codehaus.groovy/groovy-jdk14

public void addNewInstanceMethod(Method method) {
  final CachedMethod cachedMethod = CachedMethod.find(method);
  NewInstanceMetaMethod newMethod = new NewInstanceMetaMethod(cachedMethod);
  final CachedClass declaringClass = newMethod.getDeclaringClass();
  addNewInstanceMethodToIndex(newMethod, metaMethodIndex.getHeader(declaringClass.getTheClass()));
}
origin: org.kohsuke.droovy/groovy

public void addNewStaticMethod(Method method) {
  final CachedMethod cachedMethod = CachedMethod.find(method);
  NewStaticMetaMethod newMethod = new NewStaticMetaMethod(cachedMethod);
  final CachedClass declaringClass = newMethod.getDeclaringClass();
  addNewStaticMethodToIndex(newMethod, metaMethodIndex.getHeader(declaringClass.getTheClass()));
}
origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

public void addNewInstanceMethod(Method method) {
  final CachedMethod cachedMethod = CachedMethod.find(method);
  NewInstanceMetaMethod newMethod = new NewInstanceMetaMethod(cachedMethod);
  final CachedClass declaringClass = newMethod.getDeclaringClass();
  addNewInstanceMethodToIndex(newMethod, metaMethodIndex.getHeader(declaringClass.getTheClass()));
}
origin: org.codehaus.groovy/groovy-jdk14

public void addNewStaticMethod(Method method) {
  final CachedMethod cachedMethod = CachedMethod.find(method);
  NewStaticMetaMethod newMethod = new NewStaticMetaMethod(cachedMethod);
  final CachedClass declaringClass = newMethod.getDeclaringClass();
  addNewStaticMethodToIndex(newMethod, metaMethodIndex.getHeader(declaringClass.getTheClass()));
}
origin: org.kohsuke.droovy/groovy

public void addNewInstanceMethod(Method method) {
  final CachedMethod cachedMethod = CachedMethod.find(method);
  NewInstanceMetaMethod newMethod = new NewInstanceMetaMethod(cachedMethod);
  final CachedClass declaringClass = newMethod.getDeclaringClass();
  addNewInstanceMethodToIndex(newMethod, metaMethodIndex.getHeader(declaringClass.getTheClass()));
}
origin: org.codehaus.groovy/groovy-all-minimal

public void addNewInstanceMethod(Method method) {
  final CachedMethod cachedMethod = CachedMethod.find(method);
  NewInstanceMetaMethod newMethod = new NewInstanceMetaMethod(cachedMethod);
  final CachedClass declaringClass = newMethod.getDeclaringClass();
  addNewInstanceMethodToIndex(newMethod, metaMethodIndex.getHeader(declaringClass.getTheClass()));
}
org.codehaus.groovy.reflectionCachedMethodfind

Popular methods of CachedMethod

  • getCachedMethod
  • <init>
  • isStatic
  • setAccessible
  • compareTo
  • compareToCachedMethod
  • compareToMethod
  • getDeclaringClass
  • getDescriptor
  • getModifiers
  • getName
  • getNativeParameterTypes
  • getName,
  • getNativeParameterTypes,
  • getParameterTypes,
  • getReturnType,
  • toString,
  • correctArguments,
  • createPogoMetaMethodSite,
  • createPojoMetaMethodSite,
  • createStaticMetaMethodSite

Popular in Java

  • Making http requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • addToBackStack (FragmentTransaction)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now