MCPcopy Index your code
hub / github.com/apache/tomcat / parseAttributeValue

Method parseAttributeValue

java/org/apache/jasper/compiler/Parser.java:254–285  ·  view source on GitHub ↗

AttributeValueDouble ::= (QuotedChar - '"') ('"' | <TRANSLATION_ERROR>) RTAttributeValueDouble ::= ((QuotedChar - '"') - ((QuotedChar-'"')'%>"') ('%>"' | TRANSLATION_ERROR)

(String qName, String watch, boolean ignoreEL)

Source from the content-addressed store, hash-verified

252 * ((QuotedChar - '"')* - ((QuotedChar-'"')'%>"') ('%>"' | TRANSLATION_ERROR)
253 */
254 private String parseAttributeValue(String qName, String watch, boolean ignoreEL) throws JasperException {
255 boolean quoteAttributeEL = ctxt.getOptions().getQuoteAttributeEL();
256 Mark start = reader.mark();
257 // In terms of finding the end of the value, quoting EL is equivalent to
258 // ignoring it.
259 Mark stop = reader.skipUntilIgnoreEsc(watch, ignoreEL || quoteAttributeEL);
260 if (stop == null) {
261 err.jspError(start, "jsp.error.attribute.unterminated", qName);
262 }
263
264 String ret = null;
265 try {
266 char quote = watch.charAt(watch.length() - 1);
267
268 // If watch is longer than 1 character this is a scripting
269 // expression and EL is always ignored
270 boolean isElIgnored = pageInfo.isELIgnored() || watch.length() > 1;
271
272 ret = AttributeParser.getUnquoted(reader.getText(start, stop), quote, isElIgnored,
273 pageInfo.isDeferredSyntaxAllowedAsLiteral(), ctxt.getOptions().getStrictQuoteEscaping(),
274 quoteAttributeEL);
275 } catch (IllegalArgumentException iae) {
276 err.jspError(start, iae.getMessage());
277 }
278 if (watch.length() == 1) {
279 return ret;
280 }
281
282 // Put back delimiter '<%=' and '%>', since they are needed if the
283 // attribute does not allow RTexpression.
284 return "<%=" + ret + "%>";
285 }
286
287 private String parseScriptText(String tx) {
288 CharArrayWriter cw = new CharArrayWriter();

Callers 1

parseAttributeMethod · 0.95

Calls 13

getUnquotedMethod · 0.95
skipUntilIgnoreEscMethod · 0.80
charAtMethod · 0.80
lengthMethod · 0.80
getQuoteAttributeELMethod · 0.65
getOptionsMethod · 0.65
jspErrorMethod · 0.65
getMessageMethod · 0.65
markMethod · 0.45
isELIgnoredMethod · 0.45

Tested by

no test coverage detected