org.jboss.resteasy.spi.StringParameterUnmarshaller Java Examples

The following examples show how to use org.jboss.resteasy.spi.StringParameterUnmarshaller. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SisuResteasyProviderFactory.java    From nexus-public with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Unregisters a @Provider type from this factory.
 */
public void removeRegistrations(final Class<?> type) {
  checkNotNull(type);

  log.debug("Removing registrations for: {}", type.getName());

  classContracts.remove(type);

  removeInstancesOf(type, providerInstances);
  providerClasses.remove(type);

  if (ExceptionMapper.class.isAssignableFrom(type)) {
    removeInstancesOf(type, exceptionMappers.values());
  }
  else if (MessageBodyReader.class.isAssignableFrom(type)) {
    clearInstancesOf(type, clientMessageBodyReaders, DUMMY_READER);
    clearInstancesOf(type, serverMessageBodyReaders, DUMMY_READER);
  }
  else if (MessageBodyWriter.class.isAssignableFrom(type)) {
    clearInstancesOf(type, clientMessageBodyWriters, DUMMY_WRITER);
    clearInstancesOf(type, serverMessageBodyWriters, DUMMY_WRITER);
  }
  else if (ContextResolver.class.isAssignableFrom(type)) {
    Type[] args = Types.getActualTypeArgumentsOfAnInterface(type, ContextResolver.class);
    contextResolvers.remove(Types.getRawType(args[0]));
  }
  else if (Feature.class.isAssignableFrom(type)) {
    removeInstancesOf(type, featureInstances);
    removeInstancesOf(type, enabledFeatures);
    featureClasses.remove(type);
  }
  else if (DynamicFeature.class.isAssignableFrom(type)) {
    removeInstancesOf(type, clientDynamicFeatures);
    removeInstancesOf(type, serverDynamicFeatures);
  }
  else if (ParamConverterProvider.class.isAssignableFrom(type)) {
    removeInstancesOf(type, paramConverterProviders);
  }
  else if (StringConverter.class.isAssignableFrom(type)) {
    removeInstancesOf(type, stringConverters.values());
  }
  else if (StringParameterUnmarshaller.class.isAssignableFrom(type)) {
    stringParameterUnmarshallers.values().remove(type);
  }
  else {
    log.warn("Unable to remove registrations for: {}", type.getName());
  }
}