private void checkResourceClassSetters(final MethodList methodList, final boolean encodedFlag) {
   for (AnnotatedMethod method :
       methodList
           .withoutMetaAnnotation(HttpMethod.class)
           .withoutAnnotation(Path.class)
           .hasNumParams(1)
           .hasReturnType(void.class)
           .nameStartsWith("set")) {
     Parameter p =
         Parameter.create(
             handlerClass,
             method.getMethod().getDeclaringClass(),
             encodedFlag || method.isAnnotationPresent(Encoded.class),
             method.getParameterTypes()[0],
             method.getGenericParameterTypes()[0],
             method.getAnnotations());
     if (null != p) {
       ResourceMethodValidator.validateParameter(
           p,
           method.getMethod(),
           method.getMethod().toGenericString(),
           "1",
           InvocableValidator.isSingleton(handlerClass));
     }
   }
 }
  private void checkForNonPublicMethodIssues() {
    final MethodList allDeclaredMethods = new MethodList(getAllDeclaredMethods(handlerClass));

    // non-public resource methods
    for (AnnotatedMethod m :
        allDeclaredMethods
            .withMetaAnnotation(HttpMethod.class)
            .withoutAnnotation(Path.class)
            .isNotPublic()) {
      Errors.warning(
          handlerClass, LocalizationMessages.NON_PUB_RES_METHOD(m.getMethod().toGenericString()));
    }
    // non-public subres methods
    for (AnnotatedMethod m :
        allDeclaredMethods
            .withMetaAnnotation(HttpMethod.class)
            .withAnnotation(Path.class)
            .isNotPublic()) {
      Errors.warning(
          handlerClass,
          LocalizationMessages.NON_PUB_SUB_RES_METHOD(m.getMethod().toGenericString()));
    }
    // non-public subres locators
    for (AnnotatedMethod m :
        allDeclaredMethods
            .withoutMetaAnnotation(HttpMethod.class)
            .withAnnotation(Path.class)
            .isNotPublic()) {
      Errors.warning(
          handlerClass, LocalizationMessages.NON_PUB_SUB_RES_LOC(m.getMethod().toGenericString()));
    }
  }
  private void addSubResourceMethods(
      final Resource.Builder resourceBuilder,
      final MethodList methodList,
      final boolean encodedParameters,
      final List<MediaType> defaultConsumedTypes,
      final List<MediaType> defaultProducedTypes,
      final Collection<Class<? extends Annotation>> defaultNameBindings,
      final boolean extended) {

    for (AnnotatedMethod am :
        methodList.withMetaAnnotation(HttpMethod.class).withAnnotation(Path.class)) {
      Resource.Builder childResourceBuilder =
          resourceBuilder.addChildResource(am.getAnnotation(Path.class).value());

      ResourceMethod.Builder methodBuilder =
          childResourceBuilder
              .addMethod(am.getMetaMethodAnnotations(HttpMethod.class).get(0).value())
              .consumes(resolveConsumedTypes(am, defaultConsumedTypes))
              .produces(resolveProducedTypes(am, defaultProducedTypes))
              .encodedParameters(encodedParameters || am.isAnnotationPresent(Encoded.class))
              .nameBindings(defaultNameBindings)
              .nameBindings(am.getAnnotations())
              .handledBy(handlerClass, am.getMethod())
              .handlingMethod(am.getDeclaredMethod())
              .extended(extended || am.isAnnotationPresent(ExtendedResource.class));

      introspectAsyncFeatures(am, methodBuilder);
    }
  }
  private void addSubResourceLocators(
      Resource.Builder resourceBuilder,
      MethodList methodList,
      boolean encodedParameters,
      final boolean extended) {

    for (AnnotatedMethod am :
        methodList.withoutMetaAnnotation(HttpMethod.class).withAnnotation(Path.class)) {
      final String path = am.getAnnotation(Path.class).value();
      Resource.Builder builder = resourceBuilder;
      if (path != null && !path.isEmpty() && !path.equals("/")) {
        builder = resourceBuilder.addChildResource(path);
      }

      builder
          .addMethod()
          .encodedParameters(encodedParameters || am.isAnnotationPresent(Encoded.class))
          .handledBy(handlerClass, am.getMethod())
          .handlingMethod(am.getDeclaredMethod())
          .extended(extended || am.isAnnotationPresent(ExtendedResource.class));
    }
  }