This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Register the provider by creating a file 'META-INF/services/org.togglz.core.spi.FeatureManagerProvider'. | |
* The file must contains the fully-qualified name of the provider class. | |
*/ | |
public class SingletonFeatureManagerProvider implements FeatureManagerProvider { | |
private static FeatureManager featureManager; | |
@Override | |
public int priority() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JadeTransformer extends StringTransformer | |
{ | |
@Override | |
public String transform(String src) | |
{ | |
try { | |
return new Jade().process(src, new HashMap<String, Object>()); | |
} | |
catch (IOException e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class CountryAndQuantity { | |
private final String country; | |
private final Long quantity; | |
public CountryAndQuantity(String country, Long quantity) { | |
this.country = country; | |
this.quantity = quantity; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This will result in an additional ViewEngine. The priority ensures | |
* that this implementation is preferred. | |
*/ | |
@Priority(1000) | |
public class AdditionalViewEngine extends FreemarkerViewEngine { | |
@Override | |
protected Configuration buildConfiguration() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomConfigurationProducer extends DefaultConfigurationProducer { | |
@Override | |
@Specializes | |
@Produces | |
@ViewEngineConfig // <--- See my note in the mail | |
public Configuration getConfiguration() { | |
Configuration config = super.getConfiguration(); | |
// do custom initialization here | |
return config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Controller | |
@Path("/somepage") | |
public class SomeController { | |
@Inject | |
private Result result; | |
@Inject | |
private Validator validation; |
NewerOlder