Java 类org.gradle.api.NamedDomainObjectCollection 实例源码

项目:Reer    文件:AbstractArtifactRepository.java   
public void onAddToContainer(NamedDomainObjectCollection<ArtifactRepository> container) {
    isPartOfContainer = true;
}
项目:Reer    文件:DefaultNamedDomainObjectCollection.java   
public <S extends T> NamedDomainObjectCollection<S> withType(Class<S> type) {
    return filtered(createFilter(type));
}
项目:Reer    文件:DefaultNamedDomainObjectCollection.java   
public NamedDomainObjectCollection<T> matching(Spec<? super T> spec) {
    return filtered(createFilter(spec));
}
项目:Reer    文件:DefaultNamedDomainObjectCollection.java   
public NamedDomainObjectCollection<T> matching(Closure spec) {
    return matching(Specs.<T>convertClosureToSpec(spec));
}
项目:Reer    文件:BridgedCollections.java   
public static <I, C extends NamedDomainObjectCollection<I>> ModelRegistrations.Builder registration(
    final ModelReference<C> containerReference,
    final Transformer<? extends C, ? super MutableModelNode> containerFactory,
    final Namer<? super I> namer,
    String descriptor,
    final Transformer<String, String> itemDescriptorGenerator
) {
    final ModelPath containerPath = containerReference.getPath();
    final ModelType<C> containerType = containerReference.getType();
    assert containerPath != null : "container reference path cannot be null";

    return ModelRegistrations.of(containerPath)
        .action(ModelActionRole.Create, new Action<MutableModelNode>() {
            public void execute(final MutableModelNode containerNode) {
                final C container = containerFactory.transform(containerNode);
                containerNode.setPrivateData(containerType, container);
                container.all(new Action<I>() {
                    public void execute(final I item) {
                        final String name = namer.determineName(item);

                        // For now, ignore elements added after the container has been closed
                        if (!containerNode.isMutable()) {
                            LOGGER.debug("Ignoring element '{}' added to '{}' after it is closed.", containerPath, name);
                            return;
                        }

                        if (!containerNode.hasLink(name)) {
                            ModelRegistration itemRegistration = ModelRegistrations
                                .unmanagedInstanceOf(
                                    ModelReference.of(containerPath.child(name), new DslObject(item).getDeclaredType()),
                                    new ExtractFromParentContainer<I, C>(name, containerType)
                                )
                                .descriptor(itemDescriptorGenerator.transform(name))
                                .build();
                            containerNode.addLink(itemRegistration);
                        }
                    }
                });
                container.whenObjectRemoved(new Action<I>() {
                    public void execute(I item) {
                        String name = namer.determineName(item);
                        containerNode.removeLink(name);
                    }
                });
            }
        })
        .descriptor(descriptor);
}
项目:FlipTheSwitch-Android    文件:FlipTheSwitchPlugin.java   
private NamedDomainObjectCollection<ProductFlavorConfig> getProductFlavorConfigs(final Project project) {
    return findFlipTheSwitchExtension(project).productFlavors();
}
项目:Pushjet-Android    文件:AbstractArtifactRepository.java   
public void onAddToContainer(NamedDomainObjectCollection<ArtifactRepository> container) {
    isPartOfContainer = true;
}
项目:Pushjet-Android    文件:AbstractArtifactRepository.java   
public void onAddToContainer(NamedDomainObjectCollection<ArtifactRepository> container) {
    isPartOfContainer = true;
}
项目:Reer    文件:ArtifactRepositoryInternal.java   
void onAddToContainer(NamedDomainObjectCollection<ArtifactRepository> container);
项目:Pushjet-Android    文件:ArtifactRepositoryInternal.java   
void onAddToContainer(NamedDomainObjectCollection<ArtifactRepository> container);
项目:Pushjet-Android    文件:ArtifactRepositoryInternal.java   
void onAddToContainer(NamedDomainObjectCollection<ArtifactRepository> container);