proj_name stringclasses 131
values | relative_path stringlengths 30 228 | class_name stringlengths 1 68 | func_name stringlengths 1 48 | masked_class stringlengths 78 9.82k | func_body stringlengths 46 9.61k | len_input int64 29 2.01k | len_output int64 14 1.94k | total int64 55 2.05k | relevant_context stringlengths 0 38.4k |
|---|---|---|---|---|---|---|---|---|---|
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringActionTagProcessor.java | SpringActionTagProcessor | doProcess | class SpringActionTagProcessor
extends AbstractStandardExpressionAttributeTagProcessor
implements IAttributeDefinitionsAware {
public static final int ATTR_PRECEDENCE = 1000;
public static final String TARGET_ATTR_NAME = "action";
private static final TemplateMode TEMPLATE_MODE = Templat... |
String newAttributeValue = HtmlEscape.escapeHtml4Xml(expressionResult == null ? "" : expressionResult.toString());
// But before setting the 'action' attribute, we need to verify the 'method' attribute and let the
// RequestDataValueProcessor act on it.
final String methodAttributeVal... | 477 | 579 | 1,056 | <methods><variables>private final non-sealed org.thymeleaf.standard.expression.StandardExpressionExecutionContext expressionExecutionContext,private final non-sealed boolean removeIfNoop |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringErrorClassTagProcessor.java | SpringErrorClassTagProcessor | doProcess | class SpringErrorClassTagProcessor
extends AbstractAttributeTagProcessor
implements IAttributeDefinitionsAware {
public static final int ATTR_PRECEDENCE = 1800;
public static final String ATTR_NAME = "errorclass";
public static final String TARGET_ATTR_NAME = "class";
private static fi... |
final IThymeleafBindStatus bindStatus = computeBindStatus(context, tag);
if (bindStatus == null) {
final AttributeName fieldAttributeName =
AttributeNames.forHTMLName(attributeName.getPrefix(), AbstractSpringFieldTagProcessor.ATTR_NAME);
throw new TemplatePr... | 1,075 | 429 | 1,504 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringErrorsTagProcessor.java | SpringErrorsTagProcessor | doProcess | class SpringErrorsTagProcessor extends AbstractAttributeTagProcessor {
private static final String ERROR_DELIMITER = "<br />";
public static final int ATTR_PRECEDENCE = 1700;
public static final String ATTR_NAME = "errors";
public SpringErrorsTagProcessor(final String dialectPrefi... |
final IThymeleafBindStatus bindStatus = FieldUtils.getBindStatus(context, attributeValue);
if (bindStatus.isError()) {
final StringBuilder strBuilder = new StringBuilder();
final String[] errorMsgs = bindStatus.getErrorMessages();
for (int i = 0; i < errorMsgs.le... | 199 | 249 | 448 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringHrefTagProcessor.java | SpringHrefTagProcessor | doProcess | class SpringHrefTagProcessor
extends AbstractStandardExpressionAttributeTagProcessor
implements IAttributeDefinitionsAware {
public static final int ATTR_PRECEDENCE = 1000;
public static final String ATTR_NAME = "href";
private static final TemplateMode TEMPLATE_MODE = TemplateMod... |
String newAttributeValue = HtmlEscape.escapeHtml4Xml(expressionResult == null ? "" : expressionResult.toString());
// Let RequestDataValueProcessor modify the attribute value if needed
newAttributeValue = RequestDataValueProcessorUtils.processUrl(context, newAttributeValue);
// Set t... | 349 | 121 | 470 | <methods><variables>private final non-sealed org.thymeleaf.standard.expression.StandardExpressionExecutionContext expressionExecutionContext,private final non-sealed boolean removeIfNoop |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringInputCheckboxFieldTagProcessor.java | SpringInputCheckboxFieldTagProcessor | doProcess | class SpringInputCheckboxFieldTagProcessor
extends AbstractSpringFieldTagProcessor {
public static final String CHECKBOX_INPUT_TYPE_ATTR_VALUE = "checkbox";
private final boolean renderHiddenMarkersBeforeCheckboxes;
public SpringInputCheckboxFieldTagProcessor(final String dialectPrefix) {
... |
String name = bindStatus.getExpression();
name = (name == null? "" : name);
final String id = computeId(context, tag, name, true);
String value = null;
boolean checked = false;
Object boundValue = bindStatus.getValue();
final Class<?> valueType = bindStatus.g... | 359 | 881 | 1,240 | <methods>public void <init>(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], boolean) ,public void setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions) <variables>public static final java.lang.String ATTR_NAME,public static final int ATTR_PRECEDENCE,protected static final java.lan... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringInputFileFieldTagProcessor.java | SpringInputFileFieldTagProcessor | doProcess | class SpringInputFileFieldTagProcessor extends AbstractSpringFieldTagProcessor {
public static final String FILE_INPUT_TYPE_ATTR_VALUE = "file";
public SpringInputFileFieldTagProcessor(final String dialectPrefix) {
super(dialectPrefix, INPUT_TAG_NAME, TYPE_ATTR_NAME, new String[] { FILE_INPUT_TYPE... |
String name = bindStatus.getExpression();
name = (name == null? "" : name);
final String id = computeId(context, tag, name, false);
StandardProcessorUtils.setAttribute(structureHandler, this.idAttributeDefinition, ID_ATTR_NAME, id); // No need to escape: this comes from an existing '... | 186 | 131 | 317 | <methods>public void <init>(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], boolean) ,public void setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions) <variables>public static final java.lang.String ATTR_NAME,public static final int ATTR_PRECEDENCE,protected static final java.lan... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringInputGeneralFieldTagProcessor.java | SpringInputGeneralFieldTagProcessor | doProcess | class SpringInputGeneralFieldTagProcessor
extends AbstractSpringFieldTagProcessor {
// HTML4 input types
public static final String TEXT_INPUT_TYPE_ATTR_VALUE = "text";
public static final String HIDDEN_INPUT_TYPE_ATTR_VALUE = "hidden";
// HTML5-specific input types
public static final Str... |
String name = bindStatus.getExpression();
name = (name == null? "" : name);
final String id = computeId(context, tag, name, false);
// Thanks to precedence, this should have already been computed
final String type = tag.getAttributeValue(this.typeAttributeDefinition.getAttrib... | 806 | 316 | 1,122 | <methods>public void <init>(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], boolean) ,public void setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions) <variables>public static final java.lang.String ATTR_NAME,public static final int ATTR_PRECEDENCE,protected static final java.lan... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringInputPasswordFieldTagProcessor.java | SpringInputPasswordFieldTagProcessor | doProcess | class SpringInputPasswordFieldTagProcessor extends AbstractSpringFieldTagProcessor {
public static final String PASSWORD_INPUT_TYPE_ATTR_VALUE = "password";
public SpringInputPasswordFieldTagProcessor(final String dialectPrefix) {
super(dialectPrefix, INPUT_TAG_NAME, TYPE_ATTR_NAME, new String[]... |
String name = bindStatus.getExpression();
name = (name == null? "" : name);
final String id = computeId(context, tag, name, false);
StandardProcessorUtils.setAttribute(structureHandler, this.idAttributeDefinition, ID_ATTR_NAME, id); // No need to escape: this comes from an existing '... | 192 | 178 | 370 | <methods>public void <init>(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], boolean) ,public void setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions) <variables>public static final java.lang.String ATTR_NAME,public static final int ATTR_PRECEDENCE,protected static final java.lan... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringInputRadioFieldTagProcessor.java | SpringInputRadioFieldTagProcessor | doProcess | class SpringInputRadioFieldTagProcessor extends AbstractSpringFieldTagProcessor {
public static final String RADIO_INPUT_TYPE_ATTR_VALUE = "radio";
public SpringInputRadioFieldTagProcessor(final String dialectPrefix) {
super(dialectPrefix, INPUT_TAG_NAME, TYPE_ATTR_NAME, new String[] {... |
String name = bindStatus.getExpression();
name = (name == null? "" : name);
final String id = computeId(context, tag, name, true);
final String value = tag.getAttributeValue(this.valueAttributeDefinition.getAttributeName());
if (value == null) {
throw new Template... | 196 | 340 | 536 | <methods>public void <init>(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], boolean) ,public void setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions) <variables>public static final java.lang.String ATTR_NAME,public static final int ATTR_PRECEDENCE,protected static final java.lan... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringMethodTagProcessor.java | SpringMethodTagProcessor | doProcess | class SpringMethodTagProcessor
extends AbstractStandardExpressionAttributeTagProcessor
implements IAttributeDefinitionsAware {
public static final int ATTR_PRECEDENCE = 990;
public static final String TARGET_ATTR_NAME = "method";
private static final TemplateMode TEMPLATE_MODE = T... |
final String newAttributeValue = HtmlEscape.escapeHtml4Xml(expressionResult == null ? null : expressionResult.toString());
// Set the 'method' attribute, or remove it if evaluated to null
if (newAttributeValue == null || newAttributeValue.length() == 0) {
structureHandler.removeAt... | 471 | 547 | 1,018 | <methods><variables>private final non-sealed org.thymeleaf.standard.expression.StandardExpressionExecutionContext expressionExecutionContext,private final non-sealed boolean removeIfNoop |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringObjectTagProcessor.java | SpringObjectTagProcessor | validateSelectionValue | class SpringObjectTagProcessor extends AbstractStandardTargetSelectionTagProcessor {
public static final int ATTR_PRECEDENCE = 500;
public static final String ATTR_NAME = "object";
public SpringObjectTagProcessor(final String dialectPrefix) {
super(TemplateMode.HTML, dialectPref... |
if (expression == null || !(expression instanceof VariableExpression)) {
throw new TemplateProcessingException(
"The expression used for object selection is " + expression + ", which is not valid: " +
"only variable expressions (${...}) are allowed in '" + ... | 311 | 92 | 403 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringOptionFieldTagProcessor.java | SpringOptionFieldTagProcessor | doProcess | class SpringOptionFieldTagProcessor extends AbstractSpringFieldTagProcessor {
public SpringOptionFieldTagProcessor(final String dialectPrefix) {
super(dialectPrefix, OPTION_TAG_NAME, null, null, true);
}
@Override
protected void doProcess(final ITemplateContext context,
... |
String name = bindStatus.getExpression();
name = (name == null? "" : name);
final String value = tag.getAttributeValue(this.valueAttributeDefinition.getAttributeName());
if (value == null) {
throw new TemplateProcessingException(
"Attribute \"value\" is... | 144 | 239 | 383 | <methods>public void <init>(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], boolean) ,public void setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions) <variables>public static final java.lang.String ATTR_NAME,public static final int ATTR_PRECEDENCE,protected static final java.lan... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringOptionInSelectFieldTagProcessor.java | SpringOptionInSelectFieldTagProcessor | doProcess | class SpringOptionInSelectFieldTagProcessor extends AbstractElementTagProcessor {
// This is 1005 in order to make sure it is executed just before "value" (Spring's version) and especially "th:field"
public static final int ATTR_PRECEDENCE = 1005;
public static final String OPTION_TAG_NAME = "option";
... |
final AttributeName selectAttrNameToAdd =
(AttributeName) context.getVariable(SpringSelectFieldTagProcessor.OPTION_IN_SELECT_ATTR_NAME);
if (selectAttrNameToAdd == null) {
// Nothing to do
return;
}
// It seems this <option> is inside a <select ... | 210 | 358 | 568 | <methods>public void <init>(org.thymeleaf.templatemode.TemplateMode, java.lang.String, java.lang.String, boolean, java.lang.String, boolean, int) ,public final org.thymeleaf.processor.element.MatchingAttributeName getMatchingAttributeName() ,public final org.thymeleaf.processor.element.MatchingElementName getMatchingEl... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringSelectFieldTagProcessor.java | SpringSelectFieldTagProcessor | doProcess | class SpringSelectFieldTagProcessor extends AbstractSpringFieldTagProcessor {
static final String OPTION_IN_SELECT_ATTR_NAME = "%%OPTION_IN_SELECT_ATTR_NAME%%";
static final String OPTION_IN_SELECT_ATTR_VALUE = "%%OPTION_IN_SELECT_ATTR_VALUE%%";
public SpringSelectFieldTagProcessor(final String dialect... |
String name = bindStatus.getExpression();
name = (name == null? "" : name);
final String id = computeId(context, tag, name, false);
final boolean multiple = tag.hasAttribute(this.multipleAttributeDefinition.getAttributeName());
StandardProcessorUtils.setAttribute(structureHa... | 258 | 525 | 783 | <methods>public void <init>(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], boolean) ,public void setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions) <variables>public static final java.lang.String ATTR_NAME,public static final int ATTR_PRECEDENCE,protected static final java.lan... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringSrcTagProcessor.java | SpringSrcTagProcessor | doProcess | class SpringSrcTagProcessor
extends AbstractStandardExpressionAttributeTagProcessor
implements IAttributeDefinitionsAware {
public static final int ATTR_PRECEDENCE = 1000;
public static final String ATTR_NAME = "src";
private static final TemplateMode TEMPLATE_MODE = TemplateMode.HTML;
... |
String newAttributeValue = HtmlEscape.escapeHtml4Xml(expressionResult == null ? "" : expressionResult.toString());
// Let RequestDataValueProcessor modify the attribute value if needed
newAttributeValue = RequestDataValueProcessorUtils.processUrl(context, newAttributeValue);
// Set t... | 341 | 121 | 462 | <methods><variables>private final non-sealed org.thymeleaf.standard.expression.StandardExpressionExecutionContext expressionExecutionContext,private final non-sealed boolean removeIfNoop |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringTextareaFieldTagProcessor.java | SpringTextareaFieldTagProcessor | doProcess | class SpringTextareaFieldTagProcessor extends AbstractSpringFieldTagProcessor {
public SpringTextareaFieldTagProcessor(final String dialectPrefix) {
super(dialectPrefix, TEXTAREA_TAG_NAME, null, null, true);
}
@Override
protected void doProcess(final ITemplateContext context,
... |
String name = bindStatus.getExpression();
name = (name == null? "" : name);
final String id = computeId(context, tag, name, false);
final String value = SpringValueFormatter.getDisplayString(bindStatus.getValue(), bindStatus.getEditor(), true);
String processedValue =
... | 147 | 344 | 491 | <methods>public void <init>(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], boolean) ,public void setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions) <variables>public static final java.lang.String ATTR_NAME,public static final int ATTR_PRECEDENCE,protected static final java.lan... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringUErrorsTagProcessor.java | SpringUErrorsTagProcessor | doProcess | class SpringUErrorsTagProcessor extends AbstractAttributeTagProcessor {
private static final String ERROR_DELIMITER = "<br />";
public static final int ATTR_PRECEDENCE = 1700;
public static final String ATTR_NAME = "uerrors";
public SpringUErrorsTagProcessor(final String dialectPrefix) {
... |
final IThymeleafBindStatus bindStatus = FieldUtils.getBindStatus(context, attributeValue);
if (bindStatus.isError()) {
final StringBuilder strBuilder = new StringBuilder();
final String[] errorMsgs = bindStatus.getErrorMessages();
for (int i = 0; i < errorMsgs.le... | 200 | 240 | 440 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringValueTagProcessor.java | SpringValueTagProcessor | doProcess | class SpringValueTagProcessor
extends AbstractStandardExpressionAttributeTagProcessor
implements IAttributeDefinitionsAware {
// This is 1010 in order to make sure it is executed after "name" and "type"
public static final int ATTR_PRECEDENCE = 1010;
public static final String TARGET_ATTR_... |
String newAttributeValue = HtmlEscape.escapeHtml4Xml(expressionResult == null ? "" : expressionResult.toString());
// Let RequestDataValueProcessor modify the attribute value if needed, but only in the case we don't also have
// a 'th:field' - in such case, we will let th:field do its job
... | 557 | 269 | 826 | <methods><variables>private final non-sealed org.thymeleaf.standard.expression.StandardExpressionExecutionContext expressionExecutionContext,private final non-sealed boolean removeIfNoop |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/requestdata/RequestDataValueProcessorUtils.java | RequestDataValueProcessorUtils | getExtraHiddenFields | class RequestDataValueProcessorUtils {
public static String processAction(
final ITemplateContext context, final String action, final String httpMethod) {
final IThymeleafRequestContext thymeleafRequestContext = SpringContextUtils.getRequestContext(context);
if (thymeleafRequestConte... |
final IThymeleafRequestContext thymeleafRequestContext = SpringContextUtils.getRequestContext(context);
if (thymeleafRequestContext == null) {
return null;
}
return thymeleafRequestContext.getRequestDataValueProcessor().getExtraHiddenFields();
| 394 | 77 | 471 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/templateresource/SpringResourceTemplateResource.java | SpringResourceTemplateResource | relative | class SpringResourceTemplateResource implements ITemplateResource {
private final Resource resource;
private final String characterEncoding;
public SpringResourceTemplateResource(
final ApplicationContext applicationContext, final String location, final String characterEncoding) {
... |
final Resource relativeResource;
try {
relativeResource = this.resource.createRelative(relativeLocation);
} catch (final IOException e) {
// Given we have delegated the createRelative(...) mechanism to Spring, it's better if we don't do
// any assumptions on ... | 1,063 | 137 | 1,200 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/util/DetailedError.java | DetailedError | toString | class DetailedError {
private static final String GLOBAL_FIELD_NAME = "[global]";
private final String fieldName;
private final String code;
private final Object[] arguments;
private final String message;
public DetailedError(final String code, final Object[] arguments, final String message... |
final StringBuilder strBuilder = new StringBuilder();
strBuilder.append(this.fieldName);
strBuilder.append(":");
strBuilder.append(this.message);
return strBuilder.toString();
| 337 | 55 | 392 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/util/SpringContentTypeUtils.java | SpringContentTypeUtils | computeViewContentType | class SpringContentTypeUtils {
public static String computeViewContentType(
final IWebExchange webExchange, final String defaultContentType, final Charset defaultCharset) {<FILL_FUNCTION_BODY>}
private SpringContentTypeUtils() {
super();
}
} |
if (webExchange == null) {
throw new IllegalArgumentException("Request cannot be null");
}
// First we will check if there is a content type already resolved by Spring's own content negotiation
// mechanism (see ContentNegotiatingViewResolver, which is autoconfigured in S... | 81 | 497 | 578 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/util/SpringReactiveModelAdditionsUtils.java | SpringReactiveModelAdditionsUtils | toReactiveModelAdditionName | class SpringReactiveModelAdditionsUtils {
private static final String REACTIVE_MODEL_ADDITIONS_PREFIX = "ThymeleafReactiveModelAdditions:";
public static boolean isReactiveModelAdditionName(final String name) {
return name != null && name.startsWith(REACTIVE_MODEL_ADDITIONS_PREFIX);
}
public... |
if (name == null) {
return null;
}
return REACTIVE_MODEL_ADDITIONS_PREFIX + name;
| 219 | 39 | 258 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/util/SpringRequestUtils.java | SpringRequestUtils | checkViewNameNotInRequest | class SpringRequestUtils {
public static void checkViewNameNotInRequest(final String viewName, final IWebRequest request) {<FILL_FUNCTION_BODY>}
private static boolean containsExpression(final String text) {
final int textLen = text.length();
char c;
boolean expInit = false;
... |
final String vn = StringUtils.pack(viewName);
if (!containsExpression(vn)) {
// We are only worried about expressions coming from user input, so if the view name contains no
// expression at all, we should be safe at this stage.
return;
}
boolean f... | 248 | 427 | 675 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/util/SpringSelectedValueComparator.java | SpringSelectedValueComparator | exhaustiveCollectionCompare | class SpringSelectedValueComparator {
/*
* NOTE This code is based on org.springframework.web.servlet.tags.form.SelectedValueComparator as of Spring 5.0.0
* Original license is Apache License 2.0, which is the same as the license for this file.
* Original copyright notice is "Copyright 20... |
final Map<PropertyEditor, Object> convertedValueCache = new HashMap<>(1);
PropertyEditor editor = null;
boolean candidateIsString = (candidateValue instanceof String);
if (!candidateIsString) {
editor = bindStatus.findEditor(candidateValue.getClass());
}
for... | 1,264 | 162 | 1,426 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/util/SpringStandardExpressionUtils.java | SpringStandardExpressionUtils | containsSpELInstantiationOrStaticOrParam | class SpringStandardExpressionUtils {
private static final char[] NEW_ARRAY = "wen".toCharArray(); // Inverted "new"
private static final int NEW_LEN = NEW_ARRAY.length;
private static final char[] PARAM_ARRAY = "marap".toCharArray(); // Inverted "param"
private static final int PARAM_LEN = PARAM_ARRA... |
/*
* Checks whether the expression contains instantiation of objects ("new SomeClass") or makes use of
* static methods ("T(SomeClass)") as both are forbidden in certain contexts in restricted mode.
*/
final String exp = ExpressionUtils.normalize(expression);
final... | 370 | 641 | 1,011 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/util/SpringValueFormatter.java | SpringValueFormatter | getDisplayString | class SpringValueFormatter {
/*
* NOTE This code is based on org.springframework.web.servlet.tags.form.ValueFormatter as of Spring 5.0.0
* Original license is Apache License 2.0, which is the same as the license for this file.
* Original copyright notice is "Copyright 2002-2012 the origin... |
if (propertyEditor != null && !(value instanceof String)) {
try {
propertyEditor.setValue(value);
final String text = propertyEditor.getAsText();
if (text != null) {
return getDisplayString(text, htmlEscape);
}
... | 244 | 119 | 363 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/web/webflux/MultiValueMapUtil.java | MultiValueMapUtil | cookieToStringArrayMultiMap | class MultiValueMapUtil {
static String[] EMPTY_VALUES = new String[0];
static Map<String,String[]> stringToStringArrayMultiMap(final MultiValueMap<String,String> multiValueMap) {
if (multiValueMap == null) {
return null;
}
final Map<String,String[]> stringArrayMap =
... |
if (multiValueMap == null) {
return null;
}
final Map<String,String[]> stringArrayMap =
new LinkedHashMap<String,String[]>(multiValueMap.size() + 1, 1.0f);
for (final Map.Entry<String, List<HttpCookie>> multiValueMapEntry : multiValueMap.entrySet()) {
... | 297 | 157 | 454 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/web/webflux/SpringWebFluxWebApplication.java | SpringWebFluxWebApplication | removeAttribute | class SpringWebFluxWebApplication implements ISpringWebFluxWebApplication {
// This class is made NOT final so that it can be proxied by Dependency Injection frameworks
/*
* There is no equivalent in Spring WebFlux to an application-level attribute container (e.g. ServletContext).
* So for the attribute ... |
Validate.notNull(name, "Name cannot be null");
throw new UnsupportedOperationException("No support for application-level attributes in Spring WebFlux");
| 676 | 41 | 717 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/web/webflux/SpringWebFluxWebExchange.java | SpringWebFluxWebExchange | getSession | class SpringWebFluxWebExchange implements ISpringWebFluxWebExchange {
private final SpringWebFluxWebRequest webRequest;
private final SpringWebFluxWebApplication webApplication;
private SpringWebFluxWebSession webSession; // can be null, and is always lazily initialized
private boolean webSessionIniti... |
// ServerWebExchange returns a Mono<WebSession>, which SpringStandardDialect makes sure to ask reactor to
// resolve before the view gets executed.
// NOTE this will not be available until just before the view starts executing
if (!this.webSessionInitialized) {
final WebSess... | 1,018 | 154 | 1,172 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/web/webflux/SpringWebFluxWebSession.java | SpringWebFluxWebSession | setAttributeValue | class SpringWebFluxWebSession implements ISpringWebFluxWebSession {
private final WebSession session;
SpringWebFluxWebSession(final WebSession session) {
super();
Validate.notNull(session, "Session cannot be null");
this.session = session;
}
@Override
public boolean exist... |
Validate.notNull(name, "Name cannot be null");
if (value == null) {
this.session.getAttributes().remove(name);
} else {
this.session.getAttributes().put(name, value);
}
| 300 | 64 | 364 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/webflow/view/AjaxThymeleafView.java | AjaxThymeleafView | getRenderFragments | class AjaxThymeleafView extends ThymeleafView implements AjaxEnabledView {
private static final Logger vlogger = LoggerFactory.getLogger(AjaxThymeleafView.class);
private static final String FRAGMENTS_PARAM = "fragments";
private AjaxHandler ajaxHandler = null;
public AjaxThymeleafView() {
... |
final String fragmentsParam = request.getParameter(FRAGMENTS_PARAM);
final String[] renderFragments = StringUtils.commaDelimitedListToStringArray(fragmentsParam);
if (renderFragments.length == 0) {
return null;
}
if (renderFragments.length == 1) {
return ... | 565 | 124 | 689 | <methods>public void <init>() ,public void <init>(java.lang.String) ,public java.lang.String getMarkupSelector() ,public void render(Map<java.lang.String,?>, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) throws java.lang.Exception,public void setMarkupSelector(java.lang.String) <variabl... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/webflow/view/AjaxThymeleafViewResolver.java | AjaxThymeleafViewResolver | createView | class AjaxThymeleafViewResolver
extends ThymeleafViewResolver {
private static final Logger vrlogger = LoggerFactory.getLogger(AjaxThymeleafViewResolver.class);
private AjaxHandler ajaxHandler = new DefaultAjaxHandler();
public AjaxThymeleafViewResolver() {
super();
}
... |
if (!canHandle(viewName, locale)) {
return null;
}
if (this.ajaxHandler == null) {
throw new ConfigurationException("[THYMELEAF] AJAX Handler set into " +
AjaxThymeleafViewResolver.class.getSimpleName() + " instance is null.");
}
... | 896 | 372 | 1,268 | <methods>public void <init>() ,public void addStaticVariable(java.lang.String, java.lang.Object) ,public boolean getAlwaysProcessRedirectAndForward() ,public java.lang.String getCharacterEncoding() ,public java.lang.String getContentType() ,public java.lang.String[] getExcludedViewNames() ,public boolean getForceConten... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/webflow/view/FlowAjaxThymeleafView.java | FlowAjaxThymeleafView | getRenderFragments | class FlowAjaxThymeleafView extends AjaxThymeleafView {
public FlowAjaxThymeleafView() {
super();
}
@Override
@SuppressWarnings("rawtypes")
protected Set<String> getRenderFragments(
final Map model, final HttpServletRequest request, final HttpServletResponse... |
final RequestContext context = RequestContextHolder.getRequestContext();
if (context == null) {
return super.getRenderFragments(model, request, response);
}
final String[] fragments = (String[]) context.getFlashScope().get(View.RENDER_FRAGMENTS_ATTRIBUTE);
... | 119 | 172 | 291 | <methods>public void <init>() ,public org.springframework.webflow.context.servlet.AjaxHandler getAjaxHandler() ,public void render(Map<java.lang.String,?>, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) throws java.lang.Exception,public void setAjaxHandler(org.springframework.webflow.con... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/context/SpringContextUtils.java | SpringContextUtils | getRequestContext | class SpringContextUtils {
/**
* <p>
* This is the name of the model attribute that will hold the (asychronously resolved)
* {@code WebSession} object in order to be used whenever needed, avoiding the need to block
* for obtaining it from the {@code ServerWebExchange}.
* </p>
*... |
if (context == null) {
return null;
}
return (IThymeleafRequestContext) context.getVariable(SpringContextVariableNames.THYMELEAF_REQUEST_CONTEXT);
| 1,170 | 54 | 1,224 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/context/webflux/ReactiveContextVariableUtils.java | ReactiveContextVariableUtils | computePublisherValue | class ReactiveContextVariableUtils {
/**
* <p>
* Lazily resolve the reactive asynchronous object into a {@link Publisher}.
* </p>
* <p>
* The main aim of this method is to mirror the mechanism used by Spring for resolving
* asynchronous variables at the model of views (see Spr... |
if (asyncObj instanceof Flux<?> || asyncObj instanceof Mono<?>) {
// If the async object is a Flux or a Mono, we don't need the ReactiveAdapterRegistry (and we allow
// initialization to happen without the registry, which is not possible with other Publisher<?>
// implement... | 375 | 467 | 842 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/context/webflux/SpringWebFluxThymeleafRequestDataValueProcessor.java | SpringWebFluxThymeleafRequestDataValueProcessor | processFormFieldValue | class SpringWebFluxThymeleafRequestDataValueProcessor implements IThymeleafRequestDataValueProcessor {
private final RequestDataValueProcessor requestDataValueProcessor;
private final ServerWebExchange exchange;
SpringWebFluxThymeleafRequestDataValueProcessor(
final RequestDataValueProcessor r... |
if (this.requestDataValueProcessor == null) {
// The presence of a Request Data Value Processor is optional
return value;
}
return this.requestDataValueProcessor.processFormFieldValue(this.exchange, name, value, type);
| 398 | 65 | 463 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/context/webmvc/SpringWebMvcThymeleafRequestDataValueProcessor.java | SpringWebMvcThymeleafRequestDataValueProcessor | processFormFieldValue | class SpringWebMvcThymeleafRequestDataValueProcessor implements IThymeleafRequestDataValueProcessor {
private final RequestDataValueProcessor requestDataValueProcessor;
private final HttpServletRequest httpServletRequest;
SpringWebMvcThymeleafRequestDataValueProcessor(
final RequestDataValue... |
if (this.requestDataValueProcessor == null) {
// The presence of a Request Data Value Processor is optional
return value;
}
return this.requestDataValueProcessor.processFormFieldValue(this.httpServletRequest, name, value, type);
| 408 | 66 | 474 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/expression/Mvc.java | Spring41MethodArgumentBuilderWrapper | encode | class Spring41MethodArgumentBuilderWrapper implements MethodArgumentBuilderWrapper {
private final org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBuilder.MethodArgumentBuilder builder;
private Spring41MethodArgumentBuilderWrapper(
final org.springframework.web.s... |
if (!SpringVersionUtils.isSpringAtLeast(5,0,8)) {
throw new IllegalStateException(String.format(
"At least Spring version 5.0.8.RELEASE is needed for executing " +
"MvcUriComponentsBuilder#encode() but detected Spring version is %s.",
... | 236 | 112 | 348 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/expression/SPELContextMapWrapper.java | SPELContextMapWrapper | entrySet | class SPELContextMapWrapper implements Map {
private static final String REQUEST_PARAMETERS_RESTRICTED_VARIABLE_NAME = "param";
private final IContext context;
private final IThymeleafEvaluationContext evaluationContext;
SPELContextMapWrapper(final IContext context, final IThymeleafEvaluationConte... |
throw new TemplateProcessingException(
"Cannot call #entrySet() on an " + IContext.class.getSimpleName() + " implementation");
| 935 | 38 | 973 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/expression/SPELContextPropertyAccessor.java | SPELContextPropertyAccessor | read | class SPELContextPropertyAccessor implements PropertyAccessor {
private static final Logger LOGGER = LoggerFactory.getLogger(SPELContextPropertyAccessor.class);
static final SPELContextPropertyAccessor INSTANCE = new SPELContextPropertyAccessor();
private static final String REQUEST_PARAMETERS_RESTRICTED... |
if (target == null) {
throw new AccessException("Cannot read property of null target");
}
try {
final IContext context = (IContext) target;
return new TypedValue(context.getVariable(name));
} catch (final ClassCastException e) {
// Thi... | 572 | 170 | 742 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/expression/SpringStandardConversionService.java | SpringStandardConversionService | convertToString | class SpringStandardConversionService extends AbstractStandardConversionService {
private static final TypeDescriptor TYPE_STRING = TypeDescriptor.valueOf(String.class);
public SpringStandardConversionService() {
// Should only be instanced from SpringStandardDialect
super();
}
@... |
if (object == null) {
return null;
}
final TypeDescriptor objectTypeDescriptor = TypeDescriptor.forObject(object);
final TypeConverter typeConverter = getSpringConversionService(context);
if (typeConverter == null || !typeConverter.canConvert(objectTypeDescriptor, T... | 413 | 118 | 531 | <methods>public final T convert(org.thymeleaf.context.IExpressionContext, java.lang.Object, Class<T>) <variables> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/expression/SpringStandardExpressionObjectFactory.java | SpringStandardExpressionObjectFactory | buildObject | class SpringStandardExpressionObjectFactory extends StandardExpressionObjectFactory {
/*
* Any new objects added here should also be added to the "ALL_EXPRESSION_OBJECT_NAMES" See below.
*/
public static final String FIELDS_EXPRESSION_OBJECT_NAME = "fields";
public static final String THEMES_EXPR... |
if (MVC_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
return MVC_EXPRESSION_OBJECT;
}
if (THEMES_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
// Themes was deprecated in 3.1.0 because Spring 6 dropped support for themes.
// This expressio... | 479 | 233 | 712 | <methods>public void <init>() ,public java.lang.Object buildObject(org.thymeleaf.context.IExpressionContext, java.lang.String) ,public Set<java.lang.String> getAllExpressionObjectNames() ,public boolean isCacheable(java.lang.String) <variables>private static final org.thymeleaf.expression.Aggregates AGGREGATES_EXPRESSI... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/expression/SpringStandardExpressions.java | SpringStandardExpressions | isSpringELCompilerEnabled | class SpringStandardExpressions {
/**
* Name used for registering whether <i>Spring EL compilation</i> should be enabled if available or not.
*/
public static final String ENABLE_SPRING_EL_COMPILER_ATTRIBUTE_NAME = "EnableSpringELCompiler";
private SpringStandardExpressions() {
super... |
final Object enableSpringELCompiler =
configuration.getExecutionAttributes().get(ENABLE_SPRING_EL_COMPILER_ATTRIBUTE_NAME);
if (enableSpringELCompiler == null) {
return false;
}
if (!(enableSpringELCompiler instanceof Boolean)) {
throw new Templat... | 280 | 178 | 458 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/expression/Themes.java | Themes | code | class Themes {
private final Theme theme;
private final Locale locale;
/**
* Constructor, obtains the current theme and locale from the processing
* context for code lookups later.
*
* @param context the processing context being used
*/
public Themes(final IExpressionContext c... |
if (this.theme == null) {
throw new TemplateProcessingException("Theme cannot be resolved because RequestContext was not found. "
+ "Are you using a Context object without a RequestContext variable?");
}
return this.theme.getMessageSource().getMessage(code, null, "",... | 262 | 76 | 338 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/expression/ThymeleafEvaluationContext.java | ThymeleafEvaluationContext | lookupVariable | class ThymeleafEvaluationContext
extends StandardEvaluationContext
implements IThymeleafEvaluationContext {
public static final String THYMELEAF_EVALUATION_CONTEXT_CONTEXT_VARIABLE_NAME = "thymeleaf::EvaluationContext";
private static final ReflectivePropertyAccessor REFLECTIVE_PROPER... |
if (this.expressionObjects != null && this.expressionObjects.containsObject(name)) {
final Object result = this.expressionObjects.getObject(name);
if (result != null) {
return result;
}
}
// fall back to superclass
return super.lookupV... | 1,809 | 82 | 1,891 | <methods>public void <init>() ,public void <init>(java.lang.Object) ,public void addConstructorResolver(org.springframework.expression.ConstructorResolver) ,public void addMethodResolver(org.springframework.expression.MethodResolver) ,public void addPropertyAccessor(org.springframework.expression.PropertyAccessor) ,pub... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/expression/ThymeleafEvaluationContextWrapper.java | ThymeleafEvaluationContextWrapper | setVariable | class ThymeleafEvaluationContextWrapper implements IThymeleafEvaluationContext {
private static final MapAccessor MAP_ACCESSOR_INSTANCE = new MapAccessor();
private final EvaluationContext delegate;
private final List<PropertyAccessor> propertyAccessors; // can be initialized to null if we can delegate
... |
if (this.additionalVariables == null) {
this.additionalVariables = new HashMap<String, Object>(5, 1.0f);
}
this.additionalVariables.put(name, value);
| 1,264 | 61 | 1,325 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/messageresolver/SpringMessageResolver.java | SpringMessageResolver | resolveMessage | class SpringMessageResolver
extends AbstractMessageResolver
implements MessageSourceAware {
private static final Logger logger = LoggerFactory.getLogger(SpringMessageResolver.class);
private final StandardMessageResolver standardMessageResolver;
private MessageSource messageSource;
... |
Validate.notNull(context.getLocale(), "Locale in context cannot be null");
Validate.notNull(key, "Message key cannot be null");
/*
* FIRST STEP: Look for the message using template-based resolution
*/
if (context != null) {
checkMessageSourceInitialized(... | 520 | 382 | 902 | <methods>public final java.lang.String getName() ,public final java.lang.Integer getOrder() ,public void setName(java.lang.String) ,public void setOrder(java.lang.Integer) <variables>private static final org.slf4j.Logger logger,private java.lang.String name,private java.lang.Integer order |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/AbstractSpringFieldTagProcessor.java | AbstractSpringFieldTagProcessor | doProcess | class AbstractSpringFieldTagProcessor
extends AbstractAttributeTagProcessor
implements IAttributeDefinitionsAware {
public static final int ATTR_PRECEDENCE = 1700;
public static final String ATTR_NAME = "field";
private static final TemplateMode TEMPLATE_MODE = TemplateMode.HTML;
pro... |
/*
* First thing to check is whether this processor really matches, because so far we have asked the engine only
* to match per attribute (th:field) and host tag (input, select, option...) but we still don't know if the
* match is complete because we might still need to assess for e... | 1,556 | 445 | 2,001 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringActionTagProcessor.java | SpringActionTagProcessor | doProcess | class SpringActionTagProcessor
extends AbstractStandardExpressionAttributeTagProcessor
implements IAttributeDefinitionsAware {
public static final int ATTR_PRECEDENCE = 1000;
public static final String TARGET_ATTR_NAME = "action";
private static final TemplateMode TEMPLATE_MODE = Templat... |
String newAttributeValue = HtmlEscape.escapeHtml4Xml(expressionResult == null ? "" : expressionResult.toString());
// But before setting the 'action' attribute, we need to verify the 'method' attribute and let the
// RequestDataValueProcessor act on it.
final String methodAttributeVal... | 477 | 579 | 1,056 | <methods><variables>private final non-sealed org.thymeleaf.standard.expression.StandardExpressionExecutionContext expressionExecutionContext,private final non-sealed boolean removeIfNoop |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringErrorClassTagProcessor.java | SpringErrorClassTagProcessor | doProcess | class SpringErrorClassTagProcessor
extends AbstractAttributeTagProcessor
implements IAttributeDefinitionsAware {
public static final int ATTR_PRECEDENCE = 1800;
public static final String ATTR_NAME = "errorclass";
public static final String TARGET_ATTR_NAME = "class";
private static fi... |
final IThymeleafBindStatus bindStatus = computeBindStatus(context, tag);
if (bindStatus == null) {
final AttributeName fieldAttributeName =
AttributeNames.forHTMLName(attributeName.getPrefix(), AbstractSpringFieldTagProcessor.ATTR_NAME);
throw new TemplatePr... | 1,075 | 429 | 1,504 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringErrorsTagProcessor.java | SpringErrorsTagProcessor | doProcess | class SpringErrorsTagProcessor extends AbstractAttributeTagProcessor {
private static final String ERROR_DELIMITER = "<br />";
public static final int ATTR_PRECEDENCE = 1700;
public static final String ATTR_NAME = "errors";
public SpringErrorsTagProcessor(final String dialectPrefix) {
sup... |
final IThymeleafBindStatus bindStatus = FieldUtils.getBindStatus(context, attributeValue);
if (bindStatus.isError()) {
final StringBuilder strBuilder = new StringBuilder();
final String[] errorMsgs = bindStatus.getErrorMessages();
for (int i = 0; i < errorMsgs.le... | 195 | 249 | 444 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringHrefTagProcessor.java | SpringHrefTagProcessor | doProcess | class SpringHrefTagProcessor
extends AbstractStandardExpressionAttributeTagProcessor
implements IAttributeDefinitionsAware {
public static final int ATTR_PRECEDENCE = 1000;
public static final String ATTR_NAME = "href";
private static final TemplateMode TEMPLATE_MODE = TemplateMod... |
String newAttributeValue = HtmlEscape.escapeHtml4Xml(expressionResult == null ? "" : expressionResult.toString());
// Let RequestDataValueProcessor modify the attribute value if needed
newAttributeValue = RequestDataValueProcessorUtils.processUrl(context, newAttributeValue);
// Set t... | 348 | 121 | 469 | <methods><variables>private final non-sealed org.thymeleaf.standard.expression.StandardExpressionExecutionContext expressionExecutionContext,private final non-sealed boolean removeIfNoop |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringInputCheckboxFieldTagProcessor.java | SpringInputCheckboxFieldTagProcessor | doProcess | class SpringInputCheckboxFieldTagProcessor
extends AbstractSpringFieldTagProcessor {
public static final String CHECKBOX_INPUT_TYPE_ATTR_VALUE = "checkbox";
private final boolean renderHiddenMarkersBeforeCheckboxes;
public SpringInputCheckboxFieldTagProcessor(final String dialectPrefix) {
... |
String name = bindStatus.getExpression();
name = (name == null? "" : name);
final String id = computeId(context, tag, name, true);
String value = null;
boolean checked = false;
Object boundValue = bindStatus.getValue();
final Class<?> valueType = bindStatus.g... | 359 | 881 | 1,240 | <methods>public void <init>(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], boolean) ,public void setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions) <variables>public static final java.lang.String ATTR_NAME,public static final int ATTR_PRECEDENCE,protected static final java.lan... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringInputFileFieldTagProcessor.java | SpringInputFileFieldTagProcessor | doProcess | class SpringInputFileFieldTagProcessor extends AbstractSpringFieldTagProcessor {
public static final String FILE_INPUT_TYPE_ATTR_VALUE = "file";
public SpringInputFileFieldTagProcessor(final String dialectPrefix) {
super(dialectPrefix, INPUT_TAG_NAME, TYPE_ATTR_NAME, new String[] { FILE_INPUT_TYPE... |
String name = bindStatus.getExpression();
name = (name == null? "" : name);
final String id = computeId(context, tag, name, false);
StandardProcessorUtils.setAttribute(structureHandler, this.idAttributeDefinition, ID_ATTR_NAME, id); // No need to escape: this comes from an existing '... | 186 | 131 | 317 | <methods>public void <init>(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], boolean) ,public void setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions) <variables>public static final java.lang.String ATTR_NAME,public static final int ATTR_PRECEDENCE,protected static final java.lan... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringInputGeneralFieldTagProcessor.java | SpringInputGeneralFieldTagProcessor | doProcess | class SpringInputGeneralFieldTagProcessor
extends AbstractSpringFieldTagProcessor {
// HTML4 input types
public static final String TEXT_INPUT_TYPE_ATTR_VALUE = "text";
public static final String HIDDEN_INPUT_TYPE_ATTR_VALUE = "hidden";
// HTML5-specific input types
public static final Str... |
String name = bindStatus.getExpression();
name = (name == null? "" : name);
final String id = computeId(context, tag, name, false);
// Thanks to precedence, this should have already been computed
final String type = tag.getAttributeValue(this.typeAttributeDefinition.getAttrib... | 806 | 316 | 1,122 | <methods>public void <init>(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], boolean) ,public void setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions) <variables>public static final java.lang.String ATTR_NAME,public static final int ATTR_PRECEDENCE,protected static final java.lan... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringInputPasswordFieldTagProcessor.java | SpringInputPasswordFieldTagProcessor | doProcess | class SpringInputPasswordFieldTagProcessor extends AbstractSpringFieldTagProcessor {
public static final String PASSWORD_INPUT_TYPE_ATTR_VALUE = "password";
public SpringInputPasswordFieldTagProcessor(final String dialectPrefix) {
super(dialectPrefix, INPUT_TAG_NAME, TYPE_ATTR_NAME, new String[]... |
String name = bindStatus.getExpression();
name = (name == null? "" : name);
final String id = computeId(context, tag, name, false);
StandardProcessorUtils.setAttribute(structureHandler, this.idAttributeDefinition, ID_ATTR_NAME, id); // No need to escape: this comes from an existing '... | 192 | 178 | 370 | <methods>public void <init>(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], boolean) ,public void setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions) <variables>public static final java.lang.String ATTR_NAME,public static final int ATTR_PRECEDENCE,protected static final java.lan... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringInputRadioFieldTagProcessor.java | SpringInputRadioFieldTagProcessor | doProcess | class SpringInputRadioFieldTagProcessor extends AbstractSpringFieldTagProcessor {
public static final String RADIO_INPUT_TYPE_ATTR_VALUE = "radio";
public SpringInputRadioFieldTagProcessor(final String dialectPrefix) {
super(dialectPrefix, INPUT_TAG_NAME, TYPE_ATTR_NAME, new String[] { RADIO_INPUT... |
String name = bindStatus.getExpression();
name = (name == null? "" : name);
final String id = computeId(context, tag, name, true);
final String value = tag.getAttributeValue(this.valueAttributeDefinition.getAttributeName());
if (value == null) {
throw new Template... | 192 | 340 | 532 | <methods>public void <init>(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], boolean) ,public void setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions) <variables>public static final java.lang.String ATTR_NAME,public static final int ATTR_PRECEDENCE,protected static final java.lan... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringMethodTagProcessor.java | SpringMethodTagProcessor | doProcess | class SpringMethodTagProcessor
extends AbstractStandardExpressionAttributeTagProcessor
implements IAttributeDefinitionsAware {
public static final int ATTR_PRECEDENCE = 990;
public static final String TARGET_ATTR_NAME = "method";
private static final TemplateMode TEMPLATE_MODE = T... |
final String newAttributeValue = HtmlEscape.escapeHtml4Xml(expressionResult == null ? null : expressionResult.toString());
// Set the 'method' attribute, or remove it if evaluated to null
if (newAttributeValue == null || newAttributeValue.length() == 0) {
structureHandler.removeAt... | 471 | 547 | 1,018 | <methods><variables>private final non-sealed org.thymeleaf.standard.expression.StandardExpressionExecutionContext expressionExecutionContext,private final non-sealed boolean removeIfNoop |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringObjectTagProcessor.java | SpringObjectTagProcessor | validateSelectionValue | class SpringObjectTagProcessor extends AbstractStandardTargetSelectionTagProcessor {
public static final int ATTR_PRECEDENCE = 500;
public static final String ATTR_NAME = "object";
public SpringObjectTagProcessor(final String dialectPrefix) {
super(TemplateMode.HTML, dialectPrefix, ATTR_NAME, A... |
if (expression == null || !(expression instanceof VariableExpression)) {
throw new TemplateProcessingException(
"The expression used for object selection is " + expression + ", which is not valid: " +
"only variable expressions (${...}) are allowed in '" + ... | 300 | 92 | 392 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringOptionFieldTagProcessor.java | SpringOptionFieldTagProcessor | doProcess | class SpringOptionFieldTagProcessor extends AbstractSpringFieldTagProcessor {
public SpringOptionFieldTagProcessor(final String dialectPrefix) {
super(dialectPrefix, OPTION_TAG_NAME, null, null, true);
}
@Override
protected void doProcess(final ITemplateContext context,
... |
String name = bindStatus.getExpression();
name = (name == null? "" : name);
final String value = tag.getAttributeValue(this.valueAttributeDefinition.getAttributeName());
if (value == null) {
throw new TemplateProcessingException(
"Attribute \"value\" is... | 144 | 239 | 383 | <methods>public void <init>(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], boolean) ,public void setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions) <variables>public static final java.lang.String ATTR_NAME,public static final int ATTR_PRECEDENCE,protected static final java.lan... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringOptionInSelectFieldTagProcessor.java | SpringOptionInSelectFieldTagProcessor | doProcess | class SpringOptionInSelectFieldTagProcessor extends AbstractElementTagProcessor {
// This is 1005 in order to make sure it is executed just before "value" (Spring's version) and especially "th:field"
public static final int ATTR_PRECEDENCE = 1005;
public static final String OPTION_TAG_NAME = "option";
... |
final AttributeName selectAttrNameToAdd =
(AttributeName) context.getVariable(SpringSelectFieldTagProcessor.OPTION_IN_SELECT_ATTR_NAME);
if (selectAttrNameToAdd == null) {
// Nothing to do
return;
}
// It seems this <option> is inside a <select ... | 210 | 358 | 568 | <methods>public void <init>(org.thymeleaf.templatemode.TemplateMode, java.lang.String, java.lang.String, boolean, java.lang.String, boolean, int) ,public final org.thymeleaf.processor.element.MatchingAttributeName getMatchingAttributeName() ,public final org.thymeleaf.processor.element.MatchingElementName getMatchingEl... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringSelectFieldTagProcessor.java | SpringSelectFieldTagProcessor | doProcess | class SpringSelectFieldTagProcessor extends AbstractSpringFieldTagProcessor {
static final String OPTION_IN_SELECT_ATTR_NAME = "%%OPTION_IN_SELECT_ATTR_NAME%%";
static final String OPTION_IN_SELECT_ATTR_VALUE = "%%OPTION_IN_SELECT_ATTR_VALUE%%";
public SpringSelectFieldTagProcessor(final String dialect... |
String name = bindStatus.getExpression();
name = (name == null? "" : name);
final String id = computeId(context, tag, name, false);
final boolean multiple = tag.hasAttribute(this.multipleAttributeDefinition.getAttributeName());
StandardProcessorUtils.setAttribute(structureHa... | 258 | 525 | 783 | <methods>public void <init>(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], boolean) ,public void setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions) <variables>public static final java.lang.String ATTR_NAME,public static final int ATTR_PRECEDENCE,protected static final java.lan... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringSrcTagProcessor.java | SpringSrcTagProcessor | doProcess | class SpringSrcTagProcessor
extends AbstractStandardExpressionAttributeTagProcessor
implements IAttributeDefinitionsAware {
public static final int ATTR_PRECEDENCE = 1000;
public static final String ATTR_NAME = "src";
private static final TemplateMode TEMPLATE_MODE = TemplateMode.HTML;
... |
String newAttributeValue = HtmlEscape.escapeHtml4Xml(expressionResult == null ? "" : expressionResult.toString());
// Let RequestDataValueProcessor modify the attribute value if needed
newAttributeValue = RequestDataValueProcessorUtils.processUrl(context, newAttributeValue);
// Set t... | 341 | 121 | 462 | <methods><variables>private final non-sealed org.thymeleaf.standard.expression.StandardExpressionExecutionContext expressionExecutionContext,private final non-sealed boolean removeIfNoop |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringTextareaFieldTagProcessor.java | SpringTextareaFieldTagProcessor | doProcess | class SpringTextareaFieldTagProcessor extends AbstractSpringFieldTagProcessor {
public SpringTextareaFieldTagProcessor(final String dialectPrefix) {
super(dialectPrefix, TEXTAREA_TAG_NAME, null, null, true);
}
@Override
protected void doProcess(final ITemplateContext context,
... |
String name = bindStatus.getExpression();
name = (name == null? "" : name);
final String id = computeId(context, tag, name, false);
final String value = SpringValueFormatter.getDisplayString(bindStatus.getValue(), bindStatus.getEditor(), true);
String processedValue =
... | 147 | 344 | 491 | <methods>public void <init>(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], boolean) ,public void setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions) <variables>public static final java.lang.String ATTR_NAME,public static final int ATTR_PRECEDENCE,protected static final java.lan... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringUErrorsTagProcessor.java | SpringUErrorsTagProcessor | doProcess | class SpringUErrorsTagProcessor extends AbstractAttributeTagProcessor {
private static final String ERROR_DELIMITER = "<br />";
public static final int ATTR_PRECEDENCE = 1700;
public static final String ATTR_NAME = "uerrors";
public SpringUErrorsTagProcessor(final String dialectPrefix) {
... |
final IThymeleafBindStatus bindStatus = FieldUtils.getBindStatus(context, attributeValue);
if (bindStatus.isError()) {
final StringBuilder strBuilder = new StringBuilder();
final String[] errorMsgs = bindStatus.getErrorMessages();
for (int i = 0; i < errorMsgs.le... | 200 | 240 | 440 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringValueTagProcessor.java | SpringValueTagProcessor | setAttributeDefinitions | class SpringValueTagProcessor
extends AbstractStandardExpressionAttributeTagProcessor
implements IAttributeDefinitionsAware {
// This is 1010 in order to make sure it is executed after "name" and "type"
public static final int ATTR_PRECEDENCE = 1010;
public static final String TARGET_ATTR_... |
Validate.notNull(attributeDefinitions, "Attribute Definitions cannot be null");
// We precompute the AttributeDefinitions in order to being able to use much
// faster methods for setting/replacing attributes on the ElementAttributes implementation
final String dialectPrefix = getMatchin... | 616 | 210 | 826 | <methods><variables>private final non-sealed org.thymeleaf.standard.expression.StandardExpressionExecutionContext expressionExecutionContext,private final non-sealed boolean removeIfNoop |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/requestdata/RequestDataValueProcessorUtils.java | RequestDataValueProcessorUtils | processUrl | class RequestDataValueProcessorUtils {
public static String processAction(
final ITemplateContext context, final String action, final String httpMethod) {
final IThymeleafRequestContext thymeleafRequestContext = SpringContextUtils.getRequestContext(context);
if (thymeleafRequestConte... |
final IThymeleafRequestContext thymeleafRequestContext = SpringContextUtils.getRequestContext(context);
if (thymeleafRequestContext == null) {
return url;
}
return thymeleafRequestContext.getRequestDataValueProcessor().processUrl(url);
| 394 | 76 | 470 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/templateresource/SpringResourceTemplateResource.java | SpringResourceTemplateResource | computeBaseName | class SpringResourceTemplateResource implements ITemplateResource {
private final Resource resource;
private final String characterEncoding;
public SpringResourceTemplateResource(
final ApplicationContext applicationContext, final String location, final String characterEncoding) {
... |
if (path == null || path.length() == 0) {
return null;
}
// First remove a trailing '/' if it exists
final String basePath = (path.charAt(path.length() - 1) == '/'? path.substring(0,path.length() - 1) : path);
final int slashPos = basePath.lastIndexOf('/');
... | 945 | 255 | 1,200 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/util/DetailedError.java | DetailedError | toString | class DetailedError {
private static final String GLOBAL_FIELD_NAME = "[global]";
private final String fieldName;
private final String code;
private final Object[] arguments;
private final String message;
public DetailedError(final String code, final Object[] arguments, final String message... |
final StringBuilder strBuilder = new StringBuilder();
strBuilder.append(this.fieldName);
strBuilder.append(":");
strBuilder.append(this.message);
return strBuilder.toString();
| 337 | 55 | 392 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/util/SpringContentTypeUtils.java | SpringContentTypeUtils | computeViewContentType | class SpringContentTypeUtils {
public static String computeViewContentType(
final IWebExchange webExchange, final String defaultContentType, final Charset defaultCharset) {<FILL_FUNCTION_BODY>}
private SpringContentTypeUtils() {
super();
}
} |
if (webExchange == null) {
throw new IllegalArgumentException("Request cannot be null");
}
// First we will check if there is a content type already resolved by Spring's own content negotiation
// mechanism (see ContentNegotiatingViewResolver, which is autoconfigured in S... | 81 | 497 | 578 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/util/SpringReactiveModelAdditionsUtils.java | SpringReactiveModelAdditionsUtils | toReactiveModelAdditionName | class SpringReactiveModelAdditionsUtils {
private static final String REACTIVE_MODEL_ADDITIONS_PREFIX = "ThymeleafReactiveModelAdditions:";
public static boolean isReactiveModelAdditionName(final String name) {
return name != null && name.startsWith(REACTIVE_MODEL_ADDITIONS_PREFIX);
}
public... |
if (name == null) {
return null;
}
return REACTIVE_MODEL_ADDITIONS_PREFIX + name;
| 219 | 39 | 258 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/util/SpringRequestUtils.java | SpringRequestUtils | checkViewNameNotInRequest | class SpringRequestUtils {
public static void checkViewNameNotInRequest(final String viewName, final IWebRequest request) {<FILL_FUNCTION_BODY>}
private static boolean containsExpression(final String text) {
final int textLen = text.length();
char c;
boolean expInit = false;
... |
final String vn = StringUtils.pack(viewName);
if (!containsExpression(vn)) {
// We are only worried about expressions coming from user input, so if the view name contains no
// expression at all, we should be safe at this stage.
return;
}
boolean f... | 248 | 427 | 675 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/util/SpringSelectedValueComparator.java | SpringSelectedValueComparator | exhaustiveCompare | class SpringSelectedValueComparator {
/*
* NOTE This code is based on org.springframework.web.servlet.tags.form.SelectedValueComparator as of Spring 5.0.0
* Original license is Apache License 2.0, which is the same as the license for this file.
* Original copyright notice is "Copyright 20... |
final String candidateDisplayString = SpringValueFormatter.getDisplayString(candidate, editor, false);
if (boundValue != null && boundValue.getClass().isEnum()) {
final Enum<?> boundEnum = (Enum<?>) boundValue;
final String enumCodeAsString = ObjectUtils.getDisplayString(boundE... | 1,046 | 380 | 1,426 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/util/SpringStandardExpressionUtils.java | SpringStandardExpressionUtils | containsSpELInstantiationOrStaticOrParam | class SpringStandardExpressionUtils {
private static final char[] NEW_ARRAY = "wen".toCharArray(); // Inverted "new"
private static final int NEW_LEN = NEW_ARRAY.length;
private static final char[] PARAM_ARRAY = "marap".toCharArray(); // Inverted "param"
private static final int PARAM_LEN = PARAM_ARRA... |
/*
* Checks whether the expression contains instantiation of objects ("new SomeClass") or makes use of
* static methods ("T(SomeClass)") as both are forbidden in certain contexts in restricted mode.
*/
final String exp = ExpressionUtils.normalize(expression);
final... | 370 | 641 | 1,011 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/util/SpringValueFormatter.java | SpringValueFormatter | getDisplayString | class SpringValueFormatter {
/*
* NOTE This code is based on org.springframework.web.servlet.tags.form.ValueFormatter as of Spring 5.0.0
* Original license is Apache License 2.0, which is the same as the license for this file.
* Original copyright notice is "Copyright 2002-2012 the origin... |
if (propertyEditor != null && !(value instanceof String)) {
try {
propertyEditor.setValue(value);
final String text = propertyEditor.getAsText();
if (text != null) {
return getDisplayString(text, htmlEscape);
}
... | 244 | 119 | 363 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/web/webflux/MultiValueMapUtil.java | MultiValueMapUtil | cookieToStringArrayMultiMap | class MultiValueMapUtil {
static String[] EMPTY_VALUES = new String[0];
static Map<String,String[]> stringToStringArrayMultiMap(final MultiValueMap<String,String> multiValueMap) {
if (multiValueMap == null) {
return null;
}
final Map<String,String[]> stringArrayMap =
... |
if (multiValueMap == null) {
return null;
}
final Map<String,String[]> stringArrayMap =
new LinkedHashMap<String,String[]>(multiValueMap.size() + 1, 1.0f);
for (final Map.Entry<String, List<HttpCookie>> multiValueMapEntry : multiValueMap.entrySet()) {
... | 297 | 157 | 454 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/web/webflux/SpringWebFluxWebApplication.java | SpringWebFluxWebApplication | buildExchange | class SpringWebFluxWebApplication implements ISpringWebFluxWebApplication {
// This class is made NOT final so that it can be proxied by Dependency Injection frameworks
/*
* There is no equivalent in Spring WebFlux to an application-level attribute container (e.g. ServletContext).
* So for the attribute ... |
Validate.notNull(exchange, "ServerWebExchange cannot be null");
Validate.notNull(locale, "Locale cannot be null");
Validate.notNull(mediaType, "Media Type cannot be null");
Validate.notNull(charset, "Charset cannot be null");
final SpringWebFluxWebRequest request = new SpringW... | 587 | 130 | 717 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/web/webflux/SpringWebFluxWebExchange.java | SpringWebFluxWebExchange | getPrincipal | class SpringWebFluxWebExchange implements ISpringWebFluxWebExchange {
private final SpringWebFluxWebRequest webRequest;
private final SpringWebFluxWebApplication webApplication;
private SpringWebFluxWebSession webSession; // can be null, and is always lazily initialized
private boolean webSessionIniti... |
// ServerWebExchange returns a Mono<Principal>, which SpringStandardDialect makes sure to ask reactor to
// resolve before the view gets executed.
// NOTE this will not be available until just before the view starts executing
return this.exchange.getAttribute(SpringContextUtils.WEB_EXCH... | 1,078 | 94 | 1,172 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/web/webflux/SpringWebFluxWebSession.java | SpringWebFluxWebSession | setAttributeValue | class SpringWebFluxWebSession implements ISpringWebFluxWebSession {
private final WebSession session;
SpringWebFluxWebSession(final WebSession session) {
super();
Validate.notNull(session, "Session cannot be null");
this.session = session;
}
@Override
public boolean exist... |
Validate.notNull(name, "Name cannot be null");
if (value == null) {
this.session.getAttributes().remove(name);
} else {
this.session.getAttributes().put(name, value);
}
| 300 | 64 | 364 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/webflow/view/AjaxThymeleafView.java | AjaxThymeleafView | render | class AjaxThymeleafView extends ThymeleafView implements AjaxEnabledView {
private static final Logger vlogger = LoggerFactory.getLogger(AjaxThymeleafView.class);
private static final String FRAGMENTS_PARAM = "fragments";
private AjaxHandler ajaxHandler = null;
public AjaxThymeleafView() {
... |
final AjaxHandler templateAjaxHandler = getAjaxHandler();
if (templateAjaxHandler == null) {
throw new ConfigurationException("[THYMELEAF] AJAX Handler set into " +
AjaxThymeleafView.class.getSimpleName() + " instance for template " +
getTemplateNa... | 398 | 291 | 689 | <methods>public void <init>() ,public void <init>(java.lang.String) ,public java.lang.String getMarkupSelector() ,public void render(Map<java.lang.String,?>, jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse) throws java.lang.Exception,public void setMarkupSelector(java.lang.String) <var... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/webflow/view/AjaxThymeleafViewResolver.java | AjaxRedirectView | sendRedirect | class AjaxRedirectView extends RedirectView {
private static final Logger vlogger = LoggerFactory.getLogger(AjaxRedirectView.class);
private AjaxHandler ajaxHandler = new DefaultAjaxHandler();
AjaxRedirectView(final AjaxHandler ajaxHandler, final String redirectUrl,
fi... |
if (this.ajaxHandler == null) {
throw new ConfigurationException("[THYMELEAF] AJAX Handler set into " +
AjaxThymeleafViewResolver.class.getSimpleName() + " instance is null.");
}
if (this.ajaxHandler.isAjaxRequest(req... | 193 | 269 | 462 | <methods>public void <init>() ,public void addStaticVariable(java.lang.String, java.lang.Object) ,public boolean getAlwaysProcessRedirectAndForward() ,public java.lang.String getCharacterEncoding() ,public java.lang.String getContentType() ,public java.lang.String[] getExcludedViewNames() ,public boolean getForceConten... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/webflow/view/FlowAjaxThymeleafView.java | FlowAjaxThymeleafView | getRenderFragments | class FlowAjaxThymeleafView extends AjaxThymeleafView {
public FlowAjaxThymeleafView() {
super();
}
@Override
@SuppressWarnings("rawtypes")
protected Set<String> getRenderFragments(
final Map model, final HttpServletRequest request, final HttpServletResponse... |
final RequestContext context = RequestContextHolder.getRequestContext();
if (context == null) {
return super.getRenderFragments(model, request, response);
}
final String[] fragments = (String[]) context.getFlashScope().get(View.RENDER_FRAGMENTS_ATTRIBUTE);
... | 119 | 172 | 291 | <methods>public void <init>() ,public org.springframework.webflow.context.servlet.AjaxHandler getAjaxHandler() ,public void render(Map<java.lang.String,?>, jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse) throws java.lang.Exception,public void setAjaxHandler(org.springframework.webflow... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/cache/AbstractCacheManager.java | AbstractCacheManager | clearAllCaches | class AbstractCacheManager implements ICacheManager {
private volatile ICache<TemplateCacheKey,TemplateModel> templateCache;
private volatile boolean templateCacheInitialized = false;
private volatile ICache<ExpressionCacheKey,Object> expressionCache;
private volatile boolean expressionCacheInitializ... |
final ICache<TemplateCacheKey, TemplateModel> templateCacheObj = getTemplateCache();
if (templateCacheObj != null) {
templateCacheObj.clear();
}
final ICache<ExpressionCacheKey, Object> expressionCacheObj = getExpressionCache();
if (expressionCacheObj != null) {
... | 431 | 198 | 629 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/cache/ExpressionCacheKey.java | ExpressionCacheKey | equals | class ExpressionCacheKey implements Serializable {
private static final long serialVersionUID = 872451230923L;
private final String type;
private final String expression0;
private final String expression1;
private final int h;
public ExpressionCacheKey(final String type, final String express... |
if (this == o) {
return true;
}
if (!(o instanceof ExpressionCacheKey)) {
return false;
}
final ExpressionCacheKey that = (ExpressionCacheKey) o;
if (this.h != that.h) { // fail fast
return false;
}
if (!this.type.... | 537 | 167 | 704 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/cache/StandardCache.java | CacheDataContainer | putWithoutTracing | class CacheDataContainer<K,V> {
private final String name;
private final boolean sizeLimit;
private final int maxSize;
private final boolean traceExecution;
private final Logger logger;
private final ConcurrentHashMap<K,CacheEntry<V>> container;
private final Ob... |
// If we are not tracing, it's better to avoid the size() operation which has
// some performance implications in ConcurrentHashMap (iteration and counting these maps
// is slow if they are big)
final CacheEntry<V> existing = this.container.putIfAbsent(key, value);
... | 1,396 | 240 | 1,636 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/cache/TTLCacheEntryValidity.java | TTLCacheEntryValidity | isCacheStillValid | class TTLCacheEntryValidity
implements ICacheEntryValidity {
private final long cacheTTLMs;
private final long creationTimeInMillis;
/**
* <p>
* Creates a new instance of this validity implementation.
* </p>
*
* @param cacheTTLMs the TTL to be applied to the t... |
final long currentTimeInMillis = System.currentTimeMillis();
return (currentTimeInMillis < this.creationTimeInMillis + this.cacheTTLMs);
| 461 | 46 | 507 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/cache/TemplateCacheKey.java | TemplateCacheKey | computeHashCode | class TemplateCacheKey implements Serializable {
private static final long serialVersionUID = 45842555123291L;
private final String ownerTemplate;
private final String template;
private final Set<String> templateSelectors;
private final int lineOffset;
private final int colOffset;
private ... |
int result = this.ownerTemplate != null ? this.ownerTemplate.hashCode() : 0;
result = 31 * result + this.template.hashCode();
result = 31 * result + (this.templateSelectors != null ? this.templateSelectors.hashCode() : 0);
result = 31 * result + this.lineOffset;
result = 31 * re... | 1,333 | 173 | 1,506 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/context/AbstractEngineContext.java | AbstractEngineContext | getExpressionObjects | class AbstractEngineContext implements IEngineContext {
// NOTE we are not extending AbstractContext or AbstractExpressionContext on purpose, as the variable-oriented
// methods are going to be handled by the subclasses, not any superclasses.
private final IEngineConfiguration configuration;
private f... |
// We delay creation of expression objects in case they are not needed at all
if (this.expressionObjects == null) {
this.expressionObjects = new ExpressionObjects(this, this.configuration.getExpressionObjectFactory());
}
return this.expressionObjects;
| 1,014 | 66 | 1,080 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/context/AbstractExpressionContext.java | AbstractExpressionContext | getExpressionObjects | class AbstractExpressionContext extends AbstractContext implements IExpressionContext {
private final IEngineConfiguration configuration;
private IExpressionObjects expressionObjects = null;
protected AbstractExpressionContext(final IEngineConfiguration configuration) {
super();
Validate... |
// We delay creation of expression objects in case they are not needed at all
if (this.expressionObjects == null) {
this.expressionObjects = new ExpressionObjects(this, this.configuration.getExpressionObjectFactory());
}
return this.expressionObjects;
| 264 | 66 | 330 | <methods>public void clearVariables() ,public final boolean containsVariable(java.lang.String) ,public final java.util.Locale getLocale() ,public final java.lang.Object getVariable(java.lang.String) ,public final Set<java.lang.String> getVariableNames() ,public void removeVariable(java.lang.String) ,public void setLoca... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/context/IdentifierSequences.java | IdentifierSequences | getPreviousIDSeq | class IdentifierSequences {
private final Map<String,Integer> idCounts;
public IdentifierSequences() {
super();
this.idCounts = new HashMap<String,Integer>(1,1.0f);
}
/**
* <p>
* Returns a new index (ID count) for a specific
* value of the {@code id} attribut... |
Validate.notNull(id, "ID cannot be null");
final Integer count = this.idCounts.get(id);
if (count == null) {
throw new TemplateProcessingException(
"Cannot obtain previous ID count for ID \"" + id + "\"");
}
return Integer.valueOf(count.intValue()... | 542 | 91 | 633 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/context/LazyContextVariable.java | LazyContextVariable | getValue | class LazyContextVariable<T> implements ILazyContextVariable<T> {
private volatile boolean initialized = false;
private T value;
protected LazyContextVariable() {
super();
}
/**
* <p>
* Lazily resolve the value.
* </p>
* <p>
* This will be transparently call... |
if (!this.initialized) {
synchronized (this) {
if (!this.initialized) {
this.value = loadValue();
this.initialized = true;
}
}
}
return this.value;
| 312 | 65 | 377 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/context/StandardEngineContextFactory.java | StandardEngineContextFactory | createEngineContext | class StandardEngineContextFactory implements IEngineContextFactory {
public StandardEngineContextFactory() {
super();
}
public IEngineContext createEngineContext(
final IEngineConfiguration configuration, final TemplateData templateData,
final Map<String, Object> tem... |
Validate.notNull(context, "Context object cannot be null");
// NOTE calling getVariableNames() on an IWebContext would be very expensive, as it would mean
// calling HttpServletRequest#getAttributeNames(), which is very slow in some common implementations
// (e.g. Apache Tomcat). So i... | 96 | 433 | 529 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/engine/AbstractElementTag.java | AbstractElementTag | toString | class AbstractElementTag extends AbstractTemplateEvent implements IElementTag {
final TemplateMode templateMode;
final ElementDefinition elementDefinition;
final String elementCompleteName;
final boolean synthetic;
protected AbstractElementTag(
final TemplateMode templateMode,
... |
final Writer stringWriter = new FastStringWriter();
try {
write(stringWriter);
} catch (final IOException e) {
throw new TemplateProcessingException("Exception while creating String representation of model entity", e);
}
return stringWriter.toString();
... | 376 | 68 | 444 | <methods>public final int getCol() ,public final int getLine() ,public final java.lang.String getTemplateName() ,public final boolean hasLocation() <variables>final non-sealed int col,final non-sealed int line,final non-sealed java.lang.String templateName |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/engine/AbstractGatheringModelProcessable.java | AbstractGatheringModelProcessable | gatherText | class AbstractGatheringModelProcessable implements IGatheringModelProcessable {
private final ProcessorTemplateHandler processorTemplateHandler;
private final IEngineContext context;
private final Model syntheticModel;
private final TemplateModelController modelController;
private final TemplateFl... |
if (this.gatheringFinished) {
throw new TemplateProcessingException("Gathering is finished already! We cannot gather more events");
}
this.syntheticModel.add(text);
| 1,667 | 53 | 1,720 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/engine/AbstractTemplateEvent.java | AbstractTemplateEvent | hasLocation | class AbstractTemplateEvent implements ITemplateEvent {
final String templateName;
final int line;
final int col;
AbstractTemplateEvent() {
this(null, -1, -1);
}
AbstractTemplateEvent(final String templateName, final int line, final int col) {
super();
this.templateN... |
return (this.templateName != null && this.line != -1 && this.col != -1);
| 254 | 31 | 285 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/engine/AbstractTextualTemplateEvent.java | AbstractTextualTemplateEvent | computeInlineable | class AbstractTextualTemplateEvent extends AbstractTemplateEvent implements IEngineTemplateEvent {
private final CharSequence contentCharSeq;
private final String contentStr;
private final int contentLength;
private volatile String computedContentStr = null;
private volatile int computedContentLen... |
int n = getContentLength(); // This will leave computedContentLength computed in case it's needed afterwards
if (n == 0) {
return Boolean.FALSE;
}
char c0, c1;
c0 = 0x0;
int inline = 0;
while (n-- != 0) {
c1 = charAtContent(n);
... | 1,394 | 268 | 1,662 | <methods>public final int getCol() ,public final int getLine() ,public final java.lang.String getTemplateName() ,public final boolean hasLocation() <variables>final non-sealed int col,final non-sealed int line,final non-sealed java.lang.String templateName |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/engine/Attribute.java | Attribute | hasLocation | class Attribute implements IAttribute {
static final String DEFAULT_OPERATOR = "=";
/*
* Note: An Attribute should not be made responsible for converting non-String values to String, or computing
* the boolean-ness of attributes or their representation. All these should be the responsibility of the
... |
return (this.templateName != null && this.line != -1 && this.col != -1);
| 1,267 | 31 | 1,298 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/engine/AttributeDefinition.java | AttributeDefinition | equals | class AttributeDefinition {
final AttributeName attributeName;
private final Set<IElementProcessor> associatedProcessorsSet;
final IElementProcessor[] associatedProcessors; // The internal representation is an array for better performance
final boolean hasAssociatedProcessors;
AttributeDefinition... |
if (this == o) {
return true;
}
if (!o.getClass().equals(this.getClass())) {
return false;
}
final AttributeDefinition that = (AttributeDefinition) o;
if (!this.attributeName.equals(that.attributeName)) {
return false;
}
... | 479 | 94 | 573 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/engine/AttributeName.java | AttributeName | equals | class AttributeName {
/*
* NOTE it is VERY important that an AttributeName does NOT contain a TemplateMode, because there is a type
* of AttributeName (TextAttributeName) that is used for 3 different template modes: TEXT, JAVASCRIPT and CSS
*/
protected final String prefix;
protected final ... |
if (this == o) {
return true;
}
if (o == null) {
return false;
}
if (!o.getClass().equals(this.getClass())) {
return false;
}
final AttributeName that = (AttributeName) o;
if (this.h != that.h) {
return... | 519 | 159 | 678 | <no_super_class> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.