Package rife.template
Class EncoderSql
java.lang.Object
rife.template.EncoderSql
- All Implemented Interfaces:
TemplateEncoder
-
Method Summary
Modifier and TypeMethodDescriptionEncodes the given value, returning a string which contains only valid characters and represents the givenvalue
correctly in the output format.final String
encodeDefensive
(String value) Encodes the given value in a looser fashion thanTemplateEncoder.encode(java.lang.String)
's, only converting patterns which are explicitly not allowed by the output format, but not guaranteeing that the output value exactly represents the givenvalue
in the output format.static EncoderSql
instance()
-
Method Details
-
instance
-
encode
Description copied from interface:TemplateEncoder
Encodes the given value, returning a string which contains only valid characters and represents the givenvalue
correctly in the output format.For example, an HTML template's encoder will encode
>
as>
.- Specified by:
encode
in interfaceTemplateEncoder
- Parameters:
value
- a string- Returns:
- an encoded version of the given string
-
encodeDefensive
Description copied from interface:TemplateEncoder
Encodes the given value in a looser fashion thanTemplateEncoder.encode(java.lang.String)
's, only converting patterns which are explicitly not allowed by the output format, but not guaranteeing that the output value exactly represents the givenvalue
in the output format.For example, an HTML template's encoder will encode some Unicode characters to corresponding XML entities (such as
é
) when this method is called but not encode<
or&
.- Specified by:
encodeDefensive
in interfaceTemplateEncoder
- Parameters:
value
- a string- Returns:
- a loosely encoded version of the given
value
-