Register a List of Blueprint, Class, or String
class names of Blueprint

@param blueprints List
@throws RegisterBlueprintException failed to register blueprint
558086
public void setRegisterBlueprints(Collection blueprints) throws RegisterBlueprintException {
        for (Object blueprint : blueprints) {
            if (blueprint instanceof Class) {
                registerBlueprint((Class) blueprint);
            } else if (blueprint instanceof String) {
                registerBlueprint((String) blueprint);
            } else if (blueprint instanceof String) {
                registerBlueprint(blueprint);
            } else {
                throw new RegisterBlueprintException("Only supports List comprised of Class<Blueprint>, Blueprint, or String className");
            }
        }
    }
1337739
def register_classes(self, classes):
        
        classes = util.return_list(classes)
        for klass in classes:
            IPlugin.register(klass)
1055046
public void register(Class<? extends Controller>... controllerClasses) {
        for (Class<? extends Controller> controllerClass : controllerClasses) {
            register(controllerClass);
        }
    }
36097
public static void registerSimpleType(String classes){
        if(StringUtil.isNotEmpty(classes)){
            String[] cls = classes.split(",");
            for (String c : cls) {
                try {
                    SIMPLE_TYPE_SET.add(Class.forName(c));
                } catch (ClassNotFoundException e) {
                    throw new MapperException("注册类型出错:" + c, e);
                }
            }
        }
    }
209351
@GwtIncompatible("incompatible method")
    private static void register(final Object lhs, final Object rhs) {
        Set<Pair<IDKey, IDKey>> registry = getRegistry();
        if (registry == null) {
            registry = new HashSet<>();
            REGISTRY.set(registry);
        }
        final Pair<IDKey, IDKey> pair = getRegisterPair(lhs, rhs);
        registry.add(pair);
    }
254887
protected final void indexSubclasses(Class<?>... classes) {
		for (Class<?> klass : classes) {
			indexedSuperclasses.add(klass.getCanonicalName());
		}
		annotationDriven = false;
	}
454062
protected static void registerSensitiveKeys(Class<? extends JsonPayload> cls) {
		List<Field> fields = RuntimeUtils.listFields(cls, new RuntimeUtils.FieldFilter() {
			@Override
			public boolean accept(Field field) {
				return Modifier.isStatic(field.getModifiers()) && // static fields
						field.getAnnotation(SensitiveDataKey.class) != null &&  // marked as 'sensitive'
						field.getType().equals(String.class); // with type of String
			}
		});

		if (fields.size() > 0) {
			List<String> keys = new ArrayList<>(fields.size());
			try {
				for (Field field : fields) {
					field.setAccessible(true);
					String value = (String) field.get(null);
					keys.add(value);
				}
				SENSITIVE_KEYS_LOOKUP.put(cls, keys);
			} catch (Exception e) {
				ApptentiveLog.e(e, "Exception while registering sensitive keys");
				logException(e);
			}
		}
	}
412788
def register(root_class, klass, *identifiers)
      identifiers.map(&:to_sym).each do |identifier|
        @classes_to_identifiers[root_class][klass] ||= []

        @identifiers_to_classes[root_class][identifier] = klass
        @classes_to_identifiers[root_class][klass] << identifier
      end
    end
502831
public void registerProvider(Object provider) {
		if (provider != null) {
			Collection<Object> providerList = new ArrayList<>(1);
			providerList.add(provider);
			registerProviders(providerList);
		}
	}
1112444
public void setDashboardNames(java.util.Collection<String> dashboardNames) {
        if (dashboardNames == null) {
            this.dashboardNames = null;
            return;
        }

        this.dashboardNames = new com.amazonaws.internal.SdkInternalList<String>(dashboardNames);
    }
463931
public void addAndRegisterAddOns(List<AddOnModel> addOns) {
        this.addOns.addAll(addOns);
        registerAllAddOns(this.addOns);
        initialized();
    }
838134
private List<NodeTypeData> registerListOfNodeTypes(final List<NodeTypeData> nodeTypes, final int alreadyExistsBehaviour)
      throws RepositoryException
   {
      // validate
      nodeTypeDataValidator.validateNodeType(nodeTypes);

      nodeTypeRepository.registerNodeType(nodeTypes, this, accessControlPolicy, alreadyExistsBehaviour);

      for (NodeTypeData nodeType : nodeTypes)
      {
         for (NodeTypeManagerListener listener : listeners.values())
         {
            listener.nodeTypeRegistered(nodeType.getName());
         }
      }
      if (started && rpcService != null && repository != null && repository.getState() == ManageableRepository.ONLINE)
      {
         try
         {
            String[] names = new String[nodeTypes.size()];
            for (int i = 0; i < names.length; i++)
            {
               names[i] = nodeTypes.get(i).getName().getAsString();
            }
            rpcService.executeCommandOnAllNodes(registerNodeTypes, false, id, names);
         }
         catch (Exception e)
         {
            LOG.warn("Could not register the node types on other cluster nodes", e);
         }
      }
      return nodeTypes;
   }
953831
public static void register(BeanDefinitionRegistry registry,
			Collection<String> packageNames) {
		Assert.notNull(registry, "Registry must not be null");
		Assert.notNull(packageNames, "PackageNames must not be null");
		if (registry.containsBeanDefinition(BEAN)) {
			BeanDefinition beanDefinition = registry.getBeanDefinition(BEAN);
			ConstructorArgumentValues constructorArguments = beanDefinition
					.getConstructorArgumentValues();
			constructorArguments.addIndexedArgumentValue(0,
					addPackageNames(constructorArguments, packageNames));
		}
		else {
			GenericBeanDefinition beanDefinition = new GenericBeanDefinition();
			beanDefinition.setBeanClass(EntityScanPackages.class);
			beanDefinition.getConstructorArgumentValues().addIndexedArgumentValue(0,
					StringUtils.toStringArray(packageNames));
			beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
			registry.registerBeanDefinition(BEAN, beanDefinition);
		}
	}
151158
private void registerTypeMappings(
      TypeMapping registryTypeMapping, List<TypeMapping> typeMappings) {
    Preconditions.checkNotNull(registryTypeMapping, "Null registry type mapping");
    Preconditions.checkNotNull(typeMappings, "Null type mappings");
    Preconditions.checkArgument(!typeMappings.isEmpty(), "Empty type mappings");
    for (TypeMapping typeMapping : typeMappings) {
      for (Class<?> mappingClass : typeMapping.getAllClasses()) {
        QName classQName = typeMapping.getTypeQName(mappingClass);
        DeserializerFactory deserializer = typeMapping.getDeserializer(mappingClass, classQName);
        if (deserializer != null && !registryTypeMapping.isRegistered(mappingClass, classQName)) {
          registryTypeMapping.register(
              mappingClass, classQName, (SerializerFactory) null, deserializer);
        }
      }
    }
  }
573278
public static <T> void register(final Class<T> service) {
        for (T each : ServiceLoader.load(service)) {
            registerServiceClass(service, each);
        }
    }
92529
public void registerBlueprint(Object blueprint) throws RegisterBlueprintException {

        Blueprint blueprintAnnotation = blueprint.getClass().getAnnotation(Blueprint.class);
        if (blueprintAnnotation == null) {
            throw new RegisterBlueprintException("Blueprint class not annotated by @Blueprint: " + blueprint);
        }
        Class target = blueprintAnnotation.value();

        List<ModelField> modelFields = new ArrayList<ModelField>();

        logger.debug("Registering {} blueprint for {}", blueprint.getClass(), target);

        Constructable newInstance = null;

        List<Callback> afterCreateCallbacks = new ArrayList<Callback>();

        // Get all fields for the blueprint target class
        Collection<Field> fields = getAllFields(blueprint.getClass()).values();
        for (Field field : fields) {

            field.setAccessible(true);

            // Register ConstructorCallback field
            if ( field.getType().equals(ConstructorCallback.class) || field.getType().equals(com.tobedevoured.modelcitizen.callback.ConstructorCallback.class)) {
                Object fieldVal = null;
                try {
                    fieldVal = field.get(blueprint);
                } catch (IllegalArgumentException e) {
                    throw new RegisterBlueprintException(e);
                } catch (IllegalAccessException e) {
                    throw new RegisterBlueprintException(e);
                }

                if (fieldVal instanceof Constructable) {
                    logger.debug("Registering ConstructorCallback for {}", blueprint.getClass());
                    newInstance = (Constructable) fieldVal;
                } else {
                    throw new RegisterBlueprintException("Blueprint " + blueprint.getClass().getSimpleName() + " Field class for " + field.getName() + " is invalid ConstructorCallback");
                }

                // ConstructorCallback is only used to create new instance.
                continue;
            }

            // Register AfterCreateCallback field
            if ( field.getType().equals(AfterCreateCallback.class) ) {

                Object fieldVal = null;
                try {
                    fieldVal = field.get(blueprint);
                } catch (IllegalArgumentException e) {
                    throw new RegisterBlueprintException(e);
                } catch (IllegalAccessException e) {
                    throw new RegisterBlueprintException(e);
                }

                if (fieldVal instanceof AfterCreateCallback) {
                    logger.debug("Registering AfterCreateCallback for {}", blueprint.getClass());
                    afterCreateCallbacks.add((AfterCreateCallback)fieldVal);
                } else {
                    throw new RegisterBlueprintException("Blueprint " + blueprint.getClass().getSimpleName() + " Field class for " + field.getName() + " is invalid AfterCreateCallback");
                }

                // AfterCreateCallback is only used in callbacks
                continue;
            }

            // Process @Default
            Default defaultAnnotation = field.getAnnotation(Default.class);
            if (defaultAnnotation != null) {

                DefaultField defaultField = new DefaultField();
                defaultField.setName(field.getName());
                defaultField.setForce(defaultAnnotation.force());

                try {
                    defaultField.setValue(field.get(blueprint));
                } catch (IllegalArgumentException e) {
                    throw new RegisterBlueprintException(e);
                } catch (IllegalAccessException e) {
                    throw new RegisterBlueprintException(e);
                }

                defaultField.setTarget(field.getType());
                defaultField.setFieldClass(field.getType());
                modelFields.add(defaultField);

                logger.trace("  Setting default for {} to {} and forced {}", new Object[]{defaultField.getName(), defaultField.getValue(), defaultField.isForce()});

            }

            // Process @Mapped
            Mapped mapped = field.getAnnotation(Mapped.class);
            if (mapped != null) {
                MappedField mappedField = new MappedField();
                mappedField.setName(field.getName());

                if (field.getAnnotation(Nullable.class) != null) {
                    mappedField.setNullable(true);
                }

                // If @Mapped(target) not set, use Field's class
                if (NotSet.class.equals(mapped.target())) {
                    mappedField.setTarget(field.getType());

                    // Use @Mapped(target) for MappedField#target
                } else {
                    mappedField.setTarget(mapped.target());
                }

                mappedField.setFieldClass(field.getType());
                modelFields.add(mappedField);

                logger.trace("  Setting mapped for {} to {}", mappedField.getName(), mappedField.getTarget());
            }

            // Process @MappedList
            MappedList mappedCollection = field.getAnnotation(MappedList.class);
            if (mappedCollection != null) {
                MappedListField listField = new MappedListField();
                listField.setName(field.getName());
                listField.setFieldClass(field.getType());
                listField.setSize(mappedCollection.size());
                listField.setIgnoreEmpty(mappedCollection.ignoreEmpty());
                listField.setForce(mappedCollection.force());

                // If @MappedList(target) not set, use Field's class
                if (NotSet.class.equals(mappedCollection.target())) {
                    listField.setTarget(field.getType());

                    // Use @MappedList(target) for MappedListField#target
                } else {
                    listField.setTarget(mappedCollection.target());
                }

                // If @MappedList(targetList) not set, use ArrayList
                if (NotSet.class.equals(mappedCollection.targetList())) {
                    listField.setTargetList(ArrayList.class);
                } else {

                    // Ensure that the targetList implements List
                    boolean implementsList = false;
                    for (Class interf : mappedCollection.targetList().getInterfaces()) {
                        if (List.class.equals(interf)) {
                            implementsList = true;
                            break;
                        }
                    }

                    if (!implementsList) {
                        throw new RegisterBlueprintException("@MappedList targetList must implement List for field " + field.getName());
                    }

                    listField.setTargetList(mappedCollection.targetList());
                }

                modelFields.add(listField);

                logger.trace("  Setting mapped list for {} to {} as <{}> and forced {}", new Object[]{listField.getName(), listField.getFieldClass(), listField.getTarget(), listField.isForce()});

            }

            // Process @MappedSet
            MappedSet mappedSet = field.getAnnotation(MappedSet.class);
            if (mappedSet != null) {
                MappedSetField setField = new MappedSetField();
                setField.setName(field.getName());
                setField.setFieldClass(field.getType());
                setField.setSize(mappedSet.size());
                setField.setIgnoreEmpty(mappedSet.ignoreEmpty());
                setField.setForce(mappedSet.force());

                // XXX: @MappedSet( target ) is required
                // If @MappedSet(target) not set
                if (NotSet.class.equals(mappedSet.target())) {

                    // XXX: incorrect, should use generic defined by Set, luckily annotation forces target to be set
                    setField.setTarget(field.getType());

                    // Use @MappedSet(target) for MappedSet#target
                } else {
                    setField.setTarget(mappedSet.target());
                }

                // If @MappedSet(targetSet) not set, use HashSet
                if (NotSet.class.equals(mappedSet.targetSet())) {
                    setField.setTargetSet(HashSet.class);
                } else {

                    // Ensure that the targetSet implements Set
                    boolean implementsSet = false;
                    for (Class interf : mappedSet.targetSet().getInterfaces()) {
                        if (Set.class.equals(interf)) {
                            implementsSet = true;
                            break;
                        }
                    }

                    if (!implementsSet) {
                        throw new RegisterBlueprintException("@MappedSet targetSet must implement Set for field " + field.getName());
                    }

                    setField.setTargetSet(mappedSet.targetSet());
                }

                modelFields.add(setField);

                logger.trace("  Setting mapped set for {} to {} as <{}> and is forced {}", new Object[]{setField.getName(), setField.getFieldClass(), setField.getTarget(), setField.isForce()});

            }
        }

        blueprints.add(blueprint);

        Class templateClass = blueprintAnnotation.template();
        BlueprintTemplate template = null;
        try {
          template = (BlueprintTemplate)ConstructorUtils.invokeConstructor( templateClass, null );
        } catch (NoSuchMethodException e) {
          throw new RegisterBlueprintException( e );
        } catch (IllegalAccessException e) {
          throw new RegisterBlueprintException( e );
        } catch (InvocationTargetException e) {
          throw new RegisterBlueprintException( e );
        } catch (InstantiationException e) {
          throw new RegisterBlueprintException( e );
        }

        // Create Erector for this Blueprint
        Erector erector = new Erector();
        erector.setTemplate(template);
        erector.setBlueprint(blueprint);
        erector.setModelFields(modelFields);
        erector.setTarget(target);
        erector.setNewInstance(newInstance);
        erector.setCallbacks("afterCreate", afterCreateCallbacks);

        erectors.put(target, erector);
    }
184899
public static void register(BeanDefinitionRegistry registry, String... packageNames) {
		Assert.notNull(registry, "Registry must not be null");
		Assert.notNull(packageNames, "PackageNames must not be null");
		register(registry, Arrays.asList(packageNames));
	}