Register a routing converter.

@param r the converter to register
168623
public void register(RoutingConverter<? extends Routing> r) {
        java2json.put(r.getSupportedRouting(), r);
        json2java.put(r.getJSONId(), r);
    }
409616
public <A> A register(final String name, final A rs) {
        return register(true, name, rs);
    }
436213
public static <T,R> void register(Class<T> from, Class<R> to, Function<T,R> transform) {
        REGISTRY.register(from, to, transform);
    }
834553
public static Router register(Router router, Object... restApi) {

		Assert.notNull(router, "Missing vertx router!");
		Assert.isTrue(restApi != null && restApi.length > 0, "Missing REST API class object!");
		assert restApi != null;

		for (Object api : restApi) {

			if (api == null) {
				continue;
			}

			if (api instanceof Handler) {

				Handler handler = (Handler) api;
				router.route().handler(handler);
				continue;
			}

			// check if api is an instance of a class or a class type
			if (api instanceof Class) {

				Class inspectApi = (Class) api;

				try {
					api = ClassFactory.newInstanceOf(inspectApi, injectionProvider, null);
				}
				catch (ClassFactoryException | ContextException e) {
					throw new IllegalArgumentException(e.getMessage());
				}
			}

			Map<RouteDefinition, Method> definitions = AnnotationProcessor.get(api.getClass());

			for (RouteDefinition definition : definitions.keySet()) {

				// bind method execution
				Route route;
				if (definition.pathIsRegEx()) {
					route = router.routeWithRegex(definition.getMethod(), definition.getRoutePath());
				} else {
					route = router.route(definition.getMethod(), definition.getRoutePath());
				}

				log.info("Registering route: " + definition);

				if (definition.requestHasBody() && definition.getConsumes() != null) { // only register if request with body
					for (MediaType item : definition.getConsumes()) {
						route.consumes(MediaTypeHelper.getKey(item)); // ignore charset when binding
					}
				}

				if (definition.getProduces() != null) {
					for (MediaType item : definition.getProduces()) {
						route.produces(MediaTypeHelper.getKey(item)); // ignore charset when binding
					}
				}

				if (definition.getOrder() != 0) {
					route.order(definition.getOrder());
				}

				// check body and reader compatibility beforehand
				checkBodyReader(definition);

				// add BodyHandler in case request has a body ...
				if (definition.requestHasBody()) {
					route.handler(BodyHandler.create());
				}

				// add CookieHandler in case cookies are expected
				if (definition.hasCookies()) {
					route.handler(CookieHandler.create());
				}

				// add security check handler in front of regular route handler
				if (definition.checkSecurity()) {
					route.handler(getSecurityHandler(definition));
				}

				// bind handler // blocking or async
				Handler<RoutingContext> handler;
				Method method = definitions.get(definition);

				if (definition.isAsync()) {
					handler = getAsyncHandler(api, definition, method);
				} else {
					checkWriterCompatibility(definition);
					handler = getHandler(api, definition, method);
				}

				route.handler(handler);
			}
		}

		return router;
	}
809799
public static void register(XStream stream) {
		for (XConverter converter : converters) {
			stream.registerConverter(converter);
			converter.registerAliases(stream);
		}
	}
652217
public void registerPropertyConverter(String propertyName, Converter toConverter, Converter fromConverter) {
		DefaultConversionService propertyConversionService = (DefaultConversionService) propertyConversionServices
				.get(propertyName);
		propertyConversionService.addConverter(toConverter);
		propertyConversionService.addConverter(fromConverter);
	}
981122
private static void registerRouteRoot(IRouteRoot routeRoot) {
        markRegisteredByPlugin();
        if (routeRoot != null) {
            routeRoot.loadInto(Warehouse.groupsIndex);
        }
    }
701891
public final <S, T> void registerConverter(ConverterKey<S,T> key, Converter<S, T> converter) {	

        if (key.getInputClass() == null) {
            throw new IllegalArgumentException("Input Class must not be null");
        }
        if (key.getOutputClass() == null) {
            throw new IllegalArgumentException("Output Class must not be null");
        }
        if (converter == null) {
            throw new IllegalArgumentException("Converter must not be null");
        }

        if (key.getQualifierAnnotation() == null) {
            throw new IllegalArgumentException("Qualifier must not be null");
        }

        Converter<?,?> old = registeredConverters.putIfAbsent(key, converter);
        if (old != null && (!isSameConverter(old, converter))) {
        	throw new IllegalStateException("Converter already registered for key: " + key);
        }
    }
71766
public <T> PropertyLoader register(Converter<T> converter, Class<T> type) {
        manager.register(type, converter);
        return this;
    }
67076
@Override
    public void registerUrlConverter(UrlConverter urlConverter) {
        for (String actionName : new ArrayList<String>(actions.keySet())) {
            actionUriToViewName.put(urlConverter.toUrlElement(actionName), actionName);
            actions.put( urlConverter.toUrlElement(actionName), actions.remove(actionName));
        }
        defaultActionName = urlConverter.toUrlElement(defaultActionName);
    }
617808
public function registerRoutes()
    {
        $this->_route = new Route();
        $this->_config = Config::from('app');

        $router = $this; // MUST KEEP!!!!!!!!!

        require_once $this->_config->from('app')->get('routes');
    }
187690
public final <S, T> void registerUnmarshaller(ConverterKey<S,T> key, FromUnmarshaller<S, T> converter) {
		registerConverter(key.invert(), new FromUnmarshallerConverter<S,T>(converter));
	}
27014
@Override
    public void registerControlAdapters()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "registerControlAdapters");

        //register the local queue point/publication point as appropriate
        _protoRealization.registerControlAdapters();

        // If _remoteQueuePoints not null indicates Queue destination
        SIMPIterator itr = null;
        if (_remoteQueuePoints != null)
        {
            //register the xmit queue points
            itr = _remoteQueuePoints.iterator();
            while (itr.hasNext())
            {
                ControlAdapter remote = (ControlAdapter) itr.next();
                remote.registerControlAdapterAsMBean();
            }
            itr.finished();
        }

        if (isLink())
        {
            //register the xmit queue points
            Iterator it = _localisationManager.getXmitQueueIterator();
            while (it.hasNext())
            {
                ControlAdapter remote = ((PtoPXmitMsgsItemStream) it.next()).getControlAdapter();
                remote.registerControlAdapterAsMBean();
            }
        }

        //We're not registering the BDH's control handler at this time
        // But we register the link as a SIBLink MBean
        if (isLink())
            getControlAdapter().registerControlAdapterAsMBean();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "registerControlAdapters");
    }
1217309
private function registerVariableConverter($ctr, $controllerService, $reflectionMethod)
    {
        $app = $this->app;
        $annotation = $this->reader->getMethodAnnotation($reflectionMethod, 'Singular\Annotation\Convert');

        if (!empty($annotation)) {
            foreach ($annotation->converters as $converter) {
                $callback = explode(':', $converter['fn']);

                if (count($callback) > 1) {
                    $service = $callback[0];
                    $fn = $callback[1];
                } else {
                    $service = $controllerService;
                    $fn = $converter['fn'];
                }

                $ctr->convert($converter['param'], function ($param) use ($app, $fn, $service) {
                    return $app[$service]->$fn($param);
                });
            }
        }
    }
192518
public static void setRegisterWithVM(final boolean registerWithVM) {
    if (Converters.registerWithVM != registerWithVM) {
      Converters.registerWithVM = registerWithVM;

      // register all converters with the VM
      if (registerWithVM) {
        for (Entry<Class, Converter> entry : REGISTRY.entrySet()) {
          Class type = entry.getKey();
          Converter converter = entry.getValue();
          PropertyEditorManager.registerEditor(type, converter.getClass());
        }
      }
    }
  }
339346
private void registerConverterInstance(Class<?> valueType, Converter converter)
  {
    if(converters.put(valueType, converter) == null) {
      log.debug("Register converter |%s| for value type |%s|.", converter.getClass(), valueType);
    }
    else {
      log.warn("Override converter |%s| for value type |%s|.", converter.getClass(), valueType);
    }
  }
425898
public static void register(IRegisterable<?> registerable)
	{
		ResourceLocation name = registerable.getName();
		if (name == null)
			throw new IllegalArgumentException("No name specified for registration for " + registerable.getClass().getName());
		if (!(registerable instanceof Block || registerable instanceof Item))
			throw new IllegalArgumentException("Cannot register " + registerable.getClass().getName() + " (" + name
					+ ") because it's neither a block or an item.");

		if (registerable instanceof Block)
		{
			Block block = (Block) registerable;
			ForgeRegistries.BLOCKS.register(block);
			Item item = registerable.getItem(block);
			if (item != null)
				ForgeRegistries.ITEMS.register(item);

			//register the mapper for the block and the model for the item
			if (MalisisCore.isClient())
			{
				ModelLoader.setCustomStateMapper(block, b -> ImmutableMap.of());
				if (item != null)
					EmptyModelLoader.register(item);
			}

			ClientNotificationManager.discover(block);
		}
		else if (registerable instanceof Item)
		{
			Item item = (Item) registerable;
			ForgeRegistries.ITEMS.register(item);
			if (MalisisCore.isClient())
				EmptyModelLoader.register(item);
		}
	}