Returns whether the method given is a getter method we should serialize /
deserialize to the service. The method must begin with "get" or "is",
have no arguments, belong to a class that declares its table, and not be
marked ignored.
14579
private boolean isRelevantGetter(Method m) {
        return (m.getName().startsWith("get") || m.getName().startsWith("is")) && m.getParameterTypes().length == 0
                && m.getDeclaringClass().getAnnotation(DynamoDBTable.class) != null
                && !m.isAnnotationPresent(DynamoDBIgnore.class);
    }
1058852
public static boolean isHttpGetRequest(HttpServletRequest request) {
        boolean isSane = isSaneRequest(request);
        boolean isGet = isSane && request.getMethod().equals(HttpMethod.GET.toString());
        return isSane && isGet;
    }
236930
public boolean isKeyDeserializer( JType type ) {
        return null != type.isClass() && type.isClass().isAssignableTo( keyDeserializerType );
    }
646592
Method getSetter(Method getter) {
        synchronized (setterCache) {
            if ( !setterCache.containsKey(getter) ) {
                String fieldName = ReflectionUtils.getFieldNameByGetter(getter, false);
                String setterName = "set" + fieldName;
                Method setter = null;
                try {
                    setter = getter.getDeclaringClass().getMethod(setterName, getter.getReturnType());
                } catch ( NoSuchMethodException e ) {
                    throw new DynamoDBMappingException("Expected a public, one-argument method called " + setterName
                            + " on " + getter.getDeclaringClass(), e);
                } catch ( SecurityException e ) {
                    throw new DynamoDBMappingException("No access to public, one-argument method called " + setterName
                            + " on " + getter.getDeclaringClass(), e);
                }
                setterCache.put(getter, setter);
            }
            return setterCache.get(getter);
        }
    }
1168264
Class<?> getGetterPropertyType( Clazz<?> clazz, String name )
	{
		String getterName = "get" + capitalizeFirstLetter( name );
		Method getter = clazz.getMethod( getterName );
		if( getter != null )
			return getter.getReturnType();

		// try direct field access
		Field field = clazz.getAllField( name );
		if( field != null )
			return field.getType();

		return null;
	}
227728
Object getDataService(T session, Class cls) throws DataServiceException {
		String dataServiceClassName = cls.getName();
		logger.debug("Looking for dataservice : {}", dataServiceClassName);
		if (cls.isAnnotationPresent(DataService.class)) {
			return _getDataService(session, cls);
		} else {
			throw new DataServiceException(dataServiceClassName + " is not annotated with @" + DataService.class.getSimpleName());
		}
	}
360818
private static Class<?> getSerializerType(Object instance) {
    Type type = instance.getClass().getGenericInterfaces()[0];
    if (type instanceof ParameterizedType) {
      Class<?> cls = null;
      Type clsType = ((ParameterizedType) type).getActualTypeArguments()[0];

      if (clsType instanceof GenericArrayType) {
        // Workaround for Java 6 (JDK bug 7151486)
        cls = Array.newInstance((Class) ((GenericArrayType) clsType).getGenericComponentType(), 0).getClass();
      } else {
        cls = (Class<?>) clsType;
      }

      if (Object.class.equals(cls)) {
        throw new RuntimeException("The serializer type can't be object");
      }
      return cls;
    } else {
      throw new RuntimeException(String
          .format("The serializer class %s is not generic or has an unknown type", instance.getClass().getName()));
    }
  }
19331
private boolean isMatchGetter(String methodName, String fieldName, boolean isBooeanField) {
		// 全部转为小写，忽略大小写比较
		methodName = methodName.toLowerCase();
		fieldName = fieldName.toLowerCase();

		if (false == methodName.startsWith("get") && false == methodName.startsWith("is")) {
			// 非标准Getter方法
			return false;
		}
		if("getclass".equals(methodName)) {
			//跳过getClass方法
			return false;
		}

		// 针对Boolean类型特殊检查
		if (isBooeanField) {
			if (fieldName.startsWith("is")) {
				// 字段已经是is开头
				if (methodName.equals(fieldName) // isName -》 isName
						|| methodName.equals("get" + fieldName)// isName -》 getIsName
						|| methodName.equals("is" + fieldName)// isName -》 isIsName
				) {
					return true;
				}
			} else if (methodName.equals("is" + fieldName)) {
				// 字段非is开头， name -》 isName
				return true;
			}
		}

		// 包括boolean的任何类型只有一种匹配情况：name -》 getName
		return methodName.equals("get" + fieldName);
	}
870048
def method_missing(name, *args, &block)
      getter_name = name[0..-2]

      if name =~ /^[a-z]+=$/ && !respond_to?(getter_name)
        define_accessor(getter_name, args.first)
      else
        super
      end
    end
873924
@Override
    public ISerializer<?> get(Class<?> clazz) {
        ISerializer<?> contextSerializer = super.get(clazz);

        if (contextSerializer != null) {
            return contextSerializer;
        }

        for (ISerializer<?> item : this) {
            if (item.getType().isAssignableFrom(clazz)) {
                return item;
            }
        }

        return null;
    }
1295967
private boolean isHandledByFilter(Method method) {
        // "Resource classes are POJOs that have at least one method annotated
        // with @Path or a request method designator. [...]
        //
        // Resource methods are methods of a resource class annotated with a
        // request method designator. [...] A request method designator is a
        // runtime annotation that is annotated with the @HttpMethod
        // annotation."
        for (Annotation annotation : method.getAnnotations()) {
            if (HttpMethod.class.isAssignableFrom(annotation.annotationType())) {
                return true;
            }
        }

        if (method.isAnnotationPresent(Path.class)) {
            return true;
        }

        return false;
    }
1371920
def method?(name)
      begin
        klass = Esi::Calls.const_get(method_to_class_name(name))
      rescue NameError
        return false
      end
      !klass.nil?
    end
1077765
@Override
  public I get()
  {
    I instance = _instance;
    
    if (instance == null || instance.isModified()) {
      _instance = instance = service().get();
    }
    
    return instance;
  }
86998
private SerializerWrapper getSerializerWrapper(Class cls) {
    SerializerWrapper w = serializers.get(cls);
    if (w != null) {
      return w;
    } else {
      // Try with interfaces implemented
      for (Class c : cls.getInterfaces()) {
        w = serializers.get(c);
        if (w != null) {
          return w;
        }
      }
    }
    return null;
  }
1338258
private boolean isNestedOrSandwichedMethodCall() {
        return typeCheckingContext.getEnclosingMethodCalls().size() > 1
                || typeCheckingContext.getEnclosingConstructorCalls().size() > 0
                || typeCheckingContext.getEnclosingPropertyExpressions().size() > 0;
    }
823174
Method getSetter(Method getter) {
        synchronized (setterCache) {
            if ( !setterCache.containsKey(getter) ) {
                String attributeName = null;
                if ( getter.getName().startsWith("get") ) {
                    attributeName = getter.getName().substring("get".length());
                } else if ( getter.getName().startsWith("is") ) {
                    attributeName = getter.getName().substring("is".length());
                } else {
                    // should be impossible to reach this exception
                    throw new RuntimeException("Getter method must start with 'is' or 'get'");
                }
                String setterName = "set" + attributeName;
                Method setter = null;
                try {
                    setter = getter.getDeclaringClass().getMethod(setterName, getter.getReturnType());
                } catch ( NoSuchMethodException e ) {
                    throw new DynamoDBMappingException("Expected a public, one-argument method called " + setterName
                            + " on class " + getter.getDeclaringClass(), e);
                } catch ( SecurityException e ) {
                    throw new DynamoDBMappingException("No access to public, one-argument method called " + setterName
                            + " on class " + getter.getDeclaringClass(), e);
                }
                setterCache.put(getter, setter);
            }
        }
        
        return setterCache.get(getter);
    }
956735
private BTreeKeySerializer<?> getBTreeKeySerializerFromClass(Class<?> klass) {
        if(klass == Integer.class) {
            return BTreeKeySerializer.ZERO_OR_POSITIVE_INT;
        }
        else if(klass == Long.class) {
            return BTreeKeySerializer.ZERO_OR_POSITIVE_LONG;
        }
        else if(klass == String.class) {
            return BTreeKeySerializer.STRING;
        }
        return null; //Default POJO serializer
    }