本文整理了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
暂无
代码示例来源: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( "<", Util.substituteStandardEntities( "<" ) );
assertEquals( ">", Util.substituteStandardEntities( ">" ) );
assertEquals( "&", Util.substituteStandardEntities( "&" ) );
assertEquals( "'", Util.substituteStandardEntities( "\'" ) );
assertEquals( """, Util.substituteStandardEntities( "\"" ) );
assertEquals( "
", Util.substituteStandardEntities( "\n" ) );
assertEquals( "
", Util.substituteStandardEntities( "\r" ) );
assertEquals( "	", Util.substituteStandardEntities( "\t" ) );
assertEquals( "a<b&c>d", Util.substituteStandardEntities( "a<b&c>d" ) );
代码示例来源:origin: org.apache.jena/jena-core
assertEquals( "\n", Util.substituteEntitiesInElementContent( "\n" ) );
assertEquals( "", Util.substituteStandardEntities( "" ) );
assertEquals( "<", Util.substituteStandardEntities( "<" ) );
assertEquals( ">", Util.substituteStandardEntities( ">" ) );
assertEquals( "&", Util.substituteStandardEntities( "&" ) );
assertEquals( "'", Util.substituteStandardEntities( "\'" ) );
assertEquals( """, Util.substituteStandardEntities( "\"" ) );
assertEquals( "
", Util.substituteStandardEntities( "\n" ) );
assertEquals( "
", Util.substituteStandardEntities( "\r" ) );
assertEquals( "	", Util.substituteStandardEntities( "\t" ) );
assertEquals( "a<b&c>d", Util.substituteStandardEntities( "a<b&c>d" ) );
内容来源于网络,如有侵权,请联系作者删除!