本文整理匯總了Java中org.takes.rs.xe.XeMemory類的典型用法代碼示例。如果您正苦於以下問題:Java XeMemory類的具體用法?Java XeMemory怎麽用?Java XeMemory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
XeMemory類屬於org.takes.rs.xe包,在下文中一共展示了XeMemory類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: make
import org.takes.rs.xe.XeMemory; //導入依賴的package包/類
/**
* Make it.
* @param xsl XSL
* @param req Request
* @param src Source
* @return Response
*/
private static Response make(final String xsl, final Request req,
final Scalar<Iterable<XeSource>> src) {
final Response raw = new RsXembly(
new XeStylesheet(xsl),
new XeAppend(
"page",
new XeMillis(false),
new XeChain(src),
new XeMemory(),
new XeLinkHome(req),
new XeLinkSelf(req),
new XeMillis(true),
new XeDate(),
new XeSla(),
new XeLocalhost(),
new XeFlash(req),
new XeAppend(
"version",
new XeAppend("name", Manifests.read("Rehttp-Version")),
new XeAppend("revision", Manifests.read("Rehttp-Revision")),
new XeAppend("date", Manifests.read("Rehttp-Date"))
)
)
);
return new RsFork(
req,
new FkTypes(
"application/xml,text/xml",
new RsPrettyXml(new RsWithType(raw, "text/xml"))
),
new FkTypes(
"*/*",
new RsXslt(new RsWithType(raw, "text/html"))
)
);
}
示例2: make
import org.takes.rs.xe.XeMemory; //導入依賴的package包/類
/**
* Make it.
* @param xsl XSL
* @param req Request
* @param src Source
* @return Response
* @throws IOException If fails
*/
private static Response make(final String xsl, final Request req,
final Scalar<Iterable<XeSource>> src) throws IOException {
final Response raw = new RsXembly(
new XeStylesheet(xsl),
new XeAppend(
"page",
new XeMillis(false),
new XeChain(src),
new XeMemory(),
new XeLinkHome(req),
new XeLinkSelf(req),
new XeMillis(true),
new XeDate(),
new XeAppend(
"epoch",
Long.toString(System.currentTimeMillis())
),
new XeSla(),
new XeLocalhost(),
new XeFlash(req),
new XeWhen(
new RqAuth(req).identity().equals(Identity.ANONYMOUS),
new XeChain(
new XeGithubLink(
req, Manifests.read("ThreeCopies-GithubId")
)
)
),
new XeWhen(
!new RqAuth(req).identity().equals(Identity.ANONYMOUS),
new XeChain(
new XeIdentity(req),
new XeLogoutLink(req)
)
),
new XeAppend(
"version",
new XeAppend("name", Manifests.read("ThreeCopies-Version")),
new XeAppend(
"revision",
Manifests.read("ThreeCopies-Revision")
),
new XeAppend("date", Manifests.read("ThreeCopies-Date"))
)
)
);
return new RsFork(
req,
new FkTypes(
"application/xml,text/xml",
new RsPrettyXml(new RsWithType(raw, "text/xml"))
),
new FkTypes(
"*/*",
new RsXslt(new RsWithType(raw, "text/html"))
)
);
}
示例3: make
import org.takes.rs.xe.XeMemory; //導入依賴的package包/類
/**
* Make it.
* @param xsl XSL
* @param req Request
* @param src Source
* @return Response
* @throws IOException If fails
*/
private static Response make(final String xsl, final Request req,
final Iterable<XeSource> src) throws IOException {
final Response raw = new RsXembly(
new XeStylesheet(xsl),
new XeAppend(
"page",
new XeMillis(false),
new XeChain(src),
new XeLinkHome(req),
new XeLinkSelf(req),
new XeMillis(true),
new XeDate(),
new XeSla(),
new XeMemory(),
new XeLocalhost(),
new XeIdentity(req),
new XeFlash(req),
new XeGithubLink(req, Manifests.read("Wring-GithubId")),
new XeLogoutLink(req),
new XeLink("pipes", "/pipes"),
new XeLink("favicon", "/favicon"),
new XeAppend(
"version",
new XeAppend("name", Manifests.read("Wring-Version")),
new XeAppend("revision", Manifests.read("Wring-Revision")),
new XeAppend("date", Manifests.read("Wring-Date"))
)
)
);
return new RsFork(
req,
new FkTypes(
"application/xml,text/xml",
new RsPrettyXml(new RsWithType(raw, "text/xml"))
),
new FkTypes(
"*/*",
new RsXslt(new RsWithType(raw, "text/html"))
)
);
}