Package sk.iway.iwcm.system.jpa
Class AllowSafeHtmlAttributeConverterWithSave
java.lang.Object
sk.iway.iwcm.system.jpa.AllowSafeHtmlAttributeConverterWithSave
public class AllowSafeHtmlAttributeConverterWithSave
extends Object
implements jakarta.persistence.AttributeConverter<String,String>
Retains safe HTML on both database writes and reads, including legacy rows.
This explicit protection is independent of the
jpaentity HTML bypass.
JDBC callers must invoke sanitize(String) themselves; JPA annotations
do not apply to native SQL. Use this converter for HTML fragments, not URLs.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToDatabaseColumn(String value) convertToEntityAttribute(String value) static StringApplies the shared safe HTML policy without decoding legacy title notation.
-
Constructor Details
-
AllowSafeHtmlAttributeConverterWithSave
public AllowSafeHtmlAttributeConverterWithSave()
-
-
Method Details
-
convertToDatabaseColumn
-
convertToEntityAttribute
-
sanitize
Applies the shared safe HTML policy without decoding legacy title notation.- Parameters:
value- HTML fragment, possibly loaded or saved through JDBC- Returns:
- sanitized HTML, preserving
null
-