
com.newrelic.agent.tracers.jasper.ScriptPostHeaderState Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of newrelic-agent Show documentation
Show all versions of newrelic-agent Show documentation
Jar required to run with a java application to monitor performance.
The newest version!
/*
*
* * Copyright 2020 New Relic Corporation. All rights reserved.
* * SPDX-License-Identifier: Apache-2.0
*
*/
package com.newrelic.agent.tracers.jasper;
import static com.newrelic.agent.tracers.jasper.AbstractRUMState.END_SCRIPT_PATTERN;
import java.util.regex.Matcher;
import com.newrelic.agent.Transaction;
/**
* A state for ignoring script tags.
*/
public class ScriptPostHeaderState extends AbstractRUMState {
@Override
public RUMState process(Transaction tx, GenerateVisitor generator, TemplateText node, String text) throws Exception {
Matcher matcher = END_SCRIPT_PATTERN.matcher(text);
if (matcher.find()) {
String s = text.substring(0, matcher.end());
writeText(tx, generator, node, s);
s = text.substring(matcher.end());
return BODY_STATE.process(tx, generator, node, s);
}
writeText(tx, generator, node, text);
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy