Arguments priority:
- nameOrId
- web element
- index

@param annotatedMethod
172146
public void switchToFrameAccordingToAnnotationParams(Method annotatedMethod) {
        RequireSwitchingToFrame annotation = getAnnotationData(annotatedMethod);

        int frameIndex = annotation.index();
        LocatorType locatorType = annotation.locatorType();
        String locatorValue = annotation.locatorValue();
        String nameOrId = annotation.frameNameOrId();

        if (nameOrId.length() > 0) {
            String xpathLocator = String.format("//*[@name='%1$s' or @id='%1$s']", nameOrId);
            SeleniumUtils.findElementWithTimeout(driver, By.xpath(xpathLocator), 20);
            driver.switchTo().frame(nameOrId);
        } else if (locatorType != LocatorType.NONE && locatorValue.length() > 0) {
            switchToFrameByWebElement(locatorType, locatorValue);
        } else {
            driver.switchTo().frame(frameIndex);
        }
    }
1102204
List<Method> getSortedCandidateMethods(String methodName, Method[] methods) {
		List<Method> candidates = new ArrayList<>();
		for (Method method : methods) {
			if (method.getName().equals(methodName)) {
				candidates.add(method);
			}
		}
		Collections.sort(candidates, comparator);
		return candidates;
	}
223669
void indexProperty(AnnotationValue<?> annotation, String property, @Nullable String value) {
        indexes.computeIfAbsent(property, s -> new HashSet<>(2)).add(new AnnotationValueIndex(annotation, property, value));
    }
485175
private static List<Method> getAnnotatedMethods(Class<?> clazz){
		List<Method> methods = new ArrayList<Method>();
		
		for(Method method:getAllMethods(clazz))
			if(!isNull(method.getAnnotation(JMapConversion.class)))
				methods.add(method);
		
		return methods;
	}
1230544
protected void writeAnnotations( IAnnotated annotated)
    {
    toStream( annotated.getAnnotations())
      .sorted()
      .forEach( annotation -> {
        xmlWriter_
          .element( HAS_TAG)
          .attribute( NAME_ATR, annotation)
          .attribute( VALUE_ATR, annotated.getAnnotation( annotation))
          .write();
        });
    }
119441
public void indexAnnotation(final Annotation note) {
    if (search != null) {
      search.indexAnnotation(note).addErrback(new PluginError());
    }
    if( rt_publisher != null ) {
    	rt_publisher.publishAnnotation(note);
    }
  }
764450
private static <A extends Annotation> LinkedHashSet<String> extractFieldsFromAnnotation(final SQLiteModelMethod method, Class<A> annotationClazz, final boolean includePrimaryKey) {
		final SQLiteEntity entity = method.getEntity();

		List<String> annotatedFieldValues = AnnotationUtility.extractAsStringArray(method.getElement(), annotationClazz, AnnotationAttributeType.FIELDS);
		List<String> annotatedExcludedFieldValues = AnnotationUtility.extractAsStringArray(method.getElement(), annotationClazz, AnnotationAttributeType.EXCLUDED_FIELDS);
		CollectionUtils.trim(annotatedFieldValues);
		CollectionUtils.trim(annotatedExcludedFieldValues);

		final One<Integer> count = new One<>(0);

		// extract properties from managed bean
		final Set<String> allFields = new LinkedHashSet<>();
		forEachFields(method, new OnPropertyListener() {

			@Override
			public void onProperty(SQLProperty item) {
				if (!item.isPrimaryKey() || (item.isPrimaryKey() && includePrimaryKey)) {
					allFields.add(item.getName());
				}

				if (TypeUtility.isEquals(item.getPropertyType().getTypeName(), typeName(entity.getElement()))) {
					count.value0++;
				}
			}
		});

		// use attribute includedFields and excludedFields to mantain or remove
		// properties from selected set.
		if (annotatedFieldValues.size() == 0 && annotatedExcludedFieldValues.size() == 0) {
			// if no fields was selected, select all
			annotatedFieldValues.clear();
			annotatedFieldValues.addAll(allFields);
		} else if (annotatedExcludedFieldValues.size() > 0) {
			for (String fieldName : annotatedExcludedFieldValues) {
				if (!entity.contains(fieldName)) {
					AssertKripton.failUnknownPropertyInJQLException(method, annotationClazz, AnnotationAttributeType.EXCLUDED_FIELDS, fieldName);
				}
			}

			allFields.removeAll(annotatedExcludedFieldValues);

			annotatedFieldValues.clear();
			annotatedFieldValues.addAll(allFields);
		}
		LinkedHashSet<String> result = new LinkedHashSet<>();
		result.addAll(annotatedFieldValues);

		return result;
	}
1169801
public static void callAnnotated(Object o, Class<? extends Annotation> ann, boolean lazy) {
        try {
            getMethodOfInterest(o, ann).invoke(o);
        } catch (IllegalAccessException ex) {
            throw new RuntimeException(ex);
        } catch (InvocationTargetException ex) {
            throw new RuntimeException(ex.getCause());
        } catch (IllegalArgumentException ex) {
            if (!lazy) {
                throw new RuntimeException(ex.getMessage());
            }
        }
    }
1097280
public synchronized void setInitializationMethod(String newMethodName)
    {
        Method newMethod = null;
        if (newMethodName != null)
        {
            initializationMethodName = newMethodName;
            try
            {
                // see if we have a publicly accessible method by the name
                newMethod = getClassOfObject().getMethod(newMethodName, NO_PARAMS);
            }
            catch (NoSuchMethodException e)
            {
                try
                {
                    // no publicly accessible method, see if there is a private/protected one
                    newMethod = getClassOfObject().getDeclaredMethod(newMethodName, NO_PARAMS);
                }
                catch (NoSuchMethodException e2)
                {
                    // there is no such method available
                    throw new MetadataException(
                        "Invalid initialization method, there is not"
                            + " a zero argument method named "
                            + newMethodName
                            + " on class "
                            + getClassOfObject().getName()
                            + ".");
                }
            }
        }
        setInitializationMethod(newMethod);
    }
1295337
public void visitAnnotation(@DottedClassName String annotationClass, Map<String, ElementValue> map, boolean runtimeVisible) {
        if (DEBUG) {
            System.out.println("Annotation: " + annotationClass);
            for (Map.Entry<String, ElementValue> e : map.entrySet()) {
                System.out.println("    " + e.getKey());
                System.out.println(" -> " + e.getValue());
            }
        }
    }
959812
public Annotation[] getAnnotations(final Method method) throws AnnotationReadException {
        
        final Class<?> clazz = method.getDeclaringClass();
        
        if(xmlInfo != null && xmlInfo.containsClassInfo(clazz.getName())) {
            final ClassInfo classInfo = xmlInfo.getClassInfo(clazz.getName());
            
            if(classInfo.containsMethodInfo(method.getName())) {
                final MethodInfo methodInfo = classInfo.getMethodInfo(method.getName());
                final Map<String, Annotation> map = new HashMap<>();
                
                if(methodInfo.isOverride()) {
                    for(Annotation ann : method.getAnnotations()) {
                        map.put(ann.annotationType().getName(), ann);
                    }
                }
                
                for(AnnotationInfo annInfo: methodInfo.getAnnotationInfos()){
                    try {
                        map.put(annInfo.getClassName(),
                                annotationBuilder.buildAnnotation(Class.forName(annInfo.getClassName()), annInfo));
                    } catch (ClassNotFoundException e) {
                        throw new AnnotationReadException(String.format("not found class '%s'", annInfo.getClassName()), e);
                    }
                }
                
                return map.values().toArray(new Annotation[map.size()]);
            }
        }
        return method.getAnnotations();
    }
570165
public void outputAnnotationIndex(PrintWriter writer) {
        for (String ann : annotationIndex.keySet()) {
            writer.print(ann);
            writer.print(": ");
            Set<String> classes = annotationIndex.get(ann);
            Iterator<String> it = classes.iterator();
            while (it.hasNext()) {
                writer.print(it.next());
                if (it.hasNext())
                    writer.print(", ");
            }
            writer.println();
        }
    }
76982
private ParamValueLoader findHandlerMethodAnnotation(final Class<? extends Annotation> annoType, ActContext<?> ctx) {
        if (null == ctx) {
            return ParamValueLoader.NIL;
        }
        return new ParamValueLoader.NonCacheable() {
            @Override
            public Object load(Object bean, ActContext<?> ctx, boolean noDefaultValue) {
                Method handlerMethod = ctx.handlerMethod();
                Method curMethod = ctx.currentMethod();
                boolean methodIsCurrent = handlerMethod == curMethod || null == curMethod;

                Annotation anno = handlerMethod.getAnnotation(annoType);
                if (null == anno && !methodIsCurrent) {
                    anno = curMethod.getAnnotation(annoType);
                }
                return anno;
            }
        };
    }
1251148
public Set<Method> getMethodsWithAnyParamAnnotated(Annotation annotation) {
        return filter(getMethodsWithAnyParamAnnotated(annotation.annotationType()), withAnyParameterAnnotation(annotation));
    }
728467
@SuppressWarnings("unchecked")
    private boolean isMethodAlreadyInjectedAnnotationPresent(MethodNode methodNode) {
        AnnotationNode injectedTraceAnnotation = getAnnotation(INJECTED_TRACE_TYPE.getDescriptor(), methodNode.visibleAnnotations);
        AnnotationNode manualTraceAnnotation = getAnnotation(MANUAL_TRACE_TYPE.getDescriptor(), methodNode.visibleAnnotations);
        if (manualTraceAnnotation != null)
            return true;

        if (injectedTraceAnnotation != null) {
            InjectedTraceAnnotationVisitor itav = new InjectedTraceAnnotationVisitor();
            injectedTraceAnnotation.accept(itav);
            List<String> methodAdapters = itav.getMethodAdapters();
            if (methodAdapters.contains(LibertyTracingMethodAdapter.class.getName())) {
                return true;
            }
            if (methodAdapters.contains(WebSphereTrTracingMethodAdapter.class.getName())) {
                return true;
            }
            if (methodAdapters.contains(JSR47TracingMethodAdapter.class.getName())) {
                return true;
            }
        }
        return false;
    }
273076
public static void defineAnnotatedMethods(RubyClass rubyClass, Class<?> proxyClass) {
        Class<?> currentClass = proxyClass;
        while (currentClass != RubyObject.class) {
            rubyClass.defineAnnotatedMethods(currentClass);
            currentClass = currentClass.getSuperclass();
        }
    }
209314
public Set<Method> getMethodsAnnotatedWith(final Class<? extends Annotation> annotation) {
        Iterable<String> methods = store.get(index(MethodAnnotationsScanner.class), annotation.getName());
        return getMethodsFromDescriptors(methods, loaders());
    }