实例化TypeHandler
@param javaTypeClass
@param typeHandlerClass
@return
485756
@SuppressWarnings("unchecked")
    public <T> TypeHandler<T> getInstance(Class<?> javaTypeClass, Class<?> typeHandlerClass) {
        if (javaTypeClass != null) {
          try {
            Constructor<?> c = typeHandlerClass.getConstructor(Class.class);
            return (TypeHandler<T>) c.newInstance(javaTypeClass);
          } catch (NoSuchMethodException ignored) {
            // ignored
          } catch (Exception e) {
            throw new TypeException("Failed invoking constructor for handler " + typeHandlerClass, e);
          }
        }
        try {
          Constructor<?> c = typeHandlerClass.getConstructor();
          return (TypeHandler<T>) c.newInstance();
        } catch (Exception e) {
          throw new TypeException("Unable to find a usable constructor for " + typeHandlerClass, e);
        }
      }
168171
def type_handler_object(val, objtype):
    
    handler = handlers.get(objtype)
    if handler:
        return handler().restore(val)
    else:
        return objtype(val)
1351250
public static Class<?> loadJavaType(String typeName, ClassLoader classLoader) throws ClassNotFoundException
   {
      if (classLoader == null)
         classLoader = getContextClassLoader();

      Class<?> javaType = primitiveNames.get(typeName);
      if (javaType == null)
         javaType = getArray(typeName, classLoader);

      if (javaType == null)
         javaType = classLoader.loadClass(typeName);

      return javaType;
   }
709528
@SuppressWarnings("unchecked")
    public <E> MessageHandler<? super E> removeSentMessageHandler(Class<E> type) {
        sentMessageHandlerCache.clear();
        return (MessageHandler<? super E>) sentMessageHandlers.remove(type);
    }
567561
@Override
    public InputHandler getInputHandler(ProtocolType type, SIBUuid8 sourceMEUuid, JsMessage msg)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "getInputHandler", new Object[] { type, sourceMEUuid });

        InputHandler msgHandler = null;

        if (type == ProtocolType.UNICASTINPUT)
        {
            msgHandler = getInputHandler();
        }
        else if (type == ProtocolType.PUBSUBINPUT)
        {
            msgHandler = getInputHandler();
        }
        else if (type == ProtocolType.ANYCASTINPUT)
        {
            //Defer remote get inputHandler to the resolved destination
            msgHandler = _targetDestinationHandler.getInputHandler(type, sourceMEUuid, msg);
        }
        else
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(tc, "getInputHandler", "SIErrorException");
            //unsupported protocol type
            throw new SIErrorException(
                            nls.getFormattedMessage(
                                                    "INTERNAL_MESSAGING_ERROR_CWSIP0005",
                                                    new Object[] { "AbstractAliasDestinationHandler",
                                                                  "1:751:1.67.1.22",
                                                                  getBus() + " : " + getName() },
                                                    null));
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "getInputHandler", msgHandler);

        return msgHandler;
    }
1006848
public HandlerType<HandlerChainType<T>> getOrCreateHandler()
   {
      List<Node> nodeList = childNode.get("handler");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new HandlerTypeImpl<HandlerChainType<T>>(this, "handler", childNode, nodeList.get(0));
      }
      return createHandler();
   }
764122
protected boolean doTypeMappingCheck(EObject source, JvmType type, Procedure3<? super EObject, ? super JvmType, ? super String> errorHandler) {
		if (source != null && type != null) {
			final ExtraLanguageTypeConverter converter = getTypeConverter();
			final String qn = type.getQualifiedName();
			if (converter != null && !converter.hasConversion(qn)) {
				if (errorHandler != null) {
					errorHandler.apply(source, type, qn);
				}
				return false;
			}
		}
		return true;
	}
984993
public AutoCloseable registerHandler(
      final Class<? extends T> messageType,
      final EventHandler<RemoteMessage<? extends T>> theHandler) {

    this.msgTypeToHandlerMap.put(messageType, theHandler);

    LOG.log(Level.FINER, "Add handler for class: {0}", messageType.getCanonicalName());

    return new SubscriptionHandler<>(messageType, this.unsubscribeClass);
  }
1093596
@SuppressWarnings("unchecked")
    private static <T> Class<T> getGenericType(Class<?> thisClass)
    {
        Type type = thisClass;
        do
        {
            type = ((Class<?>)type).getGenericSuperclass();
            if (type instanceof ParameterizedType)
            {
                return (Class<T>)((ParameterizedType)type).getActualTypeArguments()[0];
            }
        }
        while (type instanceof Class<?> && !type.equals(AbstractFormatter.class));

        return (Class<T>)Object.class;
    }
781741
@Override
  public void addHttpHandler(final HttpHandler httpHandler) {
    LOG.log(Level.INFO, "addHttpHandler: {0}", httpHandler.getUriSpecification());
    jettyHandler.addHandler(httpHandler);
  }
207478
public Handler addHandler(Handler handler) throws JettyBootstrapException {
        JettyHandler jettyHandler = new JettyHandler();
        jettyHandler.setHandler(handler);

        handlers.addHandler(handler);

        return handler;
    }
331701
private TypeResolver getTypeResolver() {
        TypeResolver typeResolver = scannerContext.peek(TypeResolver.class);
        if (typeResolver == null) {
            throw new IllegalStateException("Cannot find Java type resolver.");
        }
        return typeResolver;
    }
140819
private static Constructor<? extends OptionHandler> getConstructor(Class<? extends OptionHandler> handlerClass) {
        try {
            return handlerClass.getConstructor(CmdLineParser.class, OptionDef.class, Setter.class);
        } catch (NoSuchMethodException e) {
            throw new IllegalArgumentException(Messages.NO_CONSTRUCTOR_ON_HANDLER.format(handlerClass));
        }
    }
127753
public <T> ISyncHandler<? super T, ? extends ISyncableData> getHandler(T caller)
	{
		@SuppressWarnings("unchecked")
		ISyncHandler<? super T, ? extends ISyncableData> handler = (ISyncHandler<? super T, ? extends ISyncableData>) handlers.get(caller.getClass());
		if (handler == null)
		{
			MalisisCore.log.error("No ISyncHandler registered for type '{}'", caller.getClass());
			return null;
		}

		return handler;
	}
240451
public static void registerInputStreamHandler(MimeType type, InputStreamHandler handler) {
        $.requireNotNull(handler);
        InputStreamHandlerDispatcher dispatcher = inputStreamHandlerLookup.get(type);
        if (null == dispatcher) {
            dispatcher = new InputStreamHandlerDispatcher(handler);
            inputStreamHandlerLookup.put(type, dispatcher);
        } else {
            dispatcher.add(handler);
        }
    }
1029441
private static <T extends Bean> MethodHandle findConstructorHandle(
            Class<T> beanType,
            MethodHandles.Lookup lookup,
            Constructor<?> constructor) {

        try {
            // spreader allows an Object[] to invoke the positional arguments
            MethodType constructorType = MethodType.methodType(Void.TYPE, constructor.getParameterTypes());
            MethodHandle baseHandle = lookup.findConstructor(beanType, constructorType)
                    .asSpreader(Object[].class, constructor.getParameterTypes().length);
            // change the return type so caller can use invokeExact()
            return baseHandle.asType(baseHandle.type().changeReturnType(Bean.class));
        } catch (NoSuchMethodException ex) {
            throw new IllegalArgumentException("Unable to find constructor: " + beanType.getSimpleName());
        } catch (IllegalAccessException ex) {
            throw new IllegalArgumentException("Unable to access constructor: " + beanType.getSimpleName());
        }
    }
354022
public <T extends TypedTagLibrary> T createInvoker(Class<T> type) {
        ProxyImpl handler = new ProxyImpl();
        Object proxy = Proxy.newProxyInstance(type.getClassLoader(), new Class[]{type}, handler);
        handler.setMetaClass(InvokerHelper.getMetaClass(proxy.getClass()));
        return type.cast(proxy);
    }