Examples of escape()

@param string the literal string to be escaped @return the escaped form of {@code string} @throws NullPointerException if {@code string} is null @throws IllegalArgumentException if {@code string} contains badly formed UTF-16 or cannot beescaped for any other reason
  • com.google.common.escape.UnicodeEscaper.escape()
    Returns the escaped form of the given Unicode code point, or {@code null}if this code point does not need to be escaped. When called as part of an escaping operation, the given code point is guaranteed to be in the range {@code 0 <= cp <= Character#MAX_CODE_POINT}.

    If an empty array is returned, this effectively strips the input character from the resulting text.

    If the character does not need to be escaped, this method should return {@code null}, rather than an array containing the character representation of the code point. This enables the escaping algorithm to perform more efficiently.

    If the implementation of this method cannot correctly handle a particular code point then it should either throw an appropriate runtime exception or return a suitable replacement character. It must never silently discard invalid input as this may constitute a security risk. @param cp the Unicode code point to escape if necessary @return the replacement characters, or {@code null} if no escaping wasneeded

  • com.google.template.soy.internal.base.CharEscaper.escape()
    Returns the escaped form of a given literal string. @param string the literal string to be escaped @return the escaped form of {@code string} @throws NullPointerException if {@code string} is null
  • org.apache.lucene.queryParser.MultiFieldQueryParserSettings.escape()
  • org.apache.lucene.queryParser.QueryParserSettings.escape()
  • org.apache.lucene.queryparser.classic.QueryParserSettings.escape()
  • org.crsh.cli.impl.Delimiter.escape()
  • org.eclipse.persistence.internal.oxm.CharacterEscapeHandler.escape()

    Perform character escaping and write the result to the output.

    Note: This feature is not supported when marshalling to the following targets:

    @param buffer Array of characters to be escaped @param start The starting position @param length The number of characters being escaped @param isAttributeValue A value of 'true' indicates this is an attribute value @param out The resulting escaped characters will be written to this Writer @throws IOException In an error condition, IOException can be thrown to stop the marshalling process
  • org.eclipse.persistence.oxm.CharacterEscapeHandler.escape()

    Perform character escaping and write the result to the output.

    Note: This feature is not supported when marshalling to the following targets:

    @param buffer Array of characters to be escaped @param start The starting position @param length The number of characters being escaped @param isAttributeValue A value of 'true' indicates this is an attribute value @param out The resulting escaped characters will be written to this Writer @throws IOException In an error condition, IOException can be thrown to stop the marshalling process
  • org.jmol.script.ScriptVariable.escape()
  • org.jruby.runtime.Block.escape()
  • org.rythmengine.extension.ICodeType.escape()
    Return escape scheme @return escape
  • org.waveprotocol.wave.util.escapers.PercentEscaper.escape()

  • Examples of com.eteks.sweethome3d.viewcontroller.PlanController.escape()

        planController.moveMouse(60, 60);
        // Check first wall is selected and that it moved
        assertSelectionContains(home, wall1);
        assertCoordinatesEqualWallPoints(20, 60, 504, 60, wall1);
        // Lose focus
        planController.escape();
        // Check the wall didn't move at end
        assertCoordinatesEqualWallPoints(20, 20, 504, 20, wall1);

        // 10. Undo 8 times
        for (int i = 0; i < 6; i++) {
    View Full Code Here

    Examples of com.google.appengine.repackaged.com.google.common.escape.Escaper.escape()

        StringBuilder xmlContent = new StringBuilder(Iterables.size(source) * 50);
        xmlContent.append("<ComposeRequest>");
        Escaper escaper = XmlEscapers.xmlContentEscaper();
        for (String srcFileName : source) {
          xmlContent.append("<Component><Name>");
          xmlContent.append(escaper.escape(srcFileName));
          xmlContent.append("</Name></Component>");
        }
        xmlContent.append("</ComposeRequest>");
        byte[] payload = xmlContent.toString().getBytes(UTF_8);
        req.setHeader(new HTTPHeader(CONTENT_LENGTH, String.valueOf(payload.length)));
    View Full Code Here

    Examples of com.google.common.escape.CharEscaper.escape()

      public void testXmlContentEscaper() throws Exception {
        CharEscaper xmlContentEscaper = (CharEscaper) XmlEscapers.xmlContentEscaper();
        assertBasicXmlEscaper(xmlContentEscaper, false, false);
        // Test quotes are not escaped.
        assertEquals("\"test\"", xmlContentEscaper.escape("\"test\""));
        assertEquals("'test'", xmlContentEscaper.escape("'test'"));
      }

      public void testXmlAttributeEscaper() throws Exception {
        CharEscaper xmlAttributeEscaper = (CharEscaper) XmlEscapers.xmlAttributeEscaper();
    View Full Code Here

    Examples of com.google.common.escape.CharEscaper.escape()

      public void testXmlContentEscaper() throws Exception {
        CharEscaper xmlContentEscaper = (CharEscaper) XmlEscapers.xmlContentEscaper();
        assertBasicXmlEscaper(xmlContentEscaper, false, false);
        // Test quotes are not escaped.
        assertEquals("\"test\"", xmlContentEscaper.escape("\"test\""));
        assertEquals("'test'", xmlContentEscaper.escape("'test'"));
      }

      public void testXmlAttributeEscaper() throws Exception {
        CharEscaper xmlAttributeEscaper = (CharEscaper) XmlEscapers.xmlAttributeEscaper();
        assertBasicXmlEscaper(xmlAttributeEscaper, true, true);
    View Full Code Here

    Examples of com.google.common.escape.CharEscaper.escape()

      public void testXmlAttributeEscaper() throws Exception {
        CharEscaper xmlAttributeEscaper = (CharEscaper) XmlEscapers.xmlAttributeEscaper();
        assertBasicXmlEscaper(xmlAttributeEscaper, true, true);
        // Test quotes are escaped.
        assertEquals("&quot;test&quot;", xmlAttributeEscaper.escape("\"test\""));
        assertEquals("&apos;test&apos;", xmlAttributeEscaper.escape("\'test'"));
        // Test all escapes
        assertEquals("a&quot;b&lt;c&gt;d&amp;e&quot;f&apos;",
            xmlAttributeEscaper.escape("a\"b<c>d&e\"f'"));
        // Test '\t', '\n' and '\r' are escaped.
    View Full Code Here

    Examples of com.google.common.escape.CharEscaper.escape()

      public void testXmlAttributeEscaper() throws Exception {
        CharEscaper xmlAttributeEscaper = (CharEscaper) XmlEscapers.xmlAttributeEscaper();
        assertBasicXmlEscaper(xmlAttributeEscaper, true, true);
        // Test quotes are escaped.
        assertEquals("&quot;test&quot;", xmlAttributeEscaper.escape("\"test\""));
        assertEquals("&apos;test&apos;", xmlAttributeEscaper.escape("\'test'"));
        // Test all escapes
        assertEquals("a&quot;b&lt;c&gt;d&amp;e&quot;f&apos;",
            xmlAttributeEscaper.escape("a\"b<c>d&e\"f'"));
        // Test '\t', '\n' and '\r' are escaped.
        assertEquals("a&#x9;b&#xA;c&#xD;d", xmlAttributeEscaper.escape("a\tb\nc\rd"));
    View Full Code Here

    Examples of com.google.common.escape.CharEscaper.escape()

        // Test quotes are escaped.
        assertEquals("&quot;test&quot;", xmlAttributeEscaper.escape("\"test\""));
        assertEquals("&apos;test&apos;", xmlAttributeEscaper.escape("\'test'"));
        // Test all escapes
        assertEquals("a&quot;b&lt;c&gt;d&amp;e&quot;f&apos;",
            xmlAttributeEscaper.escape("a\"b<c>d&e\"f'"));
        // Test '\t', '\n' and '\r' are escaped.
        assertEquals("a&#x9;b&#xA;c&#xD;d", xmlAttributeEscaper.escape("a\tb\nc\rd"));
      }

      // Helper to assert common properties of xml escapers.
    View Full Code Here

    Examples of com.google.common.escape.CharEscaper.escape()

        assertEquals("&apos;test&apos;", xmlAttributeEscaper.escape("\'test'"));
        // Test all escapes
        assertEquals("a&quot;b&lt;c&gt;d&amp;e&quot;f&apos;",
            xmlAttributeEscaper.escape("a\"b<c>d&e\"f'"));
        // Test '\t', '\n' and '\r' are escaped.
        assertEquals("a&#x9;b&#xA;c&#xD;d", xmlAttributeEscaper.escape("a\tb\nc\rd"));
      }

      // Helper to assert common properties of xml escapers.
      private void assertBasicXmlEscaper(CharEscaper xmlEscaper,
          boolean shouldEscapeQuotes, boolean shouldEscapeWhitespaceChars) {
    View Full Code Here

    Examples of com.google.common.escape.Escaper.escape()

                        // the application context associated with the node id doesn't exist so log user out.
                        SecurityContextHolder.clearContext();
                    } else if (_location != null) {
                        if (oldNodeId != null && !oldNodeId.equals(nodeId)) {
                            final Escaper escaper = UrlEscapers.urlFormParameterEscaper();
                            final String location = getServletContext().getContextPath() + _location.replace("@@lang@@", escaper.escape(lang))
                                    .replace("@@nodeId@@", escaper.escape(nodeId))
                                    .replace("@@redirectedFrom@@", escaper.escape(redirectedFrom))
                                    .replace("@@oldNodeId@@", escaper.escape(oldNodeId))
                                    .replace("@@oldUserName@@", escaper.escape(user.getName()));
    View Full Code Here

    Examples of com.google.common.escape.Escaper.escape()

                        SecurityContextHolder.clearContext();
                    } else if (_location != null) {
                        if (oldNodeId != null && !oldNodeId.equals(nodeId)) {
                            final Escaper escaper = UrlEscapers.urlFormParameterEscaper();
                            final String location = getServletContext().getContextPath() + _location.replace("@@lang@@", escaper.escape(lang))
                                    .replace("@@nodeId@@", escaper.escape(nodeId))
                                    .replace("@@redirectedFrom@@", escaper.escape(redirectedFrom))
                                    .replace("@@oldNodeId@@", escaper.escape(oldNodeId))
                                    .replace("@@oldUserName@@", escaper.escape(user.getName()));

                            String requestURI = httpServletRequest.getRequestURI();
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. All rights reserved.
    All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.