当前位置: 首页>>代码示例>>Java>>正文


Java Sink.monospaced方法代码示例

本文整理汇总了Java中org.apache.maven.doxia.sink.Sink.monospaced方法的典型用法代码示例。如果您正苦于以下问题:Java Sink.monospaced方法的具体用法?Java Sink.monospaced怎么用?Java Sink.monospaced使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.maven.doxia.sink.Sink的用法示例。


在下文中一共展示了Sink.monospaced方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processEnum

import org.apache.maven.doxia.sink.Sink; //导入方法依赖的package包/类
private void processEnum(Sink sink, String className) {
  Class<?> clazz = getClassForNameIsh(sink, className);
  if (clazz == null) {
    sink.text("Was not able to find class: " + className);
    sink.lineBreak();
    return;
  }
  if (clazz.isEnum()) {
    classHeading(sink, className);
    final Object[] constants = clazz.getEnumConstants();
    final List<String> constantsWrapped = Lists.newArrayList();
    for (Object c : constants) {
      constantsWrapped.add("\"" + c + "\"");
    }
    sink.text("Enumerated Type.  Valid values are: ");
    sink.monospaced();
    sink.text(Joiner.on(", ").join(constantsWrapped));
    sink.monospaced_();
    sink.lineBreak();
  } else {
    sink.text("!??!?!!?" + clazz);
    sink.lineBreak();
  }

}
 
开发者ID:spotify,项目名称:docgenerator,代码行数:26,代码来源:DocgeneratorMojo.java

示例2: reportDifferences

import org.apache.maven.doxia.sink.Sink; //导入方法依赖的package包/类
private void reportDifferences(List<ReportTimeReporter.DifferenceReport> diffs, Sink sink, ResourceBundle bundle,
    String typeKey) {

    if (diffs == null || diffs.isEmpty()) {
        return;
    }

    sink.section3();
    sink.sectionTitle3();
    sink.text(bundle.getString(typeKey));
    sink.sectionTitle3_();

    sink.table();

    sink.tableRow();

    sink.tableHeaderCell();
    sink.text(bundle.getString("report.revapi.difference.code"));
    sink.tableHeaderCell_();

    sink.tableHeaderCell();
    sink.text(bundle.getString("report.revapi.difference.element"));
    sink.tableHeaderCell_();

    sink.tableHeaderCell();
    sink.text(bundle.getString("report.revapi.difference.description"));
    sink.tableHeaderCell_();

    sink.tableRow_();

    diffs.sort((d1, d2) -> {
        String c1 = d1.difference.code;
        String c2 = d2.difference.code;

        int cmp = c1.compareTo(c2);
        if (cmp != 0) {
            return cmp;
        }

        Element e1 = d1.newElement == null ? d1.oldElement : d1.newElement;
        Element e2 = d2.newElement == null ? d2.oldElement : d2.newElement;

        cmp = e1.getClass().getName().compareTo(e2.getClass().getName());
        if (cmp != 0) {
            return cmp;
        }

        return e1.getFullHumanReadableString().compareTo(e2.getFullHumanReadableString());
    });

    for (ReportTimeReporter.DifferenceReport d : diffs) {
        String element = d.oldElement == null ? (d.newElement.getFullHumanReadableString()) :
            d.oldElement.getFullHumanReadableString();

        sink.tableRow();

        sink.tableCell();
        sink.monospaced();
        sink.text(d.difference.code);
        sink.monospaced_();
        sink.tableCell_();

        sink.tableCell();
        sink.monospaced();
        sink.bold();
        sink.text(element);
        sink.bold_();
        sink.monospaced_();

        sink.tableCell();
        sink.text(d.difference.description);
        sink.tableCell_();

        sink.tableRow_();
    }

    sink.table_();

    sink.section3_();
}
 
开发者ID:revapi,项目名称:revapi,代码行数:81,代码来源:ReportMojo.java


注:本文中的org.apache.maven.doxia.sink.Sink.monospaced方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。