Java 类org.codehaus.jackson.map.SerializerFactory 实例源码

项目:class-guard    文件:MappingJacksonJsonViewTests.java   
@Test
public void renderWithCustomSerializerLocatedByFactory() throws Exception {
    SerializerFactory factory = new DelegatingSerializerFactory(null);
    ObjectMapper mapper = new ObjectMapper();
    mapper.setSerializerFactory(factory);
    view.setObjectMapper(mapper);

    Object bean = new TestBeanSimple();
    Map<String, Object> model = new HashMap<String, Object>();
    model.put("foo", bean);
    model.put("bar", new TestChildBean());
    view.render(model, request, response);

    String result = response.getContentAsString();
    assertTrue(result.length() > 0);
    assertTrue(result.contains("\"foo\":{\"testBeanSimple\":\"custom\"}"));
    validateResult();
}
项目:12306-android-Decompile    文件:BeanSerializerFactory.java   
public SerializerFactory withConfig(SerializerFactory.Config paramConfig)
{
  if (this._factoryConfig == paramConfig)
    return this;
  if (getClass() != BeanSerializerFactory.class)
    throw new IllegalStateException("Subtype of BeanSerializerFactory (" + getClass().getName() + ") has not properly overridden method 'withAdditionalSerializers': can not instantiate subtype with " + "additional serializer definitions");
  return new BeanSerializerFactory(paramConfig);
}
项目:12306-android-Decompile    文件:BeanSerializerFactory.java   
public SerializerFactory.Config withAdditionalKeySerializers(Serializers paramSerializers)
{
  if (paramSerializers == null)
    throw new IllegalArgumentException("Can not pass null Serializers");
  Serializers[] arrayOfSerializers = (Serializers[])ArrayBuilders.insertInListNoDup(this._additionalKeySerializers, paramSerializers);
  return new ConfigImpl(this._additionalSerializers, arrayOfSerializers, this._modifiers);
}
项目:12306-android-Decompile    文件:BeanSerializerFactory.java   
public SerializerFactory.Config withSerializerModifier(BeanSerializerModifier paramBeanSerializerModifier)
{
  if (paramBeanSerializerModifier == null)
    throw new IllegalArgumentException("Can not pass null modifier");
  BeanSerializerModifier[] arrayOfBeanSerializerModifier = (BeanSerializerModifier[])ArrayBuilders.insertInListNoDup(this._modifiers, paramBeanSerializerModifier);
  return new ConfigImpl(this._additionalSerializers, this._additionalKeySerializers, arrayOfBeanSerializerModifier);
}
项目:12306-android-Decompile    文件:StdSerializerProvider.java   
protected StdSerializerProvider(SerializationConfig paramSerializationConfig, StdSerializerProvider paramStdSerializerProvider, SerializerFactory paramSerializerFactory)
{
  super(paramSerializationConfig);
  if (paramSerializationConfig == null)
    throw new NullPointerException();
  this._serializerFactory = paramSerializerFactory;
  this._serializerCache = paramStdSerializerProvider._serializerCache;
  this._unknownTypeSerializer = paramStdSerializerProvider._unknownTypeSerializer;
  this._keySerializer = paramStdSerializerProvider._keySerializer;
  this._nullValueSerializer = paramStdSerializerProvider._nullValueSerializer;
  this._nullKeySerializer = paramStdSerializerProvider._nullKeySerializer;
  this._rootNames = paramStdSerializerProvider._rootNames;
  this._knownSerializers = this._serializerCache.getReadOnlyLookupMap();
}
项目:12306-android-Decompile    文件:StdSerializerProvider.java   
public JsonSchema generateJsonSchema(Class<?> paramClass, SerializationConfig paramSerializationConfig, SerializerFactory paramSerializerFactory)
  throws JsonMappingException
{
  if (paramClass == null)
    throw new IllegalArgumentException("A class must be provided");
  StdSerializerProvider localStdSerializerProvider = createInstance(paramSerializationConfig, paramSerializerFactory);
  if (localStdSerializerProvider.getClass() != getClass())
    throw new IllegalStateException("Broken serializer provider: createInstance returned instance of type " + localStdSerializerProvider.getClass() + "; blueprint of type " + getClass());
  JsonSerializer localJsonSerializer = localStdSerializerProvider.findValueSerializer(paramClass, null);
  if ((localJsonSerializer instanceof SchemaAware));
  for (JsonNode localJsonNode = ((SchemaAware)localJsonSerializer).getSchema(localStdSerializerProvider, null); !(localJsonNode instanceof ObjectNode); localJsonNode = JsonSchema.getDefaultSchemaNode())
    throw new IllegalArgumentException("Class " + paramClass.getName() + " would not be serialized as a JSON object and therefore has no schema");
  return new JsonSchema((ObjectNode)localJsonNode);
}
项目:12306-android-Decompile    文件:StdSerializerProvider.java   
public final void serializeValue(SerializationConfig paramSerializationConfig, JsonGenerator paramJsonGenerator, Object paramObject, SerializerFactory paramSerializerFactory)
  throws IOException, JsonGenerationException
{
  if (paramSerializerFactory == null)
    throw new IllegalArgumentException("Can not pass null serializerFactory");
  StdSerializerProvider localStdSerializerProvider = createInstance(paramSerializationConfig, paramSerializerFactory);
  if (localStdSerializerProvider.getClass() != getClass())
    throw new IllegalStateException("Broken serializer provider: createInstance returned instance of type " + localStdSerializerProvider.getClass() + "; blueprint of type " + getClass());
  localStdSerializerProvider._serializeValue(paramJsonGenerator, paramObject);
}
项目:12306-android-Decompile    文件:StdSerializerProvider.java   
public final void serializeValue(SerializationConfig paramSerializationConfig, JsonGenerator paramJsonGenerator, Object paramObject, JavaType paramJavaType, SerializerFactory paramSerializerFactory)
  throws IOException, JsonGenerationException
{
  if (paramSerializerFactory == null)
    throw new IllegalArgumentException("Can not pass null serializerFactory");
  StdSerializerProvider localStdSerializerProvider = createInstance(paramSerializationConfig, paramSerializerFactory);
  if (localStdSerializerProvider.getClass() != getClass())
    throw new IllegalStateException("Broken serializer provider: createInstance returned instance of type " + localStdSerializerProvider.getClass() + "; blueprint of type " + getClass());
  localStdSerializerProvider._serializeValue(paramJsonGenerator, paramObject, paramJavaType);
}
项目:12306-android-Decompile    文件:BeanSerializerFactory.java   
public SerializerFactory withConfig(SerializerFactory.Config paramConfig)
{
  if (this._factoryConfig == paramConfig)
    return this;
  if (getClass() != BeanSerializerFactory.class)
    throw new IllegalStateException("Subtype of BeanSerializerFactory (" + getClass().getName() + ") has not properly overridden method 'withAdditionalSerializers': can not instantiate subtype with " + "additional serializer definitions");
  return new BeanSerializerFactory(paramConfig);
}
项目:12306-android-Decompile    文件:BeanSerializerFactory.java   
public SerializerFactory.Config withAdditionalKeySerializers(Serializers paramSerializers)
{
  if (paramSerializers == null)
    throw new IllegalArgumentException("Can not pass null Serializers");
  Serializers[] arrayOfSerializers = (Serializers[])ArrayBuilders.insertInListNoDup(this._additionalKeySerializers, paramSerializers);
  return new ConfigImpl(this._additionalSerializers, arrayOfSerializers, this._modifiers);
}
项目:12306-android-Decompile    文件:BeanSerializerFactory.java   
public SerializerFactory.Config withSerializerModifier(BeanSerializerModifier paramBeanSerializerModifier)
{
  if (paramBeanSerializerModifier == null)
    throw new IllegalArgumentException("Can not pass null modifier");
  BeanSerializerModifier[] arrayOfBeanSerializerModifier = (BeanSerializerModifier[])ArrayBuilders.insertInListNoDup(this._modifiers, paramBeanSerializerModifier);
  return new ConfigImpl(this._additionalSerializers, this._additionalKeySerializers, arrayOfBeanSerializerModifier);
}
项目:12306-android-Decompile    文件:StdSerializerProvider.java   
protected StdSerializerProvider(SerializationConfig paramSerializationConfig, StdSerializerProvider paramStdSerializerProvider, SerializerFactory paramSerializerFactory)
{
  super(paramSerializationConfig);
  if (paramSerializationConfig == null)
    throw new NullPointerException();
  this._serializerFactory = paramSerializerFactory;
  this._serializerCache = paramStdSerializerProvider._serializerCache;
  this._unknownTypeSerializer = paramStdSerializerProvider._unknownTypeSerializer;
  this._keySerializer = paramStdSerializerProvider._keySerializer;
  this._nullValueSerializer = paramStdSerializerProvider._nullValueSerializer;
  this._nullKeySerializer = paramStdSerializerProvider._nullKeySerializer;
  this._rootNames = paramStdSerializerProvider._rootNames;
  this._knownSerializers = this._serializerCache.getReadOnlyLookupMap();
}
项目:12306-android-Decompile    文件:StdSerializerProvider.java   
public JsonSchema generateJsonSchema(Class<?> paramClass, SerializationConfig paramSerializationConfig, SerializerFactory paramSerializerFactory)
  throws JsonMappingException
{
  if (paramClass == null)
    throw new IllegalArgumentException("A class must be provided");
  StdSerializerProvider localStdSerializerProvider = createInstance(paramSerializationConfig, paramSerializerFactory);
  if (localStdSerializerProvider.getClass() != getClass())
    throw new IllegalStateException("Broken serializer provider: createInstance returned instance of type " + localStdSerializerProvider.getClass() + "; blueprint of type " + getClass());
  JsonSerializer localJsonSerializer = localStdSerializerProvider.findValueSerializer(paramClass, null);
  if ((localJsonSerializer instanceof SchemaAware));
  for (JsonNode localJsonNode = ((SchemaAware)localJsonSerializer).getSchema(localStdSerializerProvider, null); !(localJsonNode instanceof ObjectNode); localJsonNode = JsonSchema.getDefaultSchemaNode())
    throw new IllegalArgumentException("Class " + paramClass.getName() + " would not be serialized as a JSON object and therefore has no schema");
  return new JsonSchema((ObjectNode)localJsonNode);
}
项目:12306-android-Decompile    文件:StdSerializerProvider.java   
public final void serializeValue(SerializationConfig paramSerializationConfig, JsonGenerator paramJsonGenerator, Object paramObject, SerializerFactory paramSerializerFactory)
  throws IOException, JsonGenerationException
{
  if (paramSerializerFactory == null)
    throw new IllegalArgumentException("Can not pass null serializerFactory");
  StdSerializerProvider localStdSerializerProvider = createInstance(paramSerializationConfig, paramSerializerFactory);
  if (localStdSerializerProvider.getClass() != getClass())
    throw new IllegalStateException("Broken serializer provider: createInstance returned instance of type " + localStdSerializerProvider.getClass() + "; blueprint of type " + getClass());
  localStdSerializerProvider._serializeValue(paramJsonGenerator, paramObject);
}
项目:12306-android-Decompile    文件:StdSerializerProvider.java   
public final void serializeValue(SerializationConfig paramSerializationConfig, JsonGenerator paramJsonGenerator, Object paramObject, JavaType paramJavaType, SerializerFactory paramSerializerFactory)
  throws IOException, JsonGenerationException
{
  if (paramSerializerFactory == null)
    throw new IllegalArgumentException("Can not pass null serializerFactory");
  StdSerializerProvider localStdSerializerProvider = createInstance(paramSerializationConfig, paramSerializerFactory);
  if (localStdSerializerProvider.getClass() != getClass())
    throw new IllegalStateException("Broken serializer provider: createInstance returned instance of type " + localStdSerializerProvider.getClass() + "; blueprint of type " + getClass());
  localStdSerializerProvider._serializeValue(paramJsonGenerator, paramObject, paramJavaType);
}
项目:ingress-indonesia-dev    文件:BeanSerializerFactory.java   
public SerializerFactory withConfig(SerializerFactory.Config paramConfig)
{
  if (this._factoryConfig == paramConfig)
    return this;
  if (getClass() != BeanSerializerFactory.class)
    throw new IllegalStateException("Subtype of BeanSerializerFactory (" + getClass().getName() + ") has not properly overridden method 'withAdditionalSerializers': can not instantiate subtype with additional serializer definitions");
  return new BeanSerializerFactory(paramConfig);
}
项目:ingress-indonesia-dev    文件:StdSerializerProvider.java   
protected StdSerializerProvider(SerializationConfig paramSerializationConfig, StdSerializerProvider paramStdSerializerProvider, SerializerFactory paramSerializerFactory)
{
  super(paramSerializationConfig);
  if (paramSerializationConfig == null)
    throw new NullPointerException();
  this._serializerFactory = paramSerializerFactory;
  this._serializerCache = paramStdSerializerProvider._serializerCache;
  this._unknownTypeSerializer = paramStdSerializerProvider._unknownTypeSerializer;
  this._keySerializer = paramStdSerializerProvider._keySerializer;
  this._nullValueSerializer = paramStdSerializerProvider._nullValueSerializer;
  this._nullKeySerializer = paramStdSerializerProvider._nullKeySerializer;
  this._rootNames = paramStdSerializerProvider._rootNames;
  this._knownSerializers = this._serializerCache.getReadOnlyLookupMap();
}
项目:ingress-indonesia-dev    文件:StdSerializerProvider.java   
public final void serializeValue(SerializationConfig paramSerializationConfig, JsonGenerator paramJsonGenerator, Object paramObject, SerializerFactory paramSerializerFactory)
{
  if (paramSerializerFactory == null)
    throw new IllegalArgumentException("Can not pass null serializerFactory");
  StdSerializerProvider localStdSerializerProvider = createInstance(paramSerializationConfig, paramSerializerFactory);
  if (localStdSerializerProvider.getClass() != getClass())
    throw new IllegalStateException("Broken serializer provider: createInstance returned instance of type " + localStdSerializerProvider.getClass() + "; blueprint of type " + getClass());
  localStdSerializerProvider._serializeValue(paramJsonGenerator, paramObject);
}
项目:bscl    文件:StdEscapeHTMLSerializerProvider.java   
public StdEscapeHTMLSerializerProvider(SerializationConfig config, StdEscapeHTMLSerializerProvider src, SerializerFactory jsf) {
    super(config, src, jsf);
}
项目:12306-android-Decompile    文件:CustomSerializerFactory.java   
public CustomSerializerFactory(SerializerFactory.Config paramConfig)
{
  super(paramConfig);
}
项目:12306-android-Decompile    文件:CustomSerializerFactory.java   
public SerializerFactory withConfig(SerializerFactory.Config paramConfig)
{
  if (getClass() != CustomSerializerFactory.class)
    throw new IllegalStateException("Subtype of CustomSerializerFactory (" + getClass().getName() + ") has not properly overridden method 'withAdditionalSerializers': can not instantiate subtype with " + "additional serializer definitions");
  return new CustomSerializerFactory(paramConfig);
}
项目:12306-android-Decompile    文件:BeanSerializerFactory.java   
protected BeanSerializerFactory(SerializerFactory.Config paramConfig)
{
  if (paramConfig == null)
    paramConfig = new ConfigImpl();
  this._factoryConfig = paramConfig;
}
项目:12306-android-Decompile    文件:BeanSerializerFactory.java   
public SerializerFactory.Config getConfig()
{
  return this._factoryConfig;
}
项目:12306-android-Decompile    文件:BeanSerializerFactory.java   
public SerializerFactory.Config withAdditionalSerializers(Serializers paramSerializers)
{
  if (paramSerializers == null)
    throw new IllegalArgumentException("Can not pass null Serializers");
  return new ConfigImpl((Serializers[])ArrayBuilders.insertInListNoDup(this._additionalSerializers, paramSerializers), this._additionalKeySerializers, this._modifiers);
}
项目:12306-android-Decompile    文件:StdSerializerProvider.java   
protected StdSerializerProvider createInstance(SerializationConfig paramSerializationConfig, SerializerFactory paramSerializerFactory)
{
  return new StdSerializerProvider(paramSerializationConfig, this, paramSerializerFactory);
}
项目:12306-android-Decompile    文件:StdSerializerProvider.java   
public boolean hasSerializerFor(SerializationConfig paramSerializationConfig, Class<?> paramClass, SerializerFactory paramSerializerFactory)
{
  return createInstance(paramSerializationConfig, paramSerializerFactory)._findExplicitUntypedSerializer(paramClass, null) != null;
}
项目:12306-android-Decompile    文件:CustomSerializerFactory.java   
public CustomSerializerFactory(SerializerFactory.Config paramConfig)
{
  super(paramConfig);
}
项目:12306-android-Decompile    文件:CustomSerializerFactory.java   
public SerializerFactory withConfig(SerializerFactory.Config paramConfig)
{
  if (getClass() != CustomSerializerFactory.class)
    throw new IllegalStateException("Subtype of CustomSerializerFactory (" + getClass().getName() + ") has not properly overridden method 'withAdditionalSerializers': can not instantiate subtype with " + "additional serializer definitions");
  return new CustomSerializerFactory(paramConfig);
}
项目:12306-android-Decompile    文件:BeanSerializerFactory.java   
protected BeanSerializerFactory(SerializerFactory.Config paramConfig)
{
  if (paramConfig == null)
    paramConfig = new ConfigImpl();
  this._factoryConfig = paramConfig;
}
项目:12306-android-Decompile    文件:BeanSerializerFactory.java   
public SerializerFactory.Config getConfig()
{
  return this._factoryConfig;
}
项目:12306-android-Decompile    文件:BeanSerializerFactory.java   
public SerializerFactory.Config withAdditionalSerializers(Serializers paramSerializers)
{
  if (paramSerializers == null)
    throw new IllegalArgumentException("Can not pass null Serializers");
  return new ConfigImpl((Serializers[])ArrayBuilders.insertInListNoDup(this._additionalSerializers, paramSerializers), this._additionalKeySerializers, this._modifiers);
}
项目:12306-android-Decompile    文件:StdSerializerProvider.java   
protected StdSerializerProvider createInstance(SerializationConfig paramSerializationConfig, SerializerFactory paramSerializerFactory)
{
  return new StdSerializerProvider(paramSerializationConfig, this, paramSerializerFactory);
}
项目:12306-android-Decompile    文件:StdSerializerProvider.java   
public boolean hasSerializerFor(SerializationConfig paramSerializationConfig, Class<?> paramClass, SerializerFactory paramSerializerFactory)
{
  return createInstance(paramSerializationConfig, paramSerializerFactory)._findExplicitUntypedSerializer(paramClass, null) != null;
}
项目:ingress-indonesia-dev    文件:BeanSerializerFactory.java   
protected BeanSerializerFactory(SerializerFactory.Config paramConfig)
{
  if (paramConfig == null)
    paramConfig = new BeanSerializerFactory.ConfigImpl();
  this._factoryConfig = paramConfig;
}
项目:ingress-indonesia-dev    文件:BeanSerializerFactory.java   
public SerializerFactory.Config getConfig()
{
  return this._factoryConfig;
}
项目:ingress-indonesia-dev    文件:StdSerializerProvider.java   
protected StdSerializerProvider createInstance(SerializationConfig paramSerializationConfig, SerializerFactory paramSerializerFactory)
{
  return new StdSerializerProvider(paramSerializationConfig, this, paramSerializerFactory);
}
项目:bscl    文件:StdEscapeHTMLSerializerProvider.java   
/**
 * 重写createInstance函数
 *
 * @param config
 * @param jsf
 * @return
 */
@Override
protected StdSerializerProvider createInstance(SerializationConfig config, SerializerFactory jsf) {
    return new StdEscapeHTMLSerializerProvider(config, this, jsf);
}