本文整理匯總了Java中org.odata4j.internal.InternalUtil.toString方法的典型用法代碼示例。如果您正苦於以下問題:Java InternalUtil.toString方法的具體用法?Java InternalUtil.toString怎麽用?Java InternalUtil.toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.odata4j.internal.InternalUtil
的用法示例。
在下文中一共展示了InternalUtil.toString方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: writeRequestEntry
import org.odata4j.internal.InternalUtil; //導入方法依賴的package包/類
public void writeRequestEntry(Writer w, Entry entry) {
DateTime utc = new DateTime().withZone(DateTimeZone.UTC);
String updated = InternalUtil.toString(utc);
XMLWriter2 writer = XMLFactoryProvider2.getInstance().newXMLWriterFactory2().createXMLWriter(w);
writer.startDocument();
writer.startElement(new QName2("entry"), atom);
writer.writeNamespace("d", d);
writer.writeNamespace("m", m);
OEntity entity = entry.getEntity();
writeEntry(writer, null, entity.getProperties(), entity.getLinks(),
null, updated, entity.getEntitySet(), false);
writer.endDocument();
}
示例2: write
import org.odata4j.internal.InternalUtil; //導入方法依賴的package包/類
@Override
public void write(UriInfo uriInfo, Writer w, EntityResponse target) {
String baseUri = uriInfo.getBaseUri().toString();
EdmEntitySet ees = target.getEntity().getEntitySet();
DateTime utc = new DateTime().withZone(DateTimeZone.UTC);
String updated = InternalUtil.toString(utc);
XMLWriter2 writer = XMLFactoryProvider2.getInstance().newXMLWriterFactory2().createXMLWriter(w);
writer.startDocument();
writer.startElement(new QName2("entry"), atom);
writer.writeNamespace("m", m);
writer.writeNamespace("d", d);
writer.writeAttribute("xml:base", baseUri);
writeEntry(writer, target.getEntity(), target.getEntity().getProperties(), target.getEntity().getLinks(), baseUri, updated, ees, true);
writer.endDocument();
}
示例3: write
import org.odata4j.internal.InternalUtil; //導入方法依賴的package包/類
@Override
public void write(UriInfo uriInfo, Writer w, EntitiesResponse response) {
String baseUri = uriInfo.getBaseUri().toString();
EdmEntitySet ees = response.getEntitySet();
String entitySetName = ees.getName();
DateTime utc = new DateTime().withZone(DateTimeZone.UTC);
String updated = InternalUtil.toString(utc);
XMLWriter2 writer = XMLFactoryProvider2.getInstance().newXMLWriterFactory2().createXMLWriter(w);
writer.startDocument();
writer.startElement(new QName2("feed"), atom);
writer.writeNamespace("m", m);
writer.writeNamespace("d", d);
writer.writeAttribute("xml:base", baseUri);
writeElement(writer, "title", entitySetName, "type", "text");
writeElement(writer, "id", baseUri + uriInfo.getPath());
writeElement(writer, "updated", updated);
writeElement(writer, "link", null, "rel", "self", "title", entitySetName, "href", entitySetName);
Integer inlineCount = response.getInlineCount();
if (inlineCount != null) {
writeElement(writer, "m:count", inlineCount.toString());
}
for (OEntity entity : response.getEntities()) {
writer.startElement("entry");
writeEntry(writer, entity, entity.getProperties(), entity.getLinks(), baseUri, updated, ees, true);
writer.endElement("entry");
}
if (response.getSkipToken() != null) {
//<link rel="next" href="https://odata.sqlazurelabs.com/OData.svc/v0.1/rp1uiewita/StackOverflow/Tags/?$filter=TagName%20gt%20'a'&$skiptoken=52" />
UriBuilder builder = uriInfo.getRequestUriBuilder().replaceQueryParam("$skiptoken", response.getSkipToken());
List<String> topParam = uriInfo.getQueryParameters().get("$top");
if (topParam != null) {
long top = Long.valueOf(topParam.get(0));
top -= response.getEntities().size();
if (top > 0) {
builder.replaceQueryParam("$top", top);
} else {
builder.replaceQueryParam("$top");
}
}
String nextHref = builder.build().toString();
writeElement(writer, "link", null, "rel", "next", "href", nextHref);
}
writer.endDocument();
}