本文整理汇总了Java中org.gradle.api.internal.plugins.ExtensionContainerInternal类的典型用法代码示例。如果您正苦于以下问题:Java ExtensionContainerInternal类的具体用法?Java ExtensionContainerInternal怎么用?Java ExtensionContainerInternal使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExtensionContainerInternal类属于org.gradle.api.internal.plugins包,在下文中一共展示了ExtensionContainerInternal类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getExtensionData
import org.gradle.api.internal.plugins.ExtensionContainerInternal; //导入依赖的package包/类
@VisibleForTesting
// recursive (but doesn't search through nested objects, only nested extensions)
static String getExtensionData(String extensionName, Object extensionInstance, int depth)
throws IllegalAccessException {
StringBuilder result = new StringBuilder("");
// extension start block
result.append(spaces(depth)).append(extensionName).append(" {\n");
// all non-extension fields
for (Field field : extensionInstance.getClass().getSuperclass().getDeclaredFields()) {
// ignore synthetic fields (stuff added by compiler or instrumenter)
if (field.isSynthetic()) {
continue;
}
// This is just a helper for the extensions, don't show it
if (field.getType().equals(org.gradle.api.Project.class)) {
continue;
}
result.append(getFieldData(field, extensionInstance, depth + 1));
}
// all extension fields
Map<String, Object> map =
((ExtensionContainerInternal) ((ExtensionAware) extensionInstance).getExtensions())
.getAsMap();
for (String childExtensionName : map.keySet()) {
Object childExtensionInstance = map.get(childExtensionName);
// only expand out extensions we understand (we're ignoring the default ext group here, which
// is not ExtensionAware)
if (childExtensionInstance instanceof ExtensionAware) {
result.append(getExtensionData(childExtensionName, map.get(childExtensionName), depth + 1));
}
}
// extension end block
result.append(spaces(depth)).append("}\n");
return result.toString();
}
示例2: getExtensions
import org.gradle.api.internal.plugins.ExtensionContainerInternal; //导入依赖的package包/类
public ExtensionContainerInternal getExtensions() {
return (ExtensionContainerInternal) getConvention();
}
示例3: getExtensions
import org.gradle.api.internal.plugins.ExtensionContainerInternal; //导入依赖的package包/类
ExtensionContainerInternal getExtensions();