本文整理汇总了Java中org.apache.abdera.model.Element类的典型用法代码示例。如果您正苦于以下问题:Java Element类的具体用法?Java Element怎么用?Java Element使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Element类属于org.apache.abdera.model包,在下文中一共展示了Element类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBasicInteractionMessage
import org.apache.abdera.model.Element; //导入依赖的package包/类
private Entry createBasicInteractionMessage(final String id,
final String runId) {
final Entry interactionNotificationMessage = ABDERA.newEntry();
interactionNotificationMessage.setId(id);
final Date timestamp = new Date();
interactionNotificationMessage.setPublished(timestamp);
interactionNotificationMessage.setUpdated(timestamp);
interactionNotificationMessage.addAuthor("Taverna");
interactionNotificationMessage.setTitle("Interaction from Taverna for "
+ this.requestor.generateId());
final Element runIdElement = interactionNotificationMessage
.addExtension(AtomUtils.getRunIdQName());
runIdElement.setText(StringEscapeUtils.escapeJavaScript(runId));
final Element pathIdElement = interactionNotificationMessage.addExtension(AtomUtils.getPathIdQName());
pathIdElement.setText(StringEscapeUtils.escapeJavaScript(this.requestor.getPath()));
final Element countElement = interactionNotificationMessage.addExtension(AtomUtils.getCountQName());
countElement.setText(StringEscapeUtils.escapeJavaScript(this.requestor.getInvocationCount().toString()));
if (this.requestor.getInteractionType().equals(
InteractionType.Notification)) {
interactionNotificationMessage.addExtension(AtomUtils
.getProgressQName());
}
final Element idElement = interactionNotificationMessage
.addExtension(AtomUtils.getIdQName());
idElement.setText(id);
return interactionNotificationMessage;
}
示例2: getReplyTo
import org.apache.abdera.model.Element; //导入依赖的package包/类
private static String getReplyTo(final Entry entry) {
final Element replyTo = entry.getFirstChild(AtomUtils
.getInReplyToQName());
if (replyTo == null) {
return null;
}
return replyTo.getText();
}
示例3: getRunId
import org.apache.abdera.model.Element; //导入依赖的package包/类
private static String getRunId(final Entry entry) {
final Element runIdElement = entry.getFirstChild(AtomUtils
.getRunIdQName());
if (runIdElement == null) {
return null;
}
return runIdElement.getText();
}
示例4: _expandCurie
import org.apache.abdera.model.Element; //导入依赖的package包/类
private static String _expandCurie(String curie, Element e) {
String[] arr = curie.split(":");
if (arr.length > 1) {
String ns = e.getNamespaces().get(arr[0]);
if (ns != null) {
return ns + arr[1];
} else return curie;
} else return e.getNamespaces().get("") + curie;
}
示例5: readFrom
import org.apache.abdera.model.Element; //导入依赖的package包/类
@Override
public Object readFrom(Class<Object> feedOrEntry, Type arg1, Annotation[] arg2, MediaType arg3, MultivaluedMap<String, String> arg4,
InputStream inputStream) throws IOException, WebApplicationException {
Document<Element> doc = getAbdera().getParser().parse(inputStream);
Element el = doc.getRoot();
if (feedOrEntry.isAssignableFrom(el.getClass())) {
return el;
} else {
throw new IOException("Unexpected payload, expected " + feedOrEntry.getName() + ", received " + el.getClass().getName());
}
}
示例6: handle
import org.apache.abdera.model.Element; //导入依赖的package包/类
@Override
public void handle(Content content) {
for (Element contentElement : content.getElements()) {
System.out.println(contentElement);
}
}
示例7: getElementWrapper
import org.apache.abdera.model.Element; //导入依赖的package包/类
@Override
public <T extends Element> T getElementWrapper(Element element) {
return null; //To change body of implemented methods use File | Settings | File Templates.
}