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

项目:Reer    文件:XmlPersistableConfigurationObject.java   
public static Node findOrCreateFirstChildWithAttributeValue(@Nullable Node root, String childName, String attribute, String value) {
    Node child = findFirstChildWithAttributeValue(root, childName, attribute, value);
    if (child == null) {
        Map<String, Object> attributes = Maps.newHashMap();
        attributes.put(attribute, value);
        child = root.appendNode(childName, attributes);
    }
    return child;
}
项目:Reer    文件:DefaultCacheFactory.java   
@Override
public PersistentCache open(File cacheDir, String displayName, @Nullable CacheValidator cacheValidator, Map<String, ?> properties, CacheBuilder.LockTarget lockTarget, LockOptions lockOptions, Action<? super PersistentCache> initializer) throws CacheOpenException {
    lock.lock();
    try {
        return doOpen(cacheDir, displayName, cacheValidator, properties, lockTarget, lockOptions, initializer);
    } finally {
        lock.unlock();
    }
}
项目:Reer    文件:AstUtils.java   
@Nullable
public static ScriptBlock detectScriptBlock(Statement statement, Predicate<? super ScriptBlock> predicate) {
    ScriptBlock scriptBlock = detectScriptBlock(statement);
    if (scriptBlock != null && predicate.apply(scriptBlock)) {
        return scriptBlock;
    } else {
        return null;
    }
}
项目:Reer    文件:AstUtils.java   
@Nullable
public static ScriptBlock detectScriptBlock(Statement statement, final Collection<String> names) {
    return detectScriptBlock(statement, new Predicate<ScriptBlock>() {
        public boolean apply(ScriptBlock input) {
            return names.contains(input.getName());
        }
    });
}
项目:Reer    文件:BaseBinarySpec.java   
@Nullable
protected <T extends ComponentSpec> T getComponentAs(Class<T> componentType) {
    if (componentNode == null) {
        return null;
    }
    ModelType<T> modelType = ModelType.of(componentType);
    return componentNode.canBeViewedAs(modelType)
        ? componentNode.asImmutable(modelType, componentNode.getDescriptor()).getInstance()
        : null;
}
项目:Reer    文件:DefaultBinaryNamingScheme.java   
DefaultBinaryNamingScheme(@Nullable String parentName, @Nullable String binaryName, @Nullable String binaryType, @Nullable String role, boolean main, List<String> dimensions) {
    this.parentName = parentName;
    this.binaryName = binaryName;
    this.binaryType = binaryType;
    this.role = role;
    this.main = main;
    this.dimensions = dimensions;
    this.dimensionPrefix = createPrefix(dimensions);
}
项目:Reer    文件:Signature.java   
@Nullable
private String defaultType() {
    File toSign = getToSign();
    SignatureType signatureType = getSignatureType();
    return toSign != null && signatureType != null
        ? signatureType.combinedExtension(toSign)
        : null;
}
项目:Reer    文件:BeanDynamicObject.java   
@Nullable
@Override
protected MetaProperty lookupProperty(MetaClass metaClass, String name) {
    MetaProperty metaProperty = super.lookupProperty(metaClass, name);
    if (metaProperty != null) {
        return metaProperty;
    }
    metaProperty = classMetaData.getMetaProperty(name);
    if (metaProperty != null && Modifier.isStatic(metaProperty.getModifiers())) {
        return metaProperty;
    }
    return null;
}
项目:Reer    文件:RuleBasedPluginApplicator.java   
public void applyRules(@Nullable String pluginId, Class<?> clazz) {
    ModelRegistry modelRegistry = target.getModelRegistry();
    Iterable<Class<? extends RuleSource>> declaredSources = ruleDetector.getDeclaredSources(clazz);
    for (Class<? extends RuleSource> ruleSource : declaredSources) {
        ExtractedRuleSource<?> rules = ruleInspector.extract(ruleSource);
        for (Class<?> dependency : rules.getRequiredPlugins()) {
            target.getPluginManager().apply(dependency);
        }
        modelRegistry.getRoot().applyToSelf(rules);
    }
}
项目:Reer    文件:ModelRuleExtractor.java   
public <T> ParameterizedRuleSource(List<ExtractedRuleDetails> rules, @Nullable ModelProperty<?> target, List<ModelProperty<?>> implicitInputs, StructSchema<T> schema, StructBindings<?> bindings, ManagedProxyFactory proxyFactory) {
    this.rules = rules;
    this.target = target;
    this.implicitInputs = implicitInputs;
    this.schema = schema;
    this.bindings = bindings;
    this.proxyFactory = proxyFactory;
}
项目:Reer    文件:NodeBackedModelMap.java   
private <S extends T> void doCreate(String name, ModelType<S> type, @Nullable Action<? super S> initAction) {
    ModelPath childPath = modelNode.getPath().child(name);
    ModelRuleDescriptor descriptor = sourceDescriptor.append("create(%s)", name);
    if (initAction != null) {
        doCreate(childPath, type, descriptor, NoInputsModelAction.of(ModelReference.of(childPath, type), descriptor, initAction));
    } else {
        doCreate(childPath, type, descriptor, null);
    }
}
项目:Reer    文件:AbstractTask.java   
private Collection<ContextAwareTaskAction> transformToContextAwareTaskActions(Collection<Object> c) {
    return Collections2.transform(c, new Function<Object, ContextAwareTaskAction>() {
        public ContextAwareTaskAction apply(@Nullable Object input) {
            return wrap((Action<? super Task>) input);
        }
    });
}
项目:Reer    文件:BaseInstanceFactory.java   
@Override @Nullable
public <S extends PUBLIC> ImplementationInfo getImplementationInfo(ModelType<S> publicType) {
    ImplementationRegistration<S> implementationRegistration = getImplementationRegistration(publicType);
    if (implementationRegistration == null) {
        return null;
    }
    return new ImplementationInfoImpl<S>(publicType, implementationRegistration, getInternalViews(publicType));
}
项目:Reer    文件:VersionNumber.java   
private VersionNumber(int major, int minor, int micro, int patch, @Nullable String qualifier, AbstractScheme scheme) {
    this.major = major;
    this.minor = minor;
    this.micro = micro;
    this.patch = patch;
    this.qualifier = qualifier;
    this.scheme = scheme;
}
项目:Reer    文件:AbstractOptions.java   
public void define(@Nullable Map<String, Object> args) {
    if (args == null) {
        return;
    }
    for (Map.Entry<String, Object> arg: args.entrySet()) {
        JavaReflectionUtil.writeableProperty(getClass(), arg.getKey()).setValue(this, arg.getValue());
    }
}
项目:Reer    文件:BeanDynamicObject.java   
BeanDynamicObject(Object bean, @Nullable Class<?> publicType, boolean includeProperties, boolean implementsMissing, PropertySetTransformer propertySetTransformer, MethodArgumentsTransformer methodArgumentsTransformer) {
    if (bean == null) {
        throw new IllegalArgumentException("Value is null");
    }
    this.bean = bean;
    this.publicType = publicType;
    this.includeProperties = includeProperties;
    this.implementsMissing = implementsMissing;
    this.propertySetTransformer = propertySetTransformer;
    this.argsTransformer = methodArgumentsTransformer;
    this.delegate = determineDelegate(bean);
}
项目:Reer    文件:IdeaDependenciesProvider.java   
private static Function<String, Dependency> scopeToDependency(final IdeDependencyKey<?, Dependency> dependencyKey) {
    return new Function<String, Dependency>() {
        @Override
        @Nullable
        public Dependency apply(String s) {
            return dependencyKey.buildDependency(s);
        }
    };
}
项目:Reer    文件:FullExceptionFormatter.java   
private void printException(TestDescriptor descriptor, Throwable exception,
                            @Nullable List<StackTraceElement> parentTrace, int exceptionLevel, StringBuilder builder) {
    String exceptionIndent = Strings.repeat(INDENT, exceptionLevel + 1);
    String exceptionText = exceptionLevel == 0 ? exception.toString() : "\nCaused by:\n" + exception.toString();
    String indentedText = TextUtil.indent(exceptionText, exceptionIndent);
    builder.append(indentedText);
    builder.append('\n');

    String stackTraceIndent = exceptionIndent + INDENT;
    List<StackTraceElement> stackTrace = null;

    if (testLogging.getShowStackTraces()) {
        stackTrace = filterStackTrace(exception, descriptor);
        int commonElements = countCommonElements(stackTrace, parentTrace);
        for (int i = 0; i < stackTrace.size() - commonElements; i++) {
            builder.append(stackTraceIndent);
            builder.append("at ");
            builder.append(stackTrace.get(i));
            builder.append('\n');
        }
        if (commonElements != 0) {
            builder.append(stackTraceIndent);
            builder.append("... ");
            builder.append(commonElements);
            builder.append(" more");
            builder.append('\n');
        }
    }

    if (testLogging.getShowCauses() && exception.getCause() != null) {
        printException(descriptor, exception.getCause(), stackTrace, exceptionLevel + 1, builder);
    }
}
项目:Reer    文件:LockInfoAccess.java   
@Nullable
public FileLock tryLock(RandomAccessFile lockFileAccess, boolean shared) throws IOException {
    try {
        return lockFileAccess.getChannel().tryLock(infoRegionPos, INFORMATION_REGION_SIZE - infoRegionPos, shared);
    } catch (OverlappingFileLockException e) {
        // Locked by the same process, treat as if locked by another process
        return null;
    }
}
项目:Reer    文件:ConfigureUtil.java   
/**
 * Called from an object's {@link Configurable#configure} method.
 */
public static <T> T configureSelf(@Nullable Closure configureClosure, T target) {
    if (configureClosure == null) {
        return target;
    }

    configureTarget(configureClosure, target, new ConfigureDelegate(configureClosure, target));
    return target;
}
项目:Reer    文件:InMemoryCacheFactory.java   
@Override
public PersistentCache open(File cacheDir, String displayName, @Nullable CacheValidator cacheValidator, Map<String, ?> properties, CacheBuilder.LockTarget lockTarget, LockOptions lockOptions, Action<? super PersistentCache> initializer) throws CacheOpenException {
    GFileUtils.mkdirs(cacheDir);
    InMemoryCache cache = new InMemoryCache(cacheDir);
    if (initializer != null) {
        initializer.execute(cache);
    }
    return cache;
}
项目:Reer    文件:DependencyResult.java   
@Nullable
ModuleVersionResolveException getFailure();
项目:Reer    文件:DefaultModuleComponentArtifactIdentifier.java   
public DefaultModuleComponentArtifactIdentifier(ModuleComponentIdentifier componentIdentifier, String name, String type, @Nullable String extension, @Nullable String classifier) {
    this(componentIdentifier, new DefaultIvyArtifactName(name, type, extension, classifier));
}
项目:Reer    文件:UriTextResource.java   
@Nullable
@Override
public File getFile() {
    return sourceFile;
}
项目:Reer    文件:UnsupportedNotationException.java   
public UnsupportedNotationException(Object notation, String failure, @Nullable String resolution, Collection<String> candidateTypes) {
    super(format(failure, resolution, candidateTypes));
    this.notation = notation;
}
项目:Reer    文件:Signature.java   
@Nullable
private String fileName() {
    final File file = getFile();
    return file != null ? file.getName() : null;
}
项目:Reer    文件:ProgressStartEvent.java   
@Nullable
public String getShortDescription() {
    return shortDescription;
}
项目:Reer    文件:BaseBinarySpec.java   
@Override
@Nullable
public ComponentSpec getComponent() {
    return getComponentAs(ComponentSpec.class);
}
项目:Reer    文件:AbstractLongRunningOperation.java   
protected static @Nullable <T> List<T> rationalizeInput(@Nullable Iterable<? extends T> arguments) {
    return arguments != null && arguments.iterator().hasNext() ? CollectionUtils.toList(arguments) : null;
}
项目:Reer    文件:DaemonClientInputForwarder.java   
public void endOfStream(@Nullable Throwable failure) {
    CloseInput message = new CloseInput();
    LOGGER.debug("Dispatching close input message: {}", message);
    dispatch.dispatch(message);
}
项目:Reer    文件:AbstractClassGenerator.java   
@Nullable
public PropertyMetaData getProperty(String name) {
    return properties.get(name);
}
项目:Reer    文件:DefaultBinaryNamingScheme.java   
@Override
public BinaryNamingScheme withBinaryName(@Nullable String name) {
    return new DefaultBinaryNamingScheme(parentName, name, binaryType, role, main, dimensions);
}
项目:Reer    文件:BuildOperationDetails.java   
/**
 * The parent for the operation, if any. When null, the operation of the current thread is used.
 */
@Nullable
public BuildOperationExecutor.Operation getParent() {
    return parent;
}
项目:Reer    文件:DefaultModuleDependencySpec.java   
@Override
@Nullable
public String getVersion() {
    return version;
}
项目:Reer    文件:TestMainAction.java   
@Nullable
@Override
public Object getOwnerBuildOperationId() {
    return testTaskOperationId;
}
项目:Reer    文件:BinarySpecInternal.java   
@Nullable
ComponentSpec getComponent();
项目:Reer    文件:DependentBinariesResolver.java   
@Nullable
<T extends DependentBinariesResolutionStrategy> T getStrategy(String name, Class<T> type);
项目:Reer    文件:BaseDependentBinariesResolutionStrategy.java   
@Nullable
@Override
protected List<DependentBinariesResolvedResult> resolveDependents(BinarySpecInternal target) {
    return null;
}
项目:Reer    文件:UnknownTestDescriptor.java   
@Nullable
@Override
public Object getOwnerBuildOperationId() {
    return null;
}
项目:Reer    文件:BeanDynamicObject.java   
@Nullable
protected MetaMethod lookupMethod(MetaClass metaClass, String name, Class[] arguments) {
    return metaClass.getMetaMethod(name, arguments);
}