本文整理汇总了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);
}
}
}
示例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));
}
示例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);
}
}
示例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));
}
示例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));
}