Skip to content

Instantly share code, notes, and snippets.

View mattnathan's full-sized avatar

Matt Nathan mattnathan

View GitHub Profile
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-pages/core-pages.html">
<polymer-element name="my-element">
@mattnathan
mattnathan / PreferencesProvider.java
Created December 18, 2012 14:02
Implementation of a provider that creates a dynamic proxy for an interface that has methods that return any object where those objects have the ability to have an annotated string injected into them
/**
* Provider of a proxy instance that implements the given factory type. The returned proxy will implement all the
* methods of that type in such a way so that it creates the return type of each method via standard guice mechanisms
* making an annotated @PreferenceName String property available for injection into the returned instance.
*
* @author Matt Nathan
*/
class PreferencesProvider<T> implements Provider<T>, InvocationHandler {
private final T factory;
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>unpack-pa-ces</id>
<phase>generate-resources</phase>