本文整理汇总了Java中play.mvc.Router.reverse方法的典型用法代码示例。如果您正苦于以下问题:Java Router.reverse方法的具体用法?Java Router.reverse怎么用?Java Router.reverse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类play.mvc.Router
的用法示例。
在下文中一共展示了Router.reverse方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTransformedFilesRelativeURLs
import play.mvc.Router; //导入方法依赖的package包/类
ArrayList<String> getTransformedFilesRelativeURLs() throws IOException {
ArrayList<JSSourceDatabaseEntry> all_entries = getDatabase().getSortedEntries();
ArrayList<String> results = new ArrayList<String>(all_entries.size() + 1);
String url;
if (reduced_declaration_file.exists()) {
try {
url = Router.reverse(VirtualFile.open(reduced_declaration_file));
results.add(url);
} catch (NoRouteFoundException e) {
throw new IOException("Play can't resolve route for " + reduced_declaration_file.getPath());
}
}
File transformed_file;
for (int pos = 0; pos < all_entries.size(); pos++) {
transformed_file = all_entries.get(pos).computeTransformedFilepath(module_path, transformed_directory);
if (transformed_file.exists() == false) {
Loggers.Play_JSSource.warn("A transformed file don't exists: " + transformed_file);
continue;
}
url = Router.reverse(VirtualFile.open(transformed_file));
results.add(url);
}
return results;
}
示例2: pack
import play.mvc.Router; //导入方法依赖的package包/类
/**
* @param hashtag_to_add (should be start with #)
*/
void pack(String hashtag_to_add) {
if (url != null) {
return;
}
if (hashtag_to_add == null) {
hashtag_to_add = "";
}
try {
if (controler_args.isEmpty()) {
url = Router.reverse(controler_name).url + hashtag_to_add;
} else {
url = Router.reverse(controler_name, controler_args).url + hashtag_to_add;
}
} catch (NoRouteFoundException e) {
Loggers.Play.error("Can't found route for " + controler_name);
return;
}
}
示例3: getConcatedFileRelativeURL
import play.mvc.Router; //导入方法依赖的package包/类
public String getConcatedFileRelativeURL() throws IOException {
CopyMove.checkExistsCanRead(allfiles_concated_file);
HashMap<String, Object> args = new HashMap<String, Object>(2);
args.put("name", allfiles_concated_file.getName());
args.put("suffix_date", allfiles_concated_file.lastModified() / 1000);
return Router.reverse(AsyncJavascript.class.getName() + "." + "JavascriptRessource", args).url;
}
示例4: setStaticFile
import play.mvc.Router; //导入方法依赖的package包/类
/**
* Not need to pack.
*/
void setStaticFile(String relative_file) {
try {
url = Router.reverse(VirtualFile.fromRelativePath(relative_file));
} catch (NoRouteFoundException e) {
Loggers.Play.error("Can't found route for " + relative_file);
url = "/";
}
}
示例5: getListAction
import play.mvc.Router; //导入方法依赖的package包/类
public Object getListAction() {
return Router.reverse(controllerClass.getName().replace("$", "") + ".list");
}
示例6: getBlankAction
import play.mvc.Router; //导入方法依赖的package包/类
public Object getBlankAction() {
return Router.reverse(controllerClass.getName().replace("$", "") + ".blank");
}