/** * Constructor * * @param customData * @param declaredByMetadataId * @param modifier * @param annotations can be <code>null</code> for none */ protected AbstractIdentifiableAnnotatedJavaStructureProvider(final CustomData customData, final String declaredByMetadataId, final int modifier, final Collection<AnnotationMetadata> annotations) { super(customData, declaredByMetadataId, modifier); CollectionUtils.populate(this.annotations, annotations); }
/** * Constructor * * @param customData * @param declaredByMetadataId * @param modifier * @param annotations * @param parameterTypes * @param parameterNames * @param throwsTypes * @param body */ protected AbstractInvocableMemberMetadata(final CustomData customData, final String declaredByMetadataId, final int modifier, final List<AnnotationMetadata> annotations, final List<AnnotatedJavaType> parameterTypes, final List<JavaSymbolName> parameterNames, final List<JavaType> throwsTypes, final String body) { super(customData, declaredByMetadataId, modifier, annotations); this.body = body; CollectionUtils.populate(this.parameterNames, parameterNames); CollectionUtils.populate(this.parameterTypes, parameterTypes); CollectionUtils.populate(this.throwsTypes, throwsTypes); }
/** * Set the aspects to use on {@code declare precedence} * AspectJ declaration. * * @param aspects */ public void setDeclarePrecedence(JavaType... aspects) { if (aspects != null && aspects.length > 0) { Validate.isTrue(aspects.length >= 1, "precedence must contain, at least, 1 aspect"); } CollectionUtils.populate(declarePrecedence, Arrays.asList(aspects)); }
this.registeredImports.putAll(registeredImports); CollectionUtils.populate(this.declaredConstructors, declaredConstructors); CollectionUtils.populate(this.declaredFields, declaredFields); CollectionUtils.populate(this.declaredMethods, declaredMethods); CollectionUtils.populate(this.extendsTypes, extendsTypes); CollectionUtils.populate(this.fieldAnnotations, fieldAnnotations); CollectionUtils.populate(this.implementsTypes, implementsTypes); CollectionUtils.populate(this.innerTypes, innerTypes); CollectionUtils.populate(this.methodAnnotations, methodAnnotations); CollectionUtils.populate(this.declarePrecedence, declarePrecedence);
private void cachePhysicalPaths(final Collection<Path> paths) { final Collection<Path> pathsToCache = CollectionUtils.populate(new HashSet<Path>(), paths); if (!pathsToCache.contains(ROOT)) { pathsToCache.add(ROOT); } for (final Path path : pathsToCache) { pathLocations.put(path, path.getModulePath(this)); } }
/** * Constructs a new instance. * * @param details the member holders that should be stored in this instance * (can be <code>null</code>) */ public MemberDetailsImpl(final Collection<? extends MemberHoldingTypeDetails> details) { Validate.notEmpty(details, "Member holding details required"); CollectionUtils.populate(this.details, details); }
/** * Constructor that takes a pre-built method call. * * @param builder stores any changes the caller should make in order to make * the given method call, e.g. the field that is the method * target; can be <code>null</code> if the caller requires no * changes other than the given method call * @param methodName the bare name of the method being invoked (required) * @param methodCall a valid Java snippet that calls the method, including * any required target and parameters, for example "foo.bar(baz)" * (required) * @param isStatic whether the invoked method is static * @param methodParameters the parameters taken by the invoked method (can * be <code>null</code>) */ public MemberTypeAdditions(final ClassOrInterfaceTypeDetailsBuilder builder, final String methodName, final String methodCall, final boolean isStatic, final List<MethodParameter> methodParameters) { Validate.notBlank(methodName, "Invalid method name '%s'", methodName); Validate.notBlank(methodCall, "Invalid method signature '%s'", methodCall); classOrInterfaceDetailsBuilder = builder; this.methodCall = methodCall; this.methodName = methodName; this.methodParameters = new ArrayList<MethodParameter>(); CollectionUtils.populate(this.methodParameters, methodParameters); this.isStatic = isStatic; }
/** * Constructor that allows all fields to be set. * * @param groupId the group ID (required) * @param artifactId the artifact ID (required) * @param version the version (required) * @param configuration the configuration for this plugin (optional) * @param dependencies the dependencies for this plugin (can be * <code>null</code>) * @param executions the executions for this plugin (can be * <code>null</code>) */ public Plugin(final String groupId, final String artifactId, final String version, final Configuration configuration, final Collection<? extends Dependency> dependencies, final Collection<? extends Execution> executions) { Validate.notNull(groupId, "Group ID required"); Validate.notNull(artifactId, "Artifact ID required"); //Validate.notNull(version, "Version required"); if (version == null || version == "") { gav = new GAV(groupId, artifactId, "-"); } else { gav = new GAV(groupId, artifactId, version); } this.configuration = configuration; // Defensively copy the given nullable collections CollectionUtils.populate(this.dependencies, dependencies); CollectionUtils.populate(this.executions, executions); }
public ConstructorMetadata getDeclaredConstructor(final List<JavaType> parameters) { final Collection<JavaType> parameterList = CollectionUtils.populate(new ArrayList<JavaType>(), parameters); for (final ConstructorMetadata constructor : getDeclaredConstructors()) { if (parameterList.equals(AnnotatedJavaType.convertFromAnnotatedJavaTypes(constructor .getParameterTypes()))) { return constructor; } } return null; }
StringUtils.defaultIfEmpty(testSourceDirectory, Path.SRC_TEST_JAVA.getDefaultLocation()); CollectionUtils.populate(this.pluginsInPluginManagement, pluginsInPluginManagement); CollectionUtils.populate(this.buildPlugins, buildPlugins); CollectionUtils.populate(this.dependenciesInDependencyManagement, dependenciesInDependencyManagement); CollectionUtils.populate(this.dependencies, dependencies); CollectionUtils.populate(this.filters, filters); CollectionUtils.populate(this.modules, modules); CollectionUtils.populate(this.pluginRepositories, pluginRepositories); CollectionUtils.populate(this.pomProperties, pomProperties); CollectionUtils.populate(this.repositories, repositories); CollectionUtils.populate(this.resources, resources);
CollectionUtils.populate(matchingTargets, locateTargets(input, true, false)); if (matchingTargets.isEmpty()) { commandNotFound(LOGGER, input);
/** * Constructor * * @param customData * @param declaredByMetadataId * @param modifier * @param annotations can be <code>null</code> for none */ protected AbstractIdentifiableAnnotatedJavaStructureProvider(final CustomData customData, final String declaredByMetadataId, final int modifier, final Collection<AnnotationMetadata> annotations) { super(customData, declaredByMetadataId, modifier); CollectionUtils.populate(this.annotations, annotations); }
/** * Constructor * * @param customData * @param declaredByMetadataId * @param modifier * @param annotations * @param parameterTypes * @param parameterNames * @param throwsTypes * @param body */ protected AbstractInvocableMemberMetadata(final CustomData customData, final String declaredByMetadataId, final int modifier, final List<AnnotationMetadata> annotations, final List<AnnotatedJavaType> parameterTypes, final List<JavaSymbolName> parameterNames, final List<JavaType> throwsTypes, final String body) { super(customData, declaredByMetadataId, modifier, annotations); this.body = body; CollectionUtils.populate(this.parameterNames, parameterNames); CollectionUtils.populate(this.parameterTypes, parameterTypes); CollectionUtils.populate(this.throwsTypes, throwsTypes); }
/** * Set the aspects to use on {@code declare precedence} * AspectJ declaration. * * @param aspects */ public void setDeclarePrecedence(JavaType... aspects) { if (aspects != null && aspects.length > 0) { Validate.isTrue(aspects.length >= 1, "precedence must contain, at least, 1 aspect"); } CollectionUtils.populate(declarePrecedence, Arrays.asList(aspects)); }
/** * Constructs a new instance. * * @param details the member holders that should be stored in this instance * (can be <code>null</code>) */ public MemberDetailsImpl(final Collection<? extends MemberHoldingTypeDetails> details) { Validate.notEmpty(details, "Member holding details required"); CollectionUtils.populate(this.details, details); }
this.registeredImports.putAll(registeredImports); CollectionUtils.populate(this.declaredConstructors, declaredConstructors); CollectionUtils.populate(this.declaredFields, declaredFields); CollectionUtils.populate(this.declaredMethods, declaredMethods); CollectionUtils.populate(this.extendsTypes, extendsTypes); CollectionUtils.populate(this.fieldAnnotations, fieldAnnotations); CollectionUtils.populate(this.implementsTypes, implementsTypes); CollectionUtils.populate(this.innerTypes, innerTypes); CollectionUtils.populate(this.methodAnnotations, methodAnnotations); CollectionUtils.populate(this.declarePrecedence, declarePrecedence);
/** * Constructor that takes a pre-built method call. * * @param builder stores any changes the caller should make in order to make * the given method call, e.g. the field that is the method * target; can be <code>null</code> if the caller requires no * changes other than the given method call * @param methodName the bare name of the method being invoked (required) * @param methodCall a valid Java snippet that calls the method, including * any required target and parameters, for example "foo.bar(baz)" * (required) * @param isStatic whether the invoked method is static * @param methodParameters the parameters taken by the invoked method (can * be <code>null</code>) */ public MemberTypeAdditions(final ClassOrInterfaceTypeDetailsBuilder builder, final String methodName, final String methodCall, final boolean isStatic, final List<MethodParameter> methodParameters) { Validate.notBlank(methodName, "Invalid method name '%s'", methodName); Validate.notBlank(methodCall, "Invalid method signature '%s'", methodCall); classOrInterfaceDetailsBuilder = builder; this.methodCall = methodCall; this.methodName = methodName; this.methodParameters = new ArrayList<MethodParameter>(); CollectionUtils.populate(this.methodParameters, methodParameters); this.isStatic = isStatic; }
public ConstructorMetadata getDeclaredConstructor(final List<JavaType> parameters) { final Collection<JavaType> parameterList = CollectionUtils.populate(new ArrayList<JavaType>(), parameters); for (final ConstructorMetadata constructor : getDeclaredConstructors()) { if (parameterList.equals(AnnotatedJavaType.convertFromAnnotatedJavaTypes(constructor .getParameterTypes()))) { return constructor; } } return null; }
CollectionUtils.populate(matchingTargets, locateTargets(input, true, false)); if (matchingTargets.isEmpty()) { commandNotFound(LOGGER, input);