Class MarkupCoercion


  • public final class MarkupCoercion
    extends Object
    Coerces objects to String compatible with JSP Expression Language (JSP EL) and the Java Standard Taglib (JSTL). Also adds support for seamless output of XML DOM nodes.
    Author:
    AO Industries, Inc.
    See Also:
    Coercion
    • Method Detail

      • write

        public static void write​(Object value,
                                 MarkupType markupType,
                                 boolean encodeLookupMarkup,
                                 Encoder encoder,
                                 boolean encoderPrefixSuffix,
                                 Writer out)
                          throws IOException
        Encodes an object's String representation with markup enabled using the provided encoder, supporting streaming for specialized types.
        Parameters:
        encodeLookupMarkup -

        Does the lookup markup need to be encoded?

        When encodeLookupMarkup = true:

        1. Write markup prefix without encoding
        2. Write any encoder prefix
        3. Write value with encoding
        4. Write any encoder suffix
        5. Write markup suffix without encoding

        When encodeLookupMarkup = false:

        1. Write any encoder prefix
        2. Write markup prefix with encoding
        3. Write value with encoding
        4. Write markup suffix with encoding
        5. Write any encoder suffix
        encoder - no encoding performed when null
        encoderPrefixSuffix - This includes the encoder prefix and suffix.
        Throws:
        IOException
        See Also:
        MarkupType
      • append

        public static void append​(Object value,
                                  MarkupType markupType,
                                  boolean encodeLookupMarkup,
                                  Encoder encoder,
                                  boolean encoderPrefixSuffix,
                                  Appendable out)
                           throws IOException
        Encodes an object's String representation with markup enabled using the provided encoder, supporting streaming for specialized types.
        Parameters:
        encodeLookupMarkup -

        Does the lookup markup need to be encoded?

        When encodeLookupMarkup = true:

        1. Write markup prefix without encoding
        2. Write any encoder prefix
        3. Write value with encoding
        4. Write any encoder suffix
        5. Write markup suffix without encoding

        When encodeLookupMarkup = false:

        1. Write any encoder prefix
        2. Write markup prefix with encoding
        3. Write value with encoding
        4. Write markup suffix with encoding
        5. Write any encoder suffix
        encoder - no encoding performed when null
        encoderPrefixSuffix - This includes the encoder prefix and suffix.
        Throws:
        IOException
        See Also:
        MarkupType