play.template2.GTTemplateLocationWithEmbeddedSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fastergt Show documentation
Show all versions of fastergt Show documentation
RePlay is a fork of the Play1 framework, made and maintained by Codeborne.
The newest version!
package play.template2;
import java.util.concurrent.atomic.AtomicInteger;
public class GTTemplateLocationWithEmbeddedSource extends GTTemplateLocation {
private final String source;
private static final AtomicInteger nextKey = new AtomicInteger(1);
public GTTemplateLocationWithEmbeddedSource(String relativePath, String source) {
super(relativePath);
this.source = source;
}
public GTTemplateLocationWithEmbeddedSource( String source) {
super( generateKey() );
this.source = source;
}
// returns a generated unique key
private static String generateKey() {
return "GTTemplateLocationWithEmbeddedSource_generated_key_"+nextKey.getAndIncrement();
}
@Override
public String readSource() {
return source;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy