All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.sitebricks.PageBinder Maven / Gradle / Ivy

The newest version!
package com.google.sitebricks;

import com.google.inject.Key;
import com.google.inject.binder.ScopedBindingBuilder;
import com.google.sitebricks.routing.Action;

import java.lang.annotation.Annotation;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import java.util.ResourceBundle;
import java.util.regex.Pattern;

/**
 * @author [email protected] (Dhanji R. Prasanna)
 */
public interface PageBinder {
  ShowBinder at(String uri);

  EmbedAsBinder embed(Class clazz);

  void bindMethod(String method, Class annotation);

  NegotiateWithBinder negotiate(String header);

  LocalizationBinder localize(Class iface);

  static interface NegotiateWithBinder {
    void with(Class ann);
  }

  static interface ShowBinder extends PerformBinder {
    ScopedBindingBuilder show(Class clazz);
    ScopedBindingBuilder serve(Class clazz);
    void export(String glob);
  }

  static interface PerformBinder {
    ActionBinder perform(Action action);
    ActionBinder perform(Class action);
    ActionBinder perform(Key action);
  }

  static interface EmbedAsBinder {
    ScopedBindingBuilder as(String annotation);
  }

  static interface LocalizationBinder {
    void using(Locale locale, Map messages);
    void using(Locale locale, Properties messages);
    void using(Locale locale, ResourceBundle messages);
    void usingDefault();
  }

  static interface ActionBinder {
    PerformBinder on(Class... method);
    ActionBinder select(String param, String value);
    ActionBinder selectHeader(String param, String value);
    ActionBinder selectHeader(String param, Pattern regex);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy