/** * Parses the provided input String as a JSP attribute and returns an * unquoted value. * * @param input The input. * @param quote The quote character for the attribute or 0 for * scripting expressions. * @param isELIgnored Is expression language being ignored on the page * where the JSP attribute is defined. * @param isDeferredSyntaxAllowedAsLiteral * Are deferred expressions treated as literals? * @return An unquoted JSP attribute that, if it contains * expression language can be safely passed to the EL * processor without fear of ambiguity. */ public static String getUnquoted(String input, char quote, boolean isELIgnored, boolean isDeferredSyntaxAllowedAsLiteral) { return (new AttributeParser(input, quote, isELIgnored, isDeferredSyntaxAllowedAsLiteral, STRICT_QUOTE_ESCAPING)).getUnquoted(); }
/** * For test purposes. * @param input * @param quote * @param strict */ private AttributeParser(String input, char quote, boolean isELIgnored, boolean isDeferredSyntaxAllowedAsLiteral, boolean strict) { this.input = input; this.quote = quote; this.isELIgnored = isELIgnored; this.isDeferredSyntaxAllowedAsLiteral = isDeferredSyntaxAllowedAsLiteral; this.strict = strict; this.type = getType(input); this.size = input.length(); result = new StringBuilder(size); }
private String getUnquoted() { while (i < size) { parseLiteral(); parseEL(); } return result.toString(); }
pageInfo.isELIgnored() || watch.length() > 1; ret = AttributeParser.getUnquoted(reader.getText(start, stop), quote, isElIgnored, pageInfo.isDeferredSyntaxAllowedAsLiteral());
/** * AttributeValueDouble ::= (QuotedChar - '"')* ('"' | <TRANSLATION_ERROR>) * RTAttributeValueDouble ::= ((QuotedChar - '"')* - ((QuotedChar-'"')'%>"') * ('%>"' | TRANSLATION_ERROR) */ private String parseAttributeValue(String watch) throws JasperException { Mark start = reader.mark(); Mark stop = reader.skipUntilIgnoreEsc(watch); if (stop == null) { err.jspError(start, "jsp.error.attribute.unterminated", watch); } String ret = null; try { char quote = watch.charAt(watch.length() - 1); // If watch is longer than 1 character this is a scripting // expression and EL is always ignored boolean isElIgnored = pageInfo.isELIgnored() || watch.length() > 1; ret = AttributeParser.getUnquoted(reader.getText(start, stop), quote, isElIgnored, pageInfo.isDeferredSyntaxAllowedAsLiteral()); } catch (IllegalArgumentException iae) { err.jspError(start, iae.getMessage()); } if (watch.length() == 1) // quote return ret; // Put back delimiter '<%=' and '%>', since they are needed if the // attribute does not allow RTexpression. return "<%=" + ret + "%>"; }
/** * Provided solely for unit test purposes and allows per call overriding of * the STRICT_QUOTE_ESCAPING system property. * * @param input The input. * @param quote The quote character for the attribute or 0 for * scripting expressions. * @param isELIgnored Is expression language being ignored on the page * where the JSP attribute is defined. * @param isDeferredSyntaxAllowedAsLiteral * Are deferred expressions treated as literals? * @param strict The value to use for STRICT_QUOTE_ESCAPING. * @return An unquoted JSP attribute that, if it contains * expression language can be safely passed to the EL * processor without fear of ambiguity. */ protected static String getUnquoted(String input, char quote, boolean isELIgnored, boolean isDeferredSyntaxAllowedAsLiteral, boolean strict) { return (new AttributeParser(input, quote, isELIgnored, isDeferredSyntaxAllowedAsLiteral, strict)).getUnquoted(); }
private String getUnquoted() { while (i < size) { parseLiteral(); parseEL(); } return result.toString(); }
/** * For test purposes. * @param input * @param quote * @param strict */ private AttributeParser(String input, char quote, boolean isELIgnored, boolean isDeferredSyntaxAllowedAsLiteral, boolean strict) { this.input = input; this.quote = quote; this.isELIgnored = isELIgnored; this.isDeferredSyntaxAllowedAsLiteral = isDeferredSyntaxAllowedAsLiteral; this.strict = strict; this.type = getType(input); this.size = input.length(); result = new StringBuilder(size); }
pageInfo.isELIgnored() || watch.length() > 1; ret = AttributeParser.getUnquoted(reader.getText(start, stop), quote, isElIgnored, pageInfo.isDeferredSyntaxAllowedAsLiteral());
/** * Parses the provided input String as a JSP attribute and returns an * unquoted value. * * @param input The input. * @param quote The quote character for the attribute or 0 for * scripting expressions. * @param isELIgnored Is expression language being ignored on the page * where the JSP attribute is defined. * @param isDeferredSyntaxAllowedAsLiteral * Are deferred expressions treated as literals? * @return An unquoted JSP attribute that, if it contains * expression language can be safely passed to the EL * processor without fear of ambiguity. */ public static String getUnquoted(String input, char quote, boolean isELIgnored, boolean isDeferredSyntaxAllowedAsLiteral) { return (new AttributeParser(input, quote, isELIgnored, isDeferredSyntaxAllowedAsLiteral, STRICT_QUOTE_ESCAPING)).getUnquoted(); }
private String getUnquoted() { while (i < size) { parseLiteral(); parseEL(); } return result.toString(); }
/** * For test purposes. * @param input * @param quote * @param strict */ private AttributeParser(String input, char quote, boolean isELIgnored, boolean isDeferredSyntaxAllowedAsLiteral, boolean strict) { this.input = input; this.quote = quote; this.isELIgnored = isELIgnored; this.isDeferredSyntaxAllowedAsLiteral = isDeferredSyntaxAllowedAsLiteral; this.strict = strict; this.type = getType(input); this.size = input.length(); result = new StringBuilder(size); }
pageInfo.isELIgnored() || watch.length() > 1; ret = AttributeParser.getUnquoted(reader.getText(start, stop), quote, isElIgnored, pageInfo.isDeferredSyntaxAllowedAsLiteral());
/** * Parses the provided input String as a JSP attribute and returns an * unquoted value. * * @param input The input. * @param quote The quote character for the attribute or 0 for * scripting expressions. * @param isELIgnored Is expression language being ignored on the page * where the JSP attribute is defined. * @param isDeferredSyntaxAllowedAsLiteral * Are deferred expressions treated as literals? * @return An unquoted JSP attribute that, if it contains * expression language can be safely passed to the EL * processor without fear of ambiguity. */ public static String getUnquoted(String input, char quote, boolean isELIgnored, boolean isDeferredSyntaxAllowedAsLiteral) { return (new AttributeParser(input, quote, isELIgnored, isDeferredSyntaxAllowedAsLiteral, STRICT_QUOTE_ESCAPING)).getUnquoted(); }
private String getUnquoted() { while (i < size) { parseLiteral(); parseEL(); } return result.toString(); }