org.apache.jena.rdf.model.impl.Util.substituteStandardEntities()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(137)

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

Util.substituteStandardEntities介绍

暂无

代码示例

代码示例来源:origin: org.apache.jena/jena-core

protected String substitutedAttribute( String s ) 
  {
  String substituted = Util.substituteStandardEntities( s );
  if (!showDoctypeDeclaration.booleanValue()) 
    return attributeQuoted( substituted );
  else
    {
    int split = Util.splitNamespaceXML( substituted );
    String namespace = substituted.substring(  0, split );
    String prefix = modelPrefixMapping.getNsURIPrefix( namespace );
    return prefix == null || isPredefinedEntityName( prefix )
      ? attributeQuoted( substituted )
      : attributeQuoted( "&" + strForPrefix(prefix) + ";" + substituted.substring( split ) )
      ;
    }
  }

代码示例来源:origin: apache/jena

protected String substitutedAttribute( String s ) 
  {
  String substituted = Util.substituteStandardEntities( s );
  if (!showDoctypeDeclaration.booleanValue()) 
    return attributeQuoted( substituted );
  else
    {
    int split = Util.splitNamespaceXML( substituted );
    String namespace = substituted.substring(  0, split );
    String prefix = modelPrefixMapping.getNsURIPrefix( namespace );
    return prefix == null || isPredefinedEntityName( prefix )
      ? attributeQuoted( substituted )
      : attributeQuoted( "&" + strForPrefix(prefix) + ";" + substituted.substring( split ) )
      ;
    }
  }

代码示例来源:origin: apache/jena

String regexPresent = it.next();
assertTrue("Looking for /" + regexPresent + "/", Pattern
    .compile(Util.substituteStandardEntities(regexPresent),
        Pattern.DOTALL).matcher(contents).find()
assertTrue(
    "Looking for (not) /" + regexAbsent + "/",
    !Pattern.compile("[\"']"+ Util.substituteStandardEntities(regexAbsent)+ "[\"']", Pattern.DOTALL)
        .matcher(contents).find()

代码示例来源:origin: org.apache.jena/jena-core

String regexPresent = it.next();
assertTrue("Looking for /" + regexPresent + "/", Pattern
    .compile(Util.substituteStandardEntities(regexPresent),
        Pattern.DOTALL).matcher(contents).find()
assertTrue(
    "Looking for (not) /" + regexAbsent + "/",
    !Pattern.compile("[\"']"+ Util.substituteStandardEntities(regexAbsent)+ "[\"']", Pattern.DOTALL)
        .matcher(contents).find()

代码示例来源:origin: apache/jena

static void startTag(IndentedWriter out, String text, String attr, String attrValue) {
  out.print("<") ;
  out.print(text) ;
  out.print(" ") ;
  out.print(attr) ;
  out.print("=\"") ;
  attrValue = Util.substituteStandardEntities(attrValue) ;
  out.print(attrValue) ;
  out.print("\"") ;
  out.print(">") ;
  out.incIndent();
}

代码示例来源:origin: apache/jena

assertEquals( "\n", Util.substituteEntitiesInElementContent( "\n" ) );
assertEquals( "", Util.substituteStandardEntities( "" ) );
assertEquals( "&lt;", Util.substituteStandardEntities( "<" ) );
assertEquals( "&gt;", Util.substituteStandardEntities( ">" ) );
assertEquals( "&amp;", Util.substituteStandardEntities( "&" ) );
assertEquals( "&apos;", Util.substituteStandardEntities( "\'" ) );
assertEquals( "&quot;", Util.substituteStandardEntities( "\"" ) );
assertEquals( "&#xA;", Util.substituteStandardEntities( "\n" ) );
assertEquals( "&#xD;", Util.substituteStandardEntities( "\r" ) );
assertEquals( "&#9;", Util.substituteStandardEntities( "\t" ) );
assertEquals( "a&lt;b&amp;c&gt;d", Util.substituteStandardEntities( "a<b&c>d" ) );

代码示例来源:origin: org.apache.jena/jena-core

assertEquals( "\n", Util.substituteEntitiesInElementContent( "\n" ) );
assertEquals( "", Util.substituteStandardEntities( "" ) );
assertEquals( "&lt;", Util.substituteStandardEntities( "<" ) );
assertEquals( "&gt;", Util.substituteStandardEntities( ">" ) );
assertEquals( "&amp;", Util.substituteStandardEntities( "&" ) );
assertEquals( "&apos;", Util.substituteStandardEntities( "\'" ) );
assertEquals( "&quot;", Util.substituteStandardEntities( "\"" ) );
assertEquals( "&#xA;", Util.substituteStandardEntities( "\n" ) );
assertEquals( "&#xD;", Util.substituteStandardEntities( "\r" ) );
assertEquals( "&#9;", Util.substituteStandardEntities( "\t" ) );
assertEquals( "a&lt;b&amp;c&gt;d", Util.substituteStandardEntities( "a<b&c>d" ) );

相关文章