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


Java UTF8Encoding.INSTANCE属性代码示例

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


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

示例1: Grok

@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,代码行数:9,代码来源:Grok.java

示例2: OnigRegExp

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,代码行数:8,代码来源:OnigRegExp.java

示例3: RegexpOpExp

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,代码行数:11,代码来源:ParserExp.java

示例4: getSingleModuleForPath

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,代码行数:32,代码来源:ModuleManager.java

示例5: convertJavaStringToRuby

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,代码行数:8,代码来源:NokogiriHelpers.java

示例6: generate

@Override
protected Regex generate(String i) {
    byte[] pattern = i.getBytes();
    return new Regex(pattern, 0, pattern.length, Option.NONE, UTF8Encoding.INSTANCE);
}
 
开发者ID:fbacchella,项目名称:RegexPerf,代码行数:5,代码来源:State_org_joni.java


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