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


Java NotationParser类代码示例

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


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

示例1: module

import org.gradle.internal.typeconversion.NotationParser; //导入依赖的package包/类
public ComponentModuleMetadataDetails module(final Object sourceModule) {
    final NotationParser<Object, ModuleIdentifier> parser = parser();
    final ModuleIdentifier source = parser.parseNotation(sourceModule);
    return new ComponentModuleMetadataDetails() {
        public void replacedBy(final Object targetModule) {
            ModuleIdentifier target = parser.parseNotation(targetModule);
            detectCycles(replacements, source, target);
            replacements.put(source, target);
        }

        public ModuleIdentifier getId() {
            return source;
        }

        public ModuleIdentifier getReplacedBy() {
            return replacements.get(source);
        }
    };
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:20,代码来源:ComponentModuleMetadataContainer.java

示例2: adaptToEnum

import org.gradle.internal.typeconversion.NotationParser; //导入依赖的package包/类
private static <T, S> T adaptToEnum(Class<T> targetType, S sourceObject) {
    try {
        String literal;
        if (sourceObject instanceof Enum) {
            literal = ((Enum<?>) sourceObject).name();
        } else if (sourceObject instanceof String) {
            literal = (String) sourceObject;
        } else {
            literal = sourceObject.toString();
        }
        NotationParser<String, T> parser = new NotationConverterToNotationParserAdapter<String, T>(new EnumFromCharSequenceNotationParser(targetType));
        T parsedLiteral = parser.parseNotation(literal);
        return targetType.cast(parsedLiteral);
    } catch (TypeConversionException e) {
        throw new IllegalArgumentException(String.format("Can't convert '%s' to enum type '%s'", sourceObject, targetType.getSimpleName()), e);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:18,代码来源:ProtocolToModelAdapter.java

示例3: create

import org.gradle.internal.typeconversion.NotationParser; //导入依赖的package包/类
public NotationParser<Object, MavenArtifact> create() {
    FileNotationParser fileNotationParser = new FileNotationParser(fileResolver);
    ArchiveTaskNotationParser archiveTaskNotationParser = new ArchiveTaskNotationParser();
    PublishArtifactNotationParser publishArtifactNotationParser = new PublishArtifactNotationParser();

    NotationParser<Object, MavenArtifact> sourceNotationParser = new NotationParserBuilder<MavenArtifact>()
            .resultingType(MavenArtifact.class)
            .parser(archiveTaskNotationParser)
            .parser(publishArtifactNotationParser)
            .parser(fileNotationParser)
            .toComposite();

    MavenArtifactMapNotationParser mavenArtifactMapNotationParser = new MavenArtifactMapNotationParser(sourceNotationParser);

    NotationParserBuilder<MavenArtifact> parserBuilder = new NotationParserBuilder<MavenArtifact>()
            .resultingType(MavenArtifact.class)
            .parser(archiveTaskNotationParser)
            .parser(publishArtifactNotationParser)
            .parser(mavenArtifactMapNotationParser)
            .parser(fileNotationParser);

    return parserBuilder.toComposite();
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:24,代码来源:MavenArtifactNotationParserFactory.java

示例4: create

import org.gradle.internal.typeconversion.NotationParser; //导入依赖的package包/类
public NotationParser<Object, IvyArtifact> create() {
    FileNotationParser fileNotationParser = new FileNotationParser(fileResolver);
    ArchiveTaskNotationParser archiveTaskNotationParser = new ArchiveTaskNotationParser();
    PublishArtifactNotationParser publishArtifactNotationParser = new PublishArtifactNotationParser();

    NotationParser<Object, IvyArtifact> sourceNotationParser = new NotationParserBuilder<IvyArtifact>()
            .resultingType(IvyArtifact.class)
            .parser(archiveTaskNotationParser)
            .parser(publishArtifactNotationParser)
            .parser(fileNotationParser)
            .toComposite();

    IvyArtifactMapNotationParser ivyArtifactMapNotationParser = new IvyArtifactMapNotationParser(sourceNotationParser);

    NotationParserBuilder<IvyArtifact> parserBuilder = new NotationParserBuilder<IvyArtifact>()
            .resultingType(IvyArtifact.class)
            .parser(archiveTaskNotationParser)
            .parser(publishArtifactNotationParser)
            .parser(ivyArtifactMapNotationParser)
            .parser(fileNotationParser);

    return parserBuilder.toComposite();
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:24,代码来源:IvyArtifactNotationParserFactory.java

示例5: DefaultMavenPublication

import org.gradle.internal.typeconversion.NotationParser; //导入依赖的package包/类
public DefaultMavenPublication(
        String name, MavenProjectIdentity projectIdentity, NotationParser<Object, MavenArtifact> mavenArtifactParser, Instantiator instantiator,
        ProjectDependencyPublicationResolver projectDependencyResolver, FileCollectionFactory fileCollectionFactory
) {
    this.name = name;
    this.projectDependencyResolver = projectDependencyResolver;
    this.projectIdentity = new DefaultMavenProjectIdentity(projectIdentity.getGroupId(), projectIdentity.getArtifactId(), projectIdentity.getVersion());
    mavenArtifacts = instantiator.newInstance(DefaultMavenArtifactSet.class, name, mavenArtifactParser, fileCollectionFactory);
    pom = instantiator.newInstance(DefaultMavenPom.class, this);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:DefaultMavenPublication.java

示例6: create

import org.gradle.internal.typeconversion.NotationParser; //导入依赖的package包/类
public MavenPublication create(final String name) {

            Module module = dependencyMetaDataProvider.getModule();
            MavenProjectIdentity projectIdentity = new DefaultMavenProjectIdentity(module.getGroup(), module.getName(), module.getVersion());
            NotationParser<Object, MavenArtifact> artifactNotationParser = new MavenArtifactNotationParserFactory(instantiator, fileResolver).create();

            return instantiator.newInstance(
                    DefaultMavenPublication.class,
                    name, projectIdentity, artifactNotationParser, instantiator, projectDependencyResolver, fileCollectionFactory
            );
        }
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:MavenPublishPlugin.java

示例7: forResolutionStrategy

import org.gradle.internal.typeconversion.NotationParser; //导入依赖的package包/类
public static DefaultDependencySubstitutions forResolutionStrategy(ComponentIdentifierFactory componentIdentifierFactory) {
    NotationParser<Object, ComponentSelector> projectSelectorNotationParser = NotationParserBuilder
        .toType(ComponentSelector.class)
        .fromCharSequence(new ProjectPathConverter(componentIdentifierFactory))
        .toComposite();
    return new DefaultDependencySubstitutions(VersionSelectionReasons.SELECTED_BY_RULE, projectSelectorNotationParser);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:DefaultDependencySubstitutions.java

示例8: forIncludedBuild

import org.gradle.internal.typeconversion.NotationParser; //导入依赖的package包/类
public static DefaultDependencySubstitutions forIncludedBuild(IncludedBuild build) {
    NotationParser<Object, ComponentSelector> projectSelectorNotationParser = NotationParserBuilder
            .toType(ComponentSelector.class)
            .fromCharSequence(new CompositeProjectPathConverter(build))
            .toComposite();
    return new DefaultDependencySubstitutions(VersionSelectionReasons.COMPOSITE_BUILD, projectSelectorNotationParser);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:DefaultDependencySubstitutions.java

示例9: DefaultDependencySubstitutions

import org.gradle.internal.typeconversion.NotationParser; //导入依赖的package包/类
private DefaultDependencySubstitutions(ComponentSelectionReason reason,
                                       Set<Action<? super DependencySubstitution>> substitutionRules,
                                       NotationParser<Object, ComponentSelector> moduleSelectorNotationParser,
                                       NotationParser<Object, ComponentSelector> projectSelectorNotationParser) {
    this.reason = reason;
    this.substitutionRules = substitutionRules;
    this.moduleSelectorNotationParser = moduleSelectorNotationParser;
    this.projectSelectorNotationParser = projectSelectorNotationParser;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:DefaultDependencySubstitutions.java

示例10: create

import org.gradle.internal.typeconversion.NotationParser; //导入依赖的package包/类
public NotationParser<Object, ConfigurablePublishArtifact> create() {
    FileNotationConverter fileConverter = new FileNotationConverter();
    return NotationParserBuilder
            .toType(ConfigurablePublishArtifact.class)
            .converter(new DecoratingConverter())
            .converter(new ArchiveTaskNotationConverter())
            .converter(new FileMapNotationConverter(fileConverter))
            .converter(fileConverter)
            .toComposite();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:PublishArtifactNotationParserFactory.java

示例11: DefaultConfigurationPublications

import org.gradle.internal.typeconversion.NotationParser; //导入依赖的package包/类
public DefaultConfigurationPublications(PublishArtifactSet artifacts, final AttributeContainerInternal parentAttributes, final Instantiator instantiator, final NotationParser<Object, ConfigurablePublishArtifact> artifactNotationParser, final FileCollectionFactory fileCollectionFactory) {
    this.artifacts = artifacts;
    this.parentAttributes = parentAttributes;
    this.instantiator = instantiator;
    this.artifactNotationParser = artifactNotationParser;
    this.fileCollectionFactory = fileCollectionFactory;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:DefaultConfigurationPublications.java

示例12: DefaultDependencyFactory

import org.gradle.internal.typeconversion.NotationParser; //导入依赖的package包/类
public DefaultDependencyFactory(NotationParser<Object, Dependency> dependencyNotationParser,
                                NotationParser<Object, ClientModule> clientModuleNotationParser,
                                ProjectDependencyFactory projectDependencyFactory) {
    this.dependencyNotationParser = dependencyNotationParser;
    this.clientModuleNotationParser = clientModuleNotationParser;
    this.projectDependencyFactory = projectDependencyFactory;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:DefaultDependencyFactory.java

示例13: create

import org.gradle.internal.typeconversion.NotationParser; //导入依赖的package包/类
public NotationParser<Object, ClientModule> create() {
    return NotationParserBuilder.toType(ClientModule.class)
            .fromCharSequence(new DependencyStringNotationConverter<DefaultClientModule>(instantiator, DefaultClientModule.class))
            .converter(new DependencyMapNotationConverter<DefaultClientModule>(instantiator, DefaultClientModule.class))
            .toComposite();

}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:ClientModuleNotationParserFactory.java

示例14: parser

import org.gradle.internal.typeconversion.NotationParser; //导入依赖的package包/类
public static NotationParser<Object, Dependency> parser(Instantiator instantiator, DefaultProjectDependencyFactory dependencyFactory, ClassPathRegistry classPathRegistry, FileLookup fileLookup, RuntimeShadedJarFactory runtimeShadedJarFactory, CurrentGradleInstallation currentGradleInstallation) {
    return NotationParserBuilder
        .toType(Dependency.class)
        .fromCharSequence(new DependencyStringNotationConverter<DefaultExternalModuleDependency>(instantiator, DefaultExternalModuleDependency.class))
        .converter(new DependencyMapNotationConverter<DefaultExternalModuleDependency>(instantiator, DefaultExternalModuleDependency.class))
        .fromType(FileCollection.class, new DependencyFilesNotationConverter(instantiator))
        .fromType(Project.class, new DependencyProjectNotationConverter(dependencyFactory))
        .fromType(DependencyFactory.ClassPathNotation.class, new DependencyClassPathNotationConverter(instantiator, classPathRegistry, fileLookup.getFileResolver(), runtimeShadedJarFactory, currentGradleInstallation))
        .invalidNotationMessage("Comprehensive documentation on dependency notations is available in DSL reference for DependencyHandler type.")
        .toComposite();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:DependencyNotationParser.java

示例15: DefaultIvyPublication

import org.gradle.internal.typeconversion.NotationParser; //导入依赖的package包/类
public DefaultIvyPublication(
        String name, Instantiator instantiator, IvyPublicationIdentity publicationIdentity, NotationParser<Object, IvyArtifact> ivyArtifactNotationParser,
        ProjectDependencyPublicationResolver projectDependencyResolver, FileCollectionFactory fileCollectionFactory
) {
    this.name = name;
    this.publicationIdentity = publicationIdentity;
    this.projectDependencyResolver = projectDependencyResolver;
    configurations = instantiator.newInstance(DefaultIvyConfigurationContainer.class, instantiator);
    ivyArtifacts = instantiator.newInstance(DefaultIvyArtifactSet.class, name, ivyArtifactNotationParser, fileCollectionFactory);
    ivyDependencies = instantiator.newInstance(DefaultIvyDependencySet.class);
    descriptor = instantiator.newInstance(DefaultIvyModuleDescriptorSpec.class, this);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:DefaultIvyPublication.java


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