/** * Method called to handle a direct self-reference through this property. * Method can choose to indicate an error by throwing * {@link JsonMappingException}; fully handle serialization (and return * true); or indicate that it should be serialized normally (return false). * <p> * Default implementation will throw {@link JsonMappingException} if * {@link SerializationFeature#FAIL_ON_SELF_REFERENCES} is enabled; or * return <code>false</code> if it is disabled. * * @return True if method fully handled self-referential value; false if not * (caller is to handle it) or {@link JsonMappingException} if there * is no way handle it */ protected boolean _handleSelfReference(Object bean, JsonGenerator gen, SerializerProvider prov, JsonSerializer<?> ser) throws JsonMappingException { if (prov.isEnabled(SerializationFeature.FAIL_ON_SELF_REFERENCES) && !ser.usesObjectId()) { // 05-Feb-2013, tatu: Usually a problem, but NOT if we are handling // object id; this may be the case for BeanSerializers at least. // 13-Feb-2014, tatu: another possible ok case: custom serializer // (something // OTHER than {@link BeanSerializerBase} if (ser instanceof BeanSerializerBase) { prov.reportBadDefinition(getType(), "Direct self-reference leading to cycle"); } } return false; }
@Override public boolean usesObjectId() { return _serializer.usesObjectId(); }
@Override public boolean usesObjectId() { return _serializer.usesObjectId(); }
@Override public boolean usesObjectId() { return _serializer.usesObjectId(); }
@Override public boolean usesObjectId() { return _serializer.usesObjectId(); }
@Override public boolean usesObjectId() { return _serializer.usesObjectId(); }
@Override public boolean usesObjectId() { return _serializer.usesObjectId(); }
protected void _handleSelfReference(Object bean, JsonSerializer<?> ser) throws JsonMappingException { /* 05-Feb-2012, tatu: Usually a problem, but NOT if we are handling * object id; this may be the case for BeanSerializers at least. */ if (ser.usesObjectId()) { return; } throw new JsonMappingException("Direct self-reference leading to cycle"); }
protected void _handleSelfReference(Object bean, JsonSerializer<?> ser) throws JsonMappingException { /* 05-Feb-2012, tatu: Usually a problem, but NOT if we are handling * object id; this may be the case for BeanSerializers at least. */ if (ser.usesObjectId()) { return; } throw new JsonMappingException("Direct self-reference leading to cycle"); }
protected void _handleSelfReference(Object bean, JsonSerializer<?> ser) throws JsonMappingException { /* 05-Feb-2012, tatu: Usually a problem, but NOT if we are handling * object id; this may be the case for BeanSerializers at least. */ if (ser.usesObjectId()) { return; } throw new JsonMappingException("Direct self-reference leading to cycle"); }
/** * Method called to handle a direct self-reference through this property. * Method can choose to indicate an error by throwing {@link JsonMappingException}; * fully handle serialization (and return true); or indicate that it should be * serialized normally (return false). *<p> * Default implementation will throw {@link JsonMappingException} if * {@link SerializationFeature#FAIL_ON_SELF_REFERENCES} is enabled; * or return <code>false</code> if it is disabled. * * @return True if method fully handled self-referential value; false if not (caller * is to handle it) or {@link JsonMappingException} if there is no way handle it */ protected boolean _handleSelfReference(Object bean, JsonGenerator gen, SerializerProvider prov, JsonSerializer<?> ser) throws JsonMappingException { if (prov.isEnabled(SerializationFeature.FAIL_ON_SELF_REFERENCES) && !ser.usesObjectId()) { // 05-Feb-2013, tatu: Usually a problem, but NOT if we are handling // object id; this may be the case for BeanSerializers at least. // 13-Feb-2014, tatu: another possible ok case: custom serializer (something // OTHER than {@link BeanSerializerBase} if (ser instanceof BeanSerializerBase) { throw new JsonMappingException("Direct self-reference leading to cycle"); } } return false; }
/** * Method called to handle a direct self-reference through this property. * Method can choose to indicate an error by throwing {@link JsonMappingException}; * fully handle serialization (and return true); or indicate that it should be * serialized normally (return false). *<p> * Default implementation will throw {@link JsonMappingException} if * {@link SerializationFeature#FAIL_ON_SELF_REFERENCES} is enabled; * or return <code>false</code> if it is disabled. * * @return True if method fully handled self-referential value; false if not (caller * is to handle it) or {@link JsonMappingException} if there is no way handle it */ protected boolean _handleSelfReference(Object bean, JsonGenerator gen, SerializerProvider prov, JsonSerializer<?> ser) throws JsonMappingException { if (prov.isEnabled(SerializationFeature.FAIL_ON_SELF_REFERENCES) && !ser.usesObjectId()) { // 05-Feb-2013, tatu: Usually a problem, but NOT if we are handling // object id; this may be the case for BeanSerializers at least. // 13-Feb-2014, tatu: another possible ok case: custom serializer (something // OTHER than {@link BeanSerializerBase} if (ser instanceof BeanSerializerBase) { throw new JsonMappingException("Direct self-reference leading to cycle"); } } return false; }
/** * Method called to handle a direct self-reference through this property. * Method can choose to indicate an error by throwing * {@link JsonMappingException}; fully handle serialization (and return * true); or indicate that it should be serialized normally (return false). * <p> * Default implementation will throw {@link JsonMappingException} if * {@link SerializationFeature#FAIL_ON_SELF_REFERENCES} is enabled; or * return <code>false</code> if it is disabled. * * @return True if method fully handled self-referential value; false if not * (caller is to handle it) or {@link JsonMappingException} if there * is no way handle it */ protected boolean _handleSelfReference(Object bean, JsonGenerator gen, SerializerProvider prov, JsonSerializer<?> ser) throws JsonMappingException { if (prov.isEnabled(SerializationFeature.FAIL_ON_SELF_REFERENCES) && !ser.usesObjectId()) { // 05-Feb-2013, tatu: Usually a problem, but NOT if we are handling // object id; this may be the case for BeanSerializers at least. // 13-Feb-2014, tatu: another possible ok case: custom serializer // (something // OTHER than {@link BeanSerializerBase} if (ser instanceof BeanSerializerBase) { prov.reportMappingProblem("Direct self-reference leading to cycle"); } } return false; }
/** * Method called to handle a direct self-reference through this property. * Method can choose to indicate an error by throwing * {@link JsonMappingException}; fully handle serialization (and return * true); or indicate that it should be serialized normally (return false). * <p> * Default implementation will throw {@link JsonMappingException} if * {@link SerializationFeature#FAIL_ON_SELF_REFERENCES} is enabled; or * return <code>false</code> if it is disabled. * * @return True if method fully handled self-referential value; false if not * (caller is to handle it) or {@link JsonMappingException} if there * is no way handle it */ protected boolean _handleSelfReference(Object bean, JsonGenerator gen, SerializerProvider prov, JsonSerializer<?> ser) throws JsonMappingException { if (prov.isEnabled(SerializationFeature.FAIL_ON_SELF_REFERENCES) && !ser.usesObjectId()) { // 05-Feb-2013, tatu: Usually a problem, but NOT if we are handling // object id; this may be the case for BeanSerializers at least. // 13-Feb-2014, tatu: another possible ok case: custom serializer // (something // OTHER than {@link BeanSerializerBase} if (ser instanceof BeanSerializerBase) { prov.reportBadDefinition(getType(), "Direct self-reference leading to cycle"); } } return false; }