本文整理汇总了Java中org.jcodings.specific.UTF8Encoding类的典型用法代码示例。如果您正苦于以下问题:Java UTF8Encoding类的具体用法?Java UTF8Encoding怎么用?Java UTF8Encoding使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UTF8Encoding类属于org.jcodings.specific包,在下文中一共展示了UTF8Encoding类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: Grok
import org.jcodings.specific.UTF8Encoding; //导入依赖的package包/类
@SuppressWarnings("unchecked")
Grok(Map<String, String> patternBank, String grokPattern, boolean namedCaptures) {
this.patternBank = patternBank;
this.namedCaptures = namedCaptures;
this.expression = toRegex(grokPattern);
byte[] expressionBytes = expression.getBytes(StandardCharsets.UTF_8);
this.compiledExpression = new Regex(expressionBytes, 0, expressionBytes.length, Option.DEFAULT, UTF8Encoding.INSTANCE);
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:Grok.java
示例2: OnigRegExp
import org.jcodings.specific.UTF8Encoding; //导入依赖的package包/类
public OnigRegExp(String source) {
lastSearchStrUniqueId = null;
lastSearchPosition = -1;
lastSearchResult = null;
byte[] pattern = source.getBytes(StandardCharsets.UTF_8);
this.regex = new Regex(pattern, 0, pattern.length, Option.CAPTURE_GROUP, UTF8Encoding.INSTANCE, Syntax.DEFAULT,
WarnCallback.DEFAULT);
}
开发者ID:eclipse,项目名称:tm4e,代码行数:9,代码来源:OnigRegExp.java
示例3: RegexpOpExp
import org.jcodings.specific.UTF8Encoding; //导入依赖的package包/类
public RegexpOpExp(ParserLiteral left, ParserLiteral right, int operator)
{
super(left, right, operator);
byte[] pattern = (((StringLiteral)right).val).getBytes(StandardCharsets.UTF_8);
this.regex = new Regex(pattern, 0, pattern.length, Option.NONE, UTF8Encoding.INSTANCE);
if (! left.isString()) {
throw new ConfigException(String.format("\"%s\" is not a String column", ((IdentifierLiteral)left).name));
}
}
开发者ID:sonots,项目名称:embulk-filter-row,代码行数:12,代码来源:ParserExp.java
示例4: getSingleModuleForPath
import org.jcodings.specific.UTF8Encoding; //导入依赖的package包/类
private List<Module> getSingleModuleForPath(File child) {
if(child.getName().endsWith(".rb")) {
try {
@SuppressWarnings("unchecked")
List<String> lines = FileUtils.readLines(child);
if(lines.size() > 1) {
String regex = lines.get(0);
regex = regex.substring(1, regex.length()).trim();
String triggers = lines.get(1);
triggers = triggers.substring(1, triggers.length()).trim();
String filename = child.getName();
String name = filename.substring(0, filename.length() - 3);
MewtwoMain.mewtwoLogger.info("Adding module " + name + " - regex = " + regex +
", triggers = "+ triggers);
Module m = new Module(
new Regex(regex.getBytes(), 0, regex.length(), Option.NONE, UTF8Encoding.INSTANCE),
Arrays.asList(triggers.split(",")), filename.substring(0, filename.length() - 3),
filename);
return Arrays.asList(m);
} else MewtwoMain.mewtwoLogger.info("Skipping file " + child.getAbsolutePath() + " - shorter than two lines!");
} catch (Throwable t) {
MewtwoMain.mewtwoLogger.error("Exception while parsing modules for " + child.getAbsolutePath() + "! ", t);
}
} else MewtwoMain.mewtwoLogger.info("Skipping file " + child.getAbsolutePath() + " - not a ruby file!");
return Arrays.asList();
}
开发者ID:meew0,项目名称:Mewtwo,代码行数:33,代码来源:ModuleManager.java
示例5: convertJavaStringToRuby
import org.jcodings.specific.UTF8Encoding; //导入依赖的package包/类
private static IRubyObject convertJavaStringToRuby(Ruby runtime, String str) {
if (runtime.is1_9()) {
ByteList bytes = new ByteList(str.getBytes(RubyEncoding.UTF8), UTF8Encoding.INSTANCE);
return RubyString.newString(runtime, bytes);
} else {
return RubyString.newString(runtime, str);
}
}
开发者ID:gocd,项目名称:gocd,代码行数:9,代码来源:NokogiriHelpers.java
示例6: generate
import org.jcodings.specific.UTF8Encoding; //导入依赖的package包/类
@Override
protected Regex generate(String i) {
byte[] pattern = i.getBytes();
return new Regex(pattern, 0, pattern.length, Option.NONE, UTF8Encoding.INSTANCE);
}
开发者ID:fbacchella,项目名称:RegexPerf,代码行数:6,代码来源:State_org_joni.java
注:本文中的org.jcodings.specific.UTF8Encoding类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论