org.apache.abdera.factory.Factory.newExtensionElement()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中org.apache.abdera.factory.Factory.newExtensionElement()方法的一些代码示例,展示了Factory.newExtensionElement()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Factory.newExtensionElement()方法的具体详情如下:
包路径:org.apache.abdera.factory.Factory
类名称:Factory
方法名:newExtensionElement

Factory.newExtensionElement介绍

[英]Create a new extension element with the given QName.
[中]使用给定的QName创建一个新的扩展元素。

代码示例

代码示例来源:origin: org.apache.abdera/abdera-extensions-main

public static Total addTotal(Entry entry, int total) {
  Factory factory = entry.getFactory();
  Total totalelement = (Total)factory.newExtensionElement(ThreadConstants.THRTOTAL, entry);
  totalelement.setValue(total);
  return totalelement;
}

代码示例来源:origin: org.apache.abdera/abdera-extensions-main

public static Tombstone addTombstone(Feed source, String id) {
  Tombstone tombstone = source.getFactory().newExtensionElement(DELETED_ENTRY);
  tombstone.setRef(id);
  return tombstone;
}

代码示例来源:origin: org.apache.cxf/cxf-rt-management-web

private ExtensibleElement createExtension(List<LogRecord> records) {
  ExtensibleElement list = factory.newExtensionElement(qn("logRecords"));
  for (LogRecord rec : records) {
    list.addExtension(createExtension(rec));
  }
  return list;
}

代码示例来源:origin: rackerlabs/atom-hopper

public Feed addArchiveNode( Feed feed ) {

    Factory factory = feed.getFactory();

    Element root = feed.getDocument().getRoot();

    Element elementArchive = factory.newExtensionElement( new QName( ARCHIVE_NS, ARCHIVE, ARCHIVE_PREFIX ), root );

    elementArchive.setParentElement( root );

    return feed;
  }
}

代码示例来源:origin: org.apache.abdera/abdera-extensions-main

public static Tombstone addTombstone(Feed source, Entry entry) {
  Tombstone tombstone = source.getFactory().newExtensionElement(DELETED_ENTRY, source);
  tombstone.setRef(entry.getId());
  Base parent = entry.getParentElement();
  if (parent != null && parent.equals(source))
    entry.discard();
  return tombstone;
}

代码示例来源:origin: org.apache.cxf/cxf-rt-management-web

private ExtensibleElement createExtension(LogRecord record) {
  ExtensibleElement erec = factory.newExtensionElement(qn("logRecord"));
  
  // forget about single line "addExtension().setText()" since
  // javac failure "org.apache.abdera.model.Element cannot be dereferenced"
  Element e = erec.addExtension(qn("eventTimestamp"));
  e.setText(toAtomDateFormat(record.getDate()));
  e = erec.addExtension(qn("level"));
  e.setText(record.getLevel().toString());
  e = erec.addExtension(qn("loggerName"));
  e.setText(record.getLoggerName());
  e = erec.addExtension(qn("message"));
  e.setText(record.getMessage());
  e = erec.addExtension(qn("threadName"));
  e.setText(record.getThreadName());
  e = erec.addExtension(qn("throwable"));
  e.setText(record.getThrowable());
  return erec;
}

相关文章