org.apache.maven.doxia.sink.Sink.comment()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.1k)|赞(0)|评价(0)|浏览(109)

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

Sink.comment介绍

暂无

代码示例

代码示例来源:origin: org.apache.maven.doxia/doxia-module-fml

/** {@inheritDoc} */
protected void handleComment( XmlPullParser parser, Sink sink )
  throws XmlPullParserException
{
  String comment = parser.getText();
  if ( buffer != null )
  {
    buffer.append( LESS_THAN ).append( BANG ).append( MINUS ).append( MINUS )
        .append( comment ).append( MINUS ).append( MINUS ).append( GREATER_THAN );
  }
  else
  {
    if ( isEmitComments() )
    {
      sink.comment( comment );
    }
  }
}

代码示例来源:origin: org.apache.maven.doxia/doxia-module-docbook-simple

/** {@inheritDoc} */
protected void handleComment( XmlPullParser parser, Sink sink )
  throws XmlPullParserException
{
  final String text = parser.getText();
  if ( "PB".equals( text.trim() ) )
  {
    sink.pageBreak();
  }
  else if ( "HR".equals( text.trim() ) )
  {
    sink.horizontalRule();
  }
  else if ( "LB".equals( text.trim() ) )
  {
    sink.lineBreak();
  }
  else if ( "anchor_end".equals( text.trim() ) )
  {
    sink.anchor_();
  }
  else
  {
    if ( isEmitComments() )
    {
      sink.comment( text );
    }
  }
}

相关文章

微信公众号

最新文章

更多