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


Java GStringImpl类代码示例

本文整理汇总了Java中org.codehaus.groovy.runtime.GStringImpl的典型用法代码示例。如果您正苦于以下问题:Java GStringImpl类的具体用法?Java GStringImpl怎么用?Java GStringImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: loadValues

import org.codehaus.groovy.runtime.GStringImpl; //导入依赖的package包/类
/**
 * Flattens and finalizes the config values.
 */
private void loadValues(final String keyPrefix, final ConfigObject configObject) {
    @SuppressWarnings("unchecked")
    final Set<Map.Entry<String,?>> entries = configObject.entrySet();
    for (final Map.Entry<String,?> entry: entries) {
        final String key = keyPrefix + entry.getKey();
        Object value = entry.getValue();
        if (value instanceof ConfigObject) {
            loadValues(key + ".", (ConfigObject)value);
        }
        else {

            if (value instanceof Redact) {
                redacts.add(key);
                value = ((Redact<?>)value).getValue();
            }
            if (value instanceof GStringImpl) {
                value = value.toString();
            }
            values.put(key, value);
        }
    }
}
 
开发者ID:ctzen,项目名称:slurper-configuration,代码行数:26,代码来源:Config.java

示例2: setPath

import org.codehaus.groovy.runtime.GStringImpl; //导入依赖的package包/类
/**
 * Sets the path part of the URI.
 *
 * @param str the path part of the URI
 * @return a reference to the builder
 */
public UriBuilder setPath(final String str) {
    final String[] parts;
    if (str.startsWith("/")) {
        parts = new String[]{str};
    } else {
        final String base = getPath().toString();
        parts = new String[]{base, base.endsWith("/") ? "" : "/", str};
    }

    return setPath(new GStringImpl(EMPTY, parts));
}
 
开发者ID:http-builder-ng,项目名称:http-builder-ng,代码行数:18,代码来源:UriBuilder.java

示例3: populateFrom

import org.codehaus.groovy.runtime.GStringImpl; //导入依赖的package包/类
protected final void populateFrom(final URI uri) {
    boolean useRaw = useRawValues != null ? useRawValues : false;

    try {
        setScheme(uri.getScheme());
        setPort(uri.getPort());
        setHost(uri.getHost());

        final String path = useRaw ? uri.getRawPath() : uri.getPath();
        if (path != null) {
            setPath(new GStringImpl(EMPTY, new String[]{path}));
        }

        final String rawQuery = useRaw ? uri.getRawQuery() : uri.getQuery();
        if (rawQuery != null) {
            if (useRaw) {
                setQuery(extractQueryMap(rawQuery));
            } else {
                setQuery(Form.decode(new StringBuilder(rawQuery), UTF_8));
            }
        }

        setFragment(useRaw ? uri.getRawFragment() : uri.getFragment());
        setUserInfo(useRaw ? uri.getRawUserInfo() : uri.getUserInfo());
    } catch (IOException e) {
        //this seems o.k. to just convert to a runtime exception,
        //we started with a valid URI, so this should never happen.
        throw new RuntimeException(e);
    }
}
 
开发者ID:http-builder-ng,项目名称:http-builder-ng,代码行数:31,代码来源:UriBuilder.java

示例4: plus

import org.codehaus.groovy.runtime.GStringImpl; //导入依赖的package包/类
public GString plus(GString that) {
    Object[] values = getValues();

    return new GStringImpl(appendValues(values, that.getValues()), appendStrings(getStrings(), that.getStrings(), values.length));
}
 
开发者ID:apache,项目名称:groovy,代码行数:6,代码来源:GString.java

示例5: gstring

import org.codehaus.groovy.runtime.GStringImpl; //导入依赖的package包/类
/**
 * {@code "Foo bar zot ${x}"} kind of string
 */
public Block gstring(int line, Block listOfValues, Block listOfStrings) {
    return new_(line, GStringImpl.class,
            cast(line,listOfValues, Object[].class,true),
            cast(line,listOfStrings,String[].class,true));
}
 
开发者ID:cloudbees,项目名称:groovy-cps,代码行数:9,代码来源:Builder.java


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