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/src/main/java/org/thymeleaf/standard/expression/MessageExpression.java | MessageExpression | executeMessageExpression | class MessageExpression extends SimpleExpression {
private static final Logger logger = LoggerFactory.getLogger(MessageExpression.class);
private static final long serialVersionUID = 8394399541792390735L;
private static final Object[] NO_PARAMETERS = new Object[0];
static final char SELE... |
if (logger.isTraceEnabled()) {
logger.trace("[THYMELEAF][{}] Evaluating message: \"{}\"", TemplateEngine.threadIndex(), expression.getStringRepresentation());
}
if (!(context instanceof ITemplateContext)) {
throw new TemplateProcessingException(
"Ca... | 1,242 | 537 | 1,779 | <methods><variables>static final char EXPRESSION_END_CHAR,static final char EXPRESSION_START_CHAR,private static final long serialVersionUID |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/MinusExpression.java | MinusExpression | composeMinusExpression | class MinusExpression extends ComplexExpression {
private static final long serialVersionUID = -9056215047277857192L;
private static final Logger logger = LoggerFactory.getLogger(MinusExpression.class);
private static final char OPERATOR = '-';
// Future proof, just in case in the future w... |
// Returning "state" means "try next in chain" or "success"
// Returning "null" means parsing error
final String input = state.get(nodeIndex).getInput();
if (StringUtils.isEmptyOrWhitespace(input)) {
return null;
}
final String trimmedInput = input.trim()... | 657 | 283 | 940 | <methods><variables>private static final long serialVersionUID |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/MultiplicationDivisionRemainderExpression.java | MultiplicationDivisionRemainderExpression | isRightAllowed | class MultiplicationDivisionRemainderExpression extends BinaryOperationExpression {
private static final long serialVersionUID = -1364531602981256885L;
protected static final String MULTIPLICATION_OPERATOR = "*";
protected static final String DIVISION_OPERATOR = "/";
protected static final S... |
return right != null &&
!(right instanceof Token && !(right instanceof NumberTokenExpression)) &&
!(right instanceof TextLiteralExpression);
| 728 | 39 | 767 | <methods>public org.thymeleaf.standard.expression.IStandardExpression getLeft() ,public org.thymeleaf.standard.expression.IStandardExpression getRight() <variables>private final non-sealed org.thymeleaf.standard.expression.IStandardExpression left,private final non-sealed org.thymeleaf.standard.expression.IStandardExpr... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/MultiplicationExpression.java | MultiplicationExpression | executeMultiplication | class MultiplicationExpression extends MultiplicationDivisionRemainderExpression {
private static final long serialVersionUID = 4822815123712162053L;
private static final Logger logger = LoggerFactory.getLogger(MultiplicationExpression.class);
public MultiplicationExpression(final IStandardExpr... |
if (logger.isTraceEnabled()) {
logger.trace("[THYMELEAF][{}] Evaluating multiplication expression: \"{}\"", TemplateEngine.threadIndex(), expression.getStringRepresentation());
}
Object leftValue = expression.getLeft().execute(context, expContext);
Object rightValu... | 209 | 290 | 499 | <methods><variables>protected static final java.lang.String DIVISION_OPERATOR,protected static final java.lang.String DIVISION_OPERATOR_2,private static final non-sealed java.lang.reflect.Method LEFT_ALLOWED_METHOD,private static final boolean[] LENIENCIES,protected static final java.lang.String MULTIPLICATION_OPERATOR... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/NegationExpression.java | NegationExpression | composeNegationExpression | class NegationExpression extends ComplexExpression {
private static final long serialVersionUID = -7131967162611145337L;
private static final Logger logger = LoggerFactory.getLogger(NegationExpression.class);
private static final String OPERATOR_1 = "!";
private static final String OPERATO... |
// Returning "state" means "try next in chain" or "success"
// Returning "null" means parsing error
final String input = state.get(nodeIndex).getInput();
if (StringUtils.isEmptyOrWhitespace(input)) {
return null;
}
final String trimmedInput = input.trim()... | 581 | 360 | 941 | <methods><variables>private static final long serialVersionUID |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/NoOpTokenExpression.java | NoOpTokenExpression | parseNoOpTokenExpression | class NoOpTokenExpression extends Token {
private static final Logger logger = LoggerFactory.getLogger(NoOpTokenExpression.class);
private static final long serialVersionUID = -5180150929940011L;
private static final NoOpTokenExpression SINGLETON = new NoOpTokenExpression();
public NoOpTokenExpress... |
if (input.length() == 1 && input.charAt(0) == '_') {
return SINGLETON;
}
return null;
| 275 | 41 | 316 | <methods>public java.lang.String getStringRepresentation() ,public java.lang.Object getValue() ,public static boolean isTokenChar(java.lang.String, int) ,public java.lang.String toString() <variables>private static final long serialVersionUID,private final non-sealed java.lang.Object value |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/NotEqualsExpression.java | NotEqualsExpression | executeNotEquals | class NotEqualsExpression extends EqualsNotEqualsExpression {
private static final long serialVersionUID = 5831688164085171802L;
private static final Logger logger = LoggerFactory.getLogger(NotEqualsExpression.class);
public NotEqualsExpression(final IStandardExpression left, final IStandardEx... |
Object leftValue = expression.getLeft().execute(context, expContext);
Object rightValue = expression.getRight().execute(context, expContext);
leftValue = LiteralValue.unwrap(leftValue);
rightValue = LiteralValue.unwrap(rightValue);
if (leftValue == null) {
return ... | 222 | 490 | 712 | <methods><variables>protected static final java.lang.String EQUALS_OPERATOR,protected static final java.lang.String EQUALS_OPERATOR_2,private static final non-sealed java.lang.reflect.Method LEFT_ALLOWED_METHOD,private static final boolean[] LENIENCIES,protected static final java.lang.String NOT_EQUALS_OPERATOR,protect... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/NullTokenExpression.java | NullTokenExpression | executeNullTokenExpression | class NullTokenExpression extends Token {
private static final Logger logger = LoggerFactory.getLogger(NullTokenExpression.class);
private static final long serialVersionUID = -927282151625647619L;
private static final NullTokenExpression SINGLETON = new NullTokenExpression();
public NullTokenExpre... |
if (logger.isTraceEnabled()) {
logger.trace("[THYMELEAF][{}] Evaluating null token: \"{}\"", TemplateEngine.threadIndex(), expression.getStringRepresentation());
}
return expression.getValue();
| 238 | 68 | 306 | <methods>public java.lang.String getStringRepresentation() ,public java.lang.Object getValue() ,public static boolean isTokenChar(java.lang.String, int) ,public java.lang.String toString() <variables>private static final long serialVersionUID,private final non-sealed java.lang.Object value |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/NumberTokenExpression.java | NumberTokenExpression | parseNumberTokenExpression | class NumberTokenExpression extends Token {
private static final Logger logger = LoggerFactory.getLogger(NumberTokenExpression.class);
private static final long serialVersionUID = -3729844055243242571L;
public static final char DECIMAL_POINT = '.';
static Number computeValue(final String ... |
if (StringUtils.isEmptyOrWhitespace(input)) {
return null;
}
boolean decimalFound = false;
final int inputLen = input.length();
for (int i = 0; i < inputLen; i++) {
final char c = input.charAt(i);
if (Character.isDigit(c)) {
co... | 399 | 204 | 603 | <methods>public java.lang.String getStringRepresentation() ,public java.lang.Object getValue() ,public static boolean isTokenChar(java.lang.String, int) ,public java.lang.String toString() <variables>private static final long serialVersionUID,private final non-sealed java.lang.Object value |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/OGNLContextPropertyAccessor.java | OGNLContextPropertyAccessor | getSourceAccessor | class OGNLContextPropertyAccessor implements PropertyAccessor {
private static final Logger LOGGER = LoggerFactory.getLogger(OGNLContextPropertyAccessor.class);
public static final String RESTRICT_REQUEST_PARAMETERS = "%RESTRICT_REQUEST_PARAMETERS%";
static final String REQUEST_PARAMETERS_RESTRICTED_VARIA... |
// This method is called during OGNL's bytecode enhancement optimizations in order to determine better-
// performing methods to access the properties of an object. It's been written trying to mimic
// what is done at MapPropertyAccessor#getSourceAccessor() method, removing all the parts relate... | 819 | 134 | 953 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/OGNLExpressionObjectsWrapper.java | OGNLExpressionObjectsWrapper | put | class OGNLExpressionObjectsWrapper extends HashMap<String, Object> {
private final IExpressionObjects expressionObjects;
OGNLExpressionObjectsWrapper(final IExpressionObjects expressionObjects) {
super(5);
this.expressionObjects = expressionObjects;
}
@Override
public int size()... |
if (this.expressionObjects.containsObject(key.toString())) {
throw new IllegalArgumentException(
"Cannot put entry with key \"" + key + "\" into Expression Objects wrapper map: key matches the " +
"name of one of the expression objects");
}
re... | 825 | 80 | 905 | <methods>public void <init>() ,public void <init>(int) ,public void <init>(Map<? extends java.lang.String,? extends java.lang.Object>) ,public void <init>(int, float) ,public void clear() ,public java.lang.Object clone() ,public java.lang.Object compute(java.lang.String, BiFunction<? super java.lang.String,? super java... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/OrExpression.java | OrExpression | executeOr | class OrExpression extends BinaryOperationExpression {
private static final long serialVersionUID = -8085738202412415337L;
private static final Logger logger = LoggerFactory.getLogger(OrExpression.class);
private static final String OPERATOR = "or";
static final String[] OPERATORS = new String[] {OP... |
if (logger.isTraceEnabled()) {
logger.trace("[THYMELEAF][{}] Evaluating OR expression: \"{}\"", TemplateEngine.threadIndex(), expression.getStringRepresentation());
}
final Object leftValue = expression.getLeft().execute(context, expContext);
// Short circuit
fina... | 626 | 177 | 803 | <methods>public org.thymeleaf.standard.expression.IStandardExpression getLeft() ,public org.thymeleaf.standard.expression.IStandardExpression getRight() <variables>private final non-sealed org.thymeleaf.standard.expression.IStandardExpression left,private final non-sealed org.thymeleaf.standard.expression.IStandardExpr... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/RemainderExpression.java | RemainderExpression | executeRemainder | class RemainderExpression extends MultiplicationDivisionRemainderExpression {
private static final long serialVersionUID = -8830009392616779821L;
private static final Logger logger = LoggerFactory.getLogger(RemainderExpression.class);
public RemainderExpression(final IStandardExpression left, ... |
if (logger.isTraceEnabled()) {
logger.trace("[THYMELEAF][{}] Evaluating remainder expression: \"{}\"", TemplateEngine.threadIndex(), expression.getStringRepresentation());
}
Object leftValue = expression.getLeft().execute(context, expContext);
Object rightValue = e... | 214 | 290 | 504 | <methods><variables>protected static final java.lang.String DIVISION_OPERATOR,protected static final java.lang.String DIVISION_OPERATOR_2,private static final non-sealed java.lang.reflect.Method LEFT_ALLOWED_METHOD,private static final boolean[] LENIENCIES,protected static final java.lang.String MULTIPLICATION_OPERATOR... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/SelectionVariableExpression.java | SelectionVariableExpression | executeSelectionVariableExpression | class SelectionVariableExpression extends SimpleExpression implements IStandardVariableExpression {
private static final Logger logger = LoggerFactory.getLogger(SelectionVariableExpression.class);
private static final long serialVersionUID = 854441190427550056L;
static final char SELECTOR = '*';
... |
if (logger.isTraceEnabled()) {
logger.trace("[THYMELEAF][{}] Evaluating selection variable expression: \"{}\"", TemplateEngine.threadIndex(), expression.getStringRepresentation());
}
final StandardExpressionExecutionContext evalExpContext =
(expression.getC... | 880 | 367 | 1,247 | <methods><variables>static final char EXPRESSION_END_CHAR,static final char EXPRESSION_START_CHAR,private static final long serialVersionUID |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/SimpleExpression.java | SimpleExpression | executeSimple | class SimpleExpression extends Expression {
private static final long serialVersionUID = 9145380484247069725L;
static final char EXPRESSION_START_CHAR = '{';
static final char EXPRESSION_END_CHAR = '}';
protected SimpleExpression() {
super();
}
... |
if (expression instanceof VariableExpression) {
return VariableExpression.executeVariableExpression(context, (VariableExpression)expression, expressionEvaluator, expContext);
}
if (expression instanceof MessageExpression) {
return MessageExpression.executeMessag... | 169 | 503 | 672 | <methods>public java.lang.Object execute(org.thymeleaf.context.IExpressionContext) ,public java.lang.Object execute(org.thymeleaf.context.IExpressionContext, org.thymeleaf.standard.expression.StandardExpressionExecutionContext) ,public abstract java.lang.String getStringRepresentation() ,public java.lang.String toStrin... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/StandardExpressionExecutionContext.java | StandardExpressionExecutionContext | withTypeConversion | class StandardExpressionExecutionContext {
public static final StandardExpressionExecutionContext RESTRICTED =
new StandardExpressionExecutionContext(true, true, false, false);
public static final StandardExpressionExecutionContext RESTRICTED_FORBID_UNSAFE_EXP_RESULTS =
new StandardExp... |
if (getPerformTypeConversion()) {
return this;
}
if (this == NORMAL) {
return NORMAL_WITH_TYPE_CONVERSION;
}
if (this == RESTRICTED) {
return RESTRICTED_WITH_TYPE_CONVERSION;
}
if (this == RESTRICTED_FORBID_UNSAFE_EXP_RESULTS) ... | 807 | 181 | 988 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/StandardExpressionParser.java | StandardExpressionParser | parseEach | class StandardExpressionParser implements IStandardExpressionParser {
public StandardExpressionParser() {
super();
}
public Expression parseExpression(
final IExpressionContext context,
final String input) {
Validate.notNull(context, "Context cannot b... |
Validate.notNull(context, "Context cannot be null");
Validate.notNull(input, "Input cannot be null");
return EachUtils.parseEach(context, input);
| 660 | 48 | 708 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/StandardExpressionPreprocessor.java | StandardExpressionPreprocessor | preprocess | class StandardExpressionPreprocessor {
private static final char PREPROCESS_DELIMITER = '_';
private static final String PREPROCESS_EVAL = "\\_\\_(.*?)\\_\\_";
private static final Pattern PREPROCESS_EVAL_PATTERN = Pattern.compile(PREPROCESS_EVAL, Pattern.DOTALL);
static String preprocess(
... |
if (input.indexOf(PREPROCESS_DELIMITER) == -1) {
// Fail quick
return input;
}
final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(context.getConfiguration());
if (!(expressionParser instanceof StandardExpressionParser)) {... | 634 | 435 | 1,069 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/StandardExpressions.java | StandardExpressions | getExpressionParser | class StandardExpressions {
/**
* Name used for registering the <i>Standard Variable Expression Evaluator</i> object as an
* <i>execution attribute</i> at the Standard Dialects.
*/
public static final String STANDARD_VARIABLE_EXPRESSION_EVALUATOR_ATTRIBUTE_NAME = "StandardVariableExpressionEval... |
final Object parser =
configuration.getExecutionAttributes().get(STANDARD_EXPRESSION_PARSER_ATTRIBUTE_NAME);
if (parser == null || (!(parser instanceof IStandardExpressionParser))) {
throw new TemplateProcessingException(
"No Standard Expression Parser ha... | 1,119 | 198 | 1,317 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/SubtractionExpression.java | SubtractionExpression | executeSubtraction | class SubtractionExpression extends AdditionSubtractionExpression {
private static final long serialVersionUID = 4125686854902098944L;
private static final Logger logger = LoggerFactory.getLogger(SubtractionExpression.class);
public SubtractionExpression(final IStandardExpression left, ... |
if (logger.isTraceEnabled()) {
logger.trace("[THYMELEAF][{}] Evaluating subtraction expression: \"{}\"", TemplateEngine.threadIndex(), expression.getStringRepresentation());
}
Object leftValue = expression.getLeft().execute(context, expContext);
Object rightValue =... | 213 | 292 | 505 | <methods><variables>protected static final java.lang.String ADDITION_OPERATOR,private static final non-sealed java.lang.reflect.Method LEFT_ALLOWED_METHOD,private static final boolean[] LENIENCIES,static final java.lang.String[] OPERATORS,private static final Class<? extends org.thymeleaf.standard.expression.BinaryOper... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/TextLiteralExpression.java | TextLiteralExpression | unescapeLiteral | class TextLiteralExpression extends SimpleExpression {
private static final Logger logger = LoggerFactory.getLogger(TextLiteralExpression.class);
private static final long serialVersionUID = 6511847028638506552L;
static final char ESCAPE_PREFIX = '\\';
static final char DELIMITER = '\'';
... |
if (text == null) {
return null;
}
StringBuilder strBuilder = null;
final int max = text.length();
int readOffset = 0;
int referenceOffset = 0;
char c;
for (int i = 0; i < max; i++) {
c = text.charAt(i);
/*
... | 954 | 541 | 1,495 | <methods><variables>static final char EXPRESSION_END_CHAR,static final char EXPRESSION_START_CHAR,private static final long serialVersionUID |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/Token.java | Token | isTokenChar | class Token extends SimpleExpression {
private static final long serialVersionUID = 4357087922344497120L;
private final Object value;
protected Token(final Object value) {
super();
this.value = value;
}
public Object getValue() {
return this.va... |
/*
* TOKEN chars: A-Za-z0-9[]._ (plus '-' in some contexts)
* (additionally, also, a series of internationalized characters: accents, other alphabets, etc.)
*
* '-' can also be a numeric operator, so it will only be considered a token char if:
* * there are imme... | 398 | 1,298 | 1,696 | <methods><variables>static final char EXPRESSION_END_CHAR,static final char EXPRESSION_START_CHAR,private static final long serialVersionUID |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/expression/VariableExpression.java | VariableExpression | executeVariableExpression | class VariableExpression extends SimpleExpression implements IStandardVariableExpression {
private static final Logger logger = LoggerFactory.getLogger(VariableExpression.class);
private static final long serialVersionUID = -4911752782987240708L;
static final char SELECTOR = '$';
... |
if (logger.isTraceEnabled()) {
logger.trace("[THYMELEAF][{}] Evaluating variable expression: \"{}\"", TemplateEngine.threadIndex(), expression.getStringRepresentation());
}
final StandardExpressionExecutionContext evalExpContext =
(expression.getConvertToString... | 906 | 366 | 1,272 | <methods><variables>static final char EXPRESSION_END_CHAR,static final char EXPRESSION_START_CHAR,private static final long serialVersionUID |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/inline/StandardCSSInliner.java | StandardCSSInliner | produceEscapedOutput | class StandardCSSInliner extends AbstractStandardInliner {
private final IStandardCSSSerializer serializer;
public StandardCSSInliner(final IEngineConfiguration configuration) {
super(configuration, TemplateMode.CSS);
this.serializer = StandardSerializers.getCSSSerializer(configuration);
... |
final Writer cssWriter = new FastStringWriter(input instanceof String? ((String)input).length() * 2 : 20);
this.serializer.serializeValue(input, cssWriter);
return cssWriter.toString();
| 115 | 59 | 174 | <methods>public final java.lang.String getName() ,public final java.lang.CharSequence inline(org.thymeleaf.context.ITemplateContext, org.thymeleaf.model.IText) ,public final java.lang.CharSequence inline(org.thymeleaf.context.ITemplateContext, org.thymeleaf.model.ICDATASection) ,public final java.lang.CharSequence inli... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/inline/StandardHTMLInliner.java | StandardHTMLInliner | produceEscapedOutput | class StandardHTMLInliner extends AbstractStandardInliner {
public StandardHTMLInliner(final IEngineConfiguration configuration) {
super(configuration, TemplateMode.HTML);
}
@Override
protected String produceEscapedOutput(final Object input) {<FILL_FUNCTION_BODY>}
} |
if (input == null) {
return "";
}
return HtmlEscape.escapeHtml4Xml(input.toString());
| 81 | 36 | 117 | <methods>public final java.lang.String getName() ,public final java.lang.CharSequence inline(org.thymeleaf.context.ITemplateContext, org.thymeleaf.model.IText) ,public final java.lang.CharSequence inline(org.thymeleaf.context.ITemplateContext, org.thymeleaf.model.ICDATASection) ,public final java.lang.CharSequence inli... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/inline/StandardJavaScriptInliner.java | StandardJavaScriptInliner | produceEscapedOutput | class StandardJavaScriptInliner extends AbstractStandardInliner {
private final IStandardJavaScriptSerializer serializer;
public StandardJavaScriptInliner(final IEngineConfiguration configuration) {
super(configuration, TemplateMode.JAVASCRIPT);
this.serializer = StandardSerializers.getJavaSc... |
final Writer jsWriter = new FastStringWriter(input instanceof String? ((String)input).length() * 2 : 20);
this.serializer.serializeValue(input, jsWriter);
return jsWriter.toString();
| 118 | 59 | 177 | <methods>public final java.lang.String getName() ,public final java.lang.CharSequence inline(org.thymeleaf.context.ITemplateContext, org.thymeleaf.model.IText) ,public final java.lang.CharSequence inline(org.thymeleaf.context.ITemplateContext, org.thymeleaf.model.ICDATASection) ,public final java.lang.CharSequence inli... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/inline/StandardTextInliner.java | StandardTextInliner | produceEscapedOutput | class StandardTextInliner extends AbstractStandardInliner {
public StandardTextInliner(final IEngineConfiguration configuration) {
super(configuration, TemplateMode.TEXT);
}
@Override
protected String produceEscapedOutput(final Object input) {<FILL_FUNCTION_BODY>}
} |
if (input == null) {
return "";
}
return HtmlEscape.escapeHtml4Xml(input.toString());
| 81 | 36 | 117 | <methods>public final java.lang.String getName() ,public final java.lang.CharSequence inline(org.thymeleaf.context.ITemplateContext, org.thymeleaf.model.IText) ,public final java.lang.CharSequence inline(org.thymeleaf.context.ITemplateContext, org.thymeleaf.model.ICDATASection) ,public final java.lang.CharSequence inli... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/inline/StandardXMLInliner.java | StandardXMLInliner | produceEscapedOutput | class StandardXMLInliner extends AbstractStandardInliner {
public StandardXMLInliner(final IEngineConfiguration configuration) {
super(configuration, TemplateMode.XML);
}
@Override
protected String produceEscapedOutput(final Object input) {<FILL_FUNCTION_BODY>}
} |
if (input == null) {
return "";
}
// Note we are outputting a body content here, so it is important that we use the version
// of XML escaping meant for content, not attributes (slight differences)
return XmlEscape.escapeXml10(input.toString());
| 81 | 76 | 157 | <methods>public final java.lang.String getName() ,public final java.lang.CharSequence inline(org.thymeleaf.context.ITemplateContext, org.thymeleaf.model.IText) ,public final java.lang.CharSequence inline(org.thymeleaf.context.ITemplateContext, org.thymeleaf.model.ICDATASection) ,public final java.lang.CharSequence inli... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/AbstractStandardAssertionTagProcessor.java | AbstractStandardAssertionTagProcessor | doProcess | class AbstractStandardAssertionTagProcessor extends AbstractAttributeTagProcessor {
protected AbstractStandardAssertionTagProcessor(
final TemplateMode templateMode, final String dialectPrefix, final String attrName, final int precedence) {
super(templateMode, dialectPrefix, null, false, attr... |
if (StringUtils.isEmptyOrWhitespace(attributeValue)) {
return;
}
final ExpressionSequence expressionSequence =
ExpressionSequenceUtils.parseExpressionSequence(context, attributeValue);
final List<IStandardExpression> expressions = expressionSequence.getExp... | 154 | 185 | 339 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/AbstractStandardAttributeModifierTagProcessor.java | AbstractStandardAttributeModifierTagProcessor | doProcess | class AbstractStandardAttributeModifierTagProcessor
extends AbstractStandardExpressionAttributeTagProcessor
implements IAttributeDefinitionsAware {
private final boolean removeIfEmpty;
private final String targetAttrCompleteName;
private AttributeDefinition targetAttributeDefiniti... |
final String newAttributeValue =
EscapedAttributeUtils.escapeAttribute(getTemplateMode(), expressionResult == null ? null : expressionResult.toString());
// These attributes might be "removable if empty", in which case we would simply remove the target attribute...
if (this.re... | 1,800 | 206 | 2,006 | <methods><variables>private final non-sealed org.thymeleaf.standard.expression.StandardExpressionExecutionContext expressionExecutionContext,private final non-sealed boolean removeIfNoop |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/AbstractStandardConditionalVisibilityTagProcessor.java | AbstractStandardConditionalVisibilityTagProcessor | doProcess | class AbstractStandardConditionalVisibilityTagProcessor extends AbstractAttributeTagProcessor {
/*
* It is IMPORTANT THAT THIS CLASS DOES NOT EXTEND FROM AbstractStandardExpressionAttributeTagProcessor because
* such thing would mean that the expression would be evaluated in the parent class, and this wo... |
final boolean visible = isVisible(context, tag, attributeName, attributeValue);
if (!visible) {
structureHandler.removeElement();
}
| 308 | 43 | 351 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/AbstractStandardDoubleAttributeModifierTagProcessor.java | AbstractStandardDoubleAttributeModifierTagProcessor | doProcess | class AbstractStandardDoubleAttributeModifierTagProcessor
extends AbstractStandardExpressionAttributeTagProcessor
implements IAttributeDefinitionsAware {
private final boolean removeIfEmpty;
private final String attributeOneCompleteName;
private final String attributeTwoCompleteNam... |
final String newAttributeValue =
EscapedAttributeUtils.escapeAttribute(getTemplateMode(), expressionResult == null ? null : expressionResult.toString());
// These attributes might be "removable if empty", in which case we would simply remove the target attributes...
if (this.r... | 492 | 224 | 716 | <methods><variables>private final non-sealed org.thymeleaf.standard.expression.StandardExpressionExecutionContext expressionExecutionContext,private final non-sealed boolean removeIfNoop |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/AbstractStandardExpressionAttributeTagProcessor.java | AbstractStandardExpressionAttributeTagProcessor | doProcess | class AbstractStandardExpressionAttributeTagProcessor extends AbstractAttributeTagProcessor {
private final StandardExpressionExecutionContext expressionExecutionContext;
private final boolean removeIfNoop;
/**
* <p>
* Build a new instance of this tag processor.
* </p>
*
* @pa... |
final Object expressionResult;
if (attributeValue != null) {
final IStandardExpression expression = EngineEventUtils.computeAttributeExpression(context, tag, attributeName, attributeValue);
if (expression != null && expression instanceof FragmentExpression) {
... | 839 | 382 | 1,221 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/AbstractStandardMultipleAttributeModifierTagProcessor.java | AbstractStandardMultipleAttributeModifierTagProcessor | doProcess | class AbstractStandardMultipleAttributeModifierTagProcessor extends AbstractAttributeTagProcessor {
protected enum ModificationType { SUBSTITUTION, APPEND, PREPEND, APPEND_WITH_SPACE, PREPEND_WITH_SPACE }
private final ModificationType modificationType;
private final boolean restrictedExpressionExecution... |
final AssignationSequence assignations =
AssignationUtils.parseAssignationSequence(
context, attributeValue, false /* no parameters without value */);
if (assignations == null) {
throw new TemplateProcessingException(
"Could not ... | 611 | 977 | 1,588 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/AbstractStandardTargetSelectionTagProcessor.java | AbstractStandardTargetSelectionTagProcessor | validateSelectionValue | class AbstractStandardTargetSelectionTagProcessor extends AbstractAttributeTagProcessor {
protected AbstractStandardTargetSelectionTagProcessor(
final TemplateMode templateMode, final String dialectPrefix, final String attrName, final int precedence) {
super(templateMode, dialectPrefix, null, ... |
// Meant for being overridden. Nothing to be done in default implementation.
| 508 | 22 | 530 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/AbstractStandardTextInlineSettingTagProcessor.java | AbstractStandardTextInlineSettingTagProcessor | doProcess | class AbstractStandardTextInlineSettingTagProcessor extends AbstractAttributeTagProcessor {
/*
* NOTE This class does not extend AbstractStandardExpressionAttributeTagProcessor because expressions are
* actually NOT ALLOWED as values of a th:inline attribute, so that parsing-time event preprocessors... |
// Note we are NOT executing the attributeValue as a Standard Expression: we are expecting a literal (see comment above)
final IInliner inliner = getInliner(context, StandardInlineMode.parse(attributeValue));
structureHandler.setInliner(inliner);
| 361 | 74 | 435 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardBlockTagProcessor.java | StandardBlockTagProcessor | doProcess | class StandardBlockTagProcessor extends AbstractElementTagProcessor {
public static final int PRECEDENCE = 100000;
public static final String ELEMENT_NAME = "block";
public StandardBlockTagProcessor(final TemplateMode templateMode, final String dialectPrefix, final String elementName) {
super(te... |
// We are just removing the "<th:block>", leaving whichever contents (body) it might have generated.
structureHandler.removeTags();
| 167 | 41 | 208 | <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/src/main/java/org/thymeleaf/standard/processor/StandardCaseTagProcessor.java | StandardCaseTagProcessor | isVisible | class StandardCaseTagProcessor extends AbstractStandardConditionalVisibilityTagProcessor {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
public static final int PRECEDENCE = 275;
public static final String ATTR_NAME = "case";
public static final String CASE_DEFAULT_ATTRIBU... |
/*
* Note the th:case processors must admit the concept of SHORTCUT inside the enclosing th:switch, which means
* that once one th:case has evaluated to true, no other th:case should be evaluated at all. It is because
* of this that this class should not extend from any other that e... | 198 | 617 | 815 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardClassappendTagProcessor.java | StandardClassappendTagProcessor | doProcess | class StandardClassappendTagProcessor
extends AbstractStandardExpressionAttributeTagProcessor
implements IAttributeDefinitionsAware {
public static final int PRECEDENCE = 1100;
public static final String ATTR_NAME = "classappend";
public static final String TARGET_ATTR_NAME = "class";
... |
String newAttributeValue =
EscapedAttributeUtils.escapeAttribute(getTemplateMode(), expressionResult == null ? null : expressionResult.toString());
// If we are not adding anything, we'll just leave it untouched
if (newAttributeValue != null && newAttributeValue.length() > 0) ... | 364 | 202 | 566 | <methods><variables>private final non-sealed org.thymeleaf.standard.expression.StandardExpressionExecutionContext expressionExecutionContext,private final non-sealed boolean removeIfNoop |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardConditionalCommentProcessor.java | StandardConditionalCommentProcessor | doProcess | class StandardConditionalCommentProcessor extends AbstractCommentProcessor {
public static final int PRECEDENCE = 1100;
public StandardConditionalCommentProcessor() {
super(TemplateMode.HTML, PRECEDENCE);
}
@Override
protected void doProcess(
final ITemplateContext contex... |
final StandardConditionalCommentUtils.ConditionalCommentParsingResult parsingResult =
StandardConditionalCommentUtils.parseConditionalComment(comment);
if (parsingResult == null) {
// This is NOT a Conditional Comment. Just return
return;
}
fi... | 117 | 482 | 599 | <methods>public void <init>(org.thymeleaf.templatemode.TemplateMode, int) ,public final void process(org.thymeleaf.context.ITemplateContext, org.thymeleaf.model.IComment, org.thymeleaf.processor.comment.ICommentStructureHandler) <variables> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardConditionalFixedValueTagProcessor.java | StandardConditionalFixedValueTagProcessor | setAttributeDefinitions | class StandardConditionalFixedValueTagProcessor
extends AbstractStandardExpressionAttributeTagProcessor
implements IAttributeDefinitionsAware {
public static final int PRECEDENCE = 1000;
public static final String[] ATTR_NAMES =
new String[] {
"async", ... |
Validate.notNull(attributeDefinitions, "Attribute Definitions cannot be null");
// We precompute the AttributeDefinition of the target attribute in order to being able to use much
// faster methods for setting/replacing attributes on the ElementAttributes implementation
this.targetAttri... | 503 | 94 | 597 | <methods><variables>private final non-sealed org.thymeleaf.standard.expression.StandardExpressionExecutionContext expressionExecutionContext,private final non-sealed boolean removeIfNoop |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardDOMEventAttributeTagProcessor.java | StandardDOMEventAttributeTagProcessor | doProcess | class StandardDOMEventAttributeTagProcessor
extends AbstractAttributeTagProcessor
implements IAttributeDefinitionsAware {
public static final int PRECEDENCE = 1000;
// These attributes should be removed even if their value evaluates to null or empty string.
// The reason why we don't let a... |
final String newAttributeValue =
EscapedAttributeUtils.escapeAttribute(getTemplateMode(), expressionResult == null ? null : expressionResult.toString());
// These attributes are "removable if empty", so we simply remove the target attribute...
if (newAttributeValue == null || ... | 1,481 | 195 | 1,676 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardDefaultAttributesTagProcessor.java | StandardDefaultAttributesTagProcessor | processDefaultAttribute | class StandardDefaultAttributesTagProcessor
extends AbstractProcessor implements IElementTagProcessor {
// Setting to Integer.MAX_VALUE is alright - we will always be limited by the dialect precedence anyway
public static final int PRECEDENCE = Integer.MAX_VALUE;
private final String dialectPref... |
try {
final AttributeName attributeName = attribute.getAttributeDefinition().getAttributeName();
final String attributeValue =
EscapedAttributeUtils.unescapeAttribute(context.getTemplateMode(), attribute.getValue());
/*
* Compute the new ... | 532 | 997 | 1,529 | <methods>public void <init>(org.thymeleaf.templatemode.TemplateMode, int) ,public final int getPrecedence() ,public final org.thymeleaf.templatemode.TemplateMode getTemplateMode() <variables>private final non-sealed int precedence,private final non-sealed org.thymeleaf.templatemode.TemplateMode templateMode |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardEachTagProcessor.java | StandardEachTagProcessor | doProcess | class StandardEachTagProcessor extends AbstractAttributeTagProcessor {
public static final int PRECEDENCE = 200;
public static final String ATTR_NAME = "each";
public StandardEachTagProcessor(final TemplateMode templateMode, final String dialectPrefix) {
super(templateMode, dialectPrefix, null, fa... |
final Each each = EachUtils.parseEach(context, attributeValue);
final IStandardExpression iterVarExpr = each.getIterVar();
final Object iterVarValue = iterVarExpr.execute(context);
final IStandardExpression statusVarExpr = each.getStatusVar();
final Object statusVarValue;
... | 171 | 352 | 523 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardFragmentTagProcessor.java | StandardFragmentTagProcessor | doProcess | class StandardFragmentTagProcessor extends AbstractElementTagProcessor {
public static final int PRECEDENCE = 1500;
public static final String ATTR_NAME = "fragment";
public StandardFragmentTagProcessor(final TemplateMode templateMode, final String dialectPrefix) {
super(templateMode, dialectP... |
// Nothing to do, this processor is just a marker. Simply remove the attribute
final AttributeName attributeName = getMatchingAttributeName().getMatchingAttributeName();
structureHandler.removeAttribute(attributeName);
| 159 | 55 | 214 | <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/src/main/java/org/thymeleaf/standard/processor/StandardIfTagProcessor.java | StandardIfTagProcessor | isVisible | class StandardIfTagProcessor extends AbstractStandardConditionalVisibilityTagProcessor {
public static final int PRECEDENCE = 300;
public static final String ATTR_NAME = "if";
public StandardIfTagProcessor(final TemplateMode templateMode, final String dialectPrefix) {
super(templateMode, dialectPr... |
final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(context.getConfiguration());
final IStandardExpression expression =
expressionParser.parseExpression(context, attributeValue);
final Object value = expression.execute(context);
... | 155 | 78 | 233 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardIncludeTagProcessor.java | StandardIncludeTagProcessor | doProcess | class StandardIncludeTagProcessor extends AbstractStandardFragmentInsertionTagProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(StandardIncludeTagProcessor.class);
public static final int PRECEDENCE = 100;
public static final String ATTR_NAME = "include";
public StandardInc... |
if (LOGGER.isWarnEnabled()) {
LOGGER.warn(
"[THYMELEAF][{}][{}] Deprecated attribute {} found in template {}, line {}, col {}. " +
"Please use {} instead, this deprecated attribute will be removed in future versions of Thymeleaf.",
new Ob... | 200 | 204 | 404 | <methods><variables>private static final java.lang.String FRAGMENT_ATTR_NAME,private static final org.slf4j.Logger LOGGER,private final non-sealed boolean insertOnlyContents,private final non-sealed boolean replaceHost |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardInlineEnablementTemplateBoundariesProcessor.java | StandardInlineEnablementTemplateBoundariesProcessor | doProcessTemplateStart | class StandardInlineEnablementTemplateBoundariesProcessor extends AbstractTemplateBoundariesProcessor {
public static final int PRECEDENCE = 10;
public StandardInlineEnablementTemplateBoundariesProcessor(final TemplateMode templateMode) {
super(templateMode, PRECEDENCE);
}
@Override
publ... |
switch (getTemplateMode()) {
case HTML:
structureHandler.setInliner(new StandardHTMLInliner(context.getConfiguration()));
break;
case XML:
structureHandler.setInliner(new StandardXMLInliner(context.getConfiguration()));
b... | 192 | 291 | 483 | <methods>public void <init>(org.thymeleaf.templatemode.TemplateMode, int) ,public abstract void doProcessTemplateEnd(org.thymeleaf.context.ITemplateContext, org.thymeleaf.model.ITemplateEnd, org.thymeleaf.processor.templateboundaries.ITemplateBoundariesStructureHandler) ,public abstract void doProcessTemplateStart(org.... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardInlineHTMLTagProcessor.java | StandardInlineHTMLTagProcessor | getInliner | class StandardInlineHTMLTagProcessor extends AbstractStandardTextInlineSettingTagProcessor {
public static final int PRECEDENCE = 1000;
public static final String ATTR_NAME = "inline";
public StandardInlineHTMLTagProcessor(final String dialectPrefix) {
super(TemplateMode.HTML, dialectPrefix, AT... |
switch (inlineMode) {
case NONE:
return NoOpInliner.INSTANCE;
case HTML:
return new StandardHTMLInliner(context.getConfiguration());
case TEXT:
return new StandardTextInliner(context.getConfiguration());
case JAVAS... | 146 | 247 | 393 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardInlineTextualTagProcessor.java | StandardInlineTextualTagProcessor | getInliner | class StandardInlineTextualTagProcessor extends AbstractStandardTextInlineSettingTagProcessor {
public static final int PRECEDENCE = 1000;
public static final String ATTR_NAME = "inline";
public StandardInlineTextualTagProcessor(final TemplateMode templateMode, final String dialectPrefix) {
sup... |
final TemplateMode templateMode = getTemplateMode();
switch (inlineMode) {
case NONE:
return NoOpInliner.INSTANCE;
case TEXT:
if (templateMode == TemplateMode.TEXT) {
return new StandardTextInliner(context.getConfiguration())... | 176 | 263 | 439 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardInlineXMLTagProcessor.java | StandardInlineXMLTagProcessor | getInliner | class StandardInlineXMLTagProcessor extends AbstractStandardTextInlineSettingTagProcessor {
public static final int PRECEDENCE = 1000;
public static final String ATTR_NAME = "inline";
public StandardInlineXMLTagProcessor(final String dialectPrefix) {
super(TemplateMode.XML, dialectPrefix, ATTR_... |
switch (inlineMode) {
case NONE:
return NoOpInliner.INSTANCE;
case XML:
return new StandardXMLInliner(context.getConfiguration());
case TEXT:
return new StandardTextInliner(context.getConfiguration());
default:
... | 148 | 167 | 315 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardInliningCDATASectionProcessor.java | StandardInliningCDATASectionProcessor | doProcess | class StandardInliningCDATASectionProcessor extends AbstractCDATASectionProcessor {
public static final int PRECEDENCE = 1000;
public StandardInliningCDATASectionProcessor(final TemplateMode templateMode) {
super(templateMode, PRECEDENCE);
}
@Override
protected void doProcess(
... |
final IInliner inliner = context.getInliner();
if (inliner == null || inliner == NoOpInliner.INSTANCE) {
return;
}
final CharSequence inlined = inliner.inline(context, cdataSection);
if (inlined != null && inlined != cdataSection) {
structureHandler.s... | 135 | 110 | 245 | <methods>public void <init>(org.thymeleaf.templatemode.TemplateMode, int) ,public final void process(org.thymeleaf.context.ITemplateContext, org.thymeleaf.model.ICDATASection, org.thymeleaf.processor.cdatasection.ICDATASectionStructureHandler) <variables> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardInliningCommentProcessor.java | StandardInliningCommentProcessor | doProcess | class StandardInliningCommentProcessor extends AbstractCommentProcessor {
public static final int PRECEDENCE = 1000;
public StandardInliningCommentProcessor(final TemplateMode templateMode) {
super(templateMode, PRECEDENCE);
}
@Override
protected void doProcess(
final ITempla... |
final IInliner inliner = context.getInliner();
if (inliner == null || inliner == NoOpInliner.INSTANCE) {
return;
}
final CharSequence inlined = inliner.inline(context, comment);
if (inlined != null && inlined != comment) {
structureHandler.setContent(... | 118 | 106 | 224 | <methods>public void <init>(org.thymeleaf.templatemode.TemplateMode, int) ,public final void process(org.thymeleaf.context.ITemplateContext, org.thymeleaf.model.IComment, org.thymeleaf.processor.comment.ICommentStructureHandler) <variables> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardInliningTextProcessor.java | StandardInliningTextProcessor | doProcess | class StandardInliningTextProcessor extends AbstractTextProcessor {
public static final int PRECEDENCE = 1000;
public StandardInliningTextProcessor(final TemplateMode templateMode) {
super(templateMode, PRECEDENCE);
}
@Override
protected void doProcess(
final ITemplateContext... |
if (EngineEventUtils.isWhitespace(text)) {
// Fail fast - a whitespace text is never inlineable. And templates tend to have a lot of white space blocks
// NOTE we are not using isInlineable() here because before doing so the template mode would have to be
// checked (so tha... | 118 | 203 | 321 | <methods>public void <init>(org.thymeleaf.templatemode.TemplateMode, int) ,public final void process(org.thymeleaf.context.ITemplateContext, org.thymeleaf.model.IText, org.thymeleaf.processor.text.ITextStructureHandler) <variables> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardRefAttributeTagProcessor.java | StandardRefAttributeTagProcessor | doProcess | class StandardRefAttributeTagProcessor extends AbstractAttributeTagProcessor {
public static final int PRECEDENCE = 10000;
public static final String ATTR_NAME = "ref";
public StandardRefAttributeTagProcessor(final TemplateMode templateMode, final String dialectPrefix) {
super(templateMode, dia... |
// This processor is a no-op. It can simply be used for referencing specific elements in markup, but
// produces no results (other than being removed from markup once executed).
| 177 | 48 | 225 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardRemoveTagProcessor.java | StandardRemoveTagProcessor | doProcess | class StandardRemoveTagProcessor extends AbstractStandardExpressionAttributeTagProcessor {
public static final int PRECEDENCE = 1600;
public static final String ATTR_NAME = "remove";
public static final String VALUE_ALL = "all";
public static final String VALUE_ALL_BUT_FIRST = "all-but-first";
pub... |
if (expressionResult != null) {
final String resultStr = expressionResult.toString();
if (VALUE_ALL.equalsIgnoreCase(resultStr)) {
structureHandler.removeElement();
} else if (VALUE_TAG.equalsIgnoreCase(resultStr) || VALUE_TAGS.equalsIgnoreCase(resultStr))... | 300 | 249 | 549 | <methods><variables>private final non-sealed org.thymeleaf.standard.expression.StandardExpressionExecutionContext expressionExecutionContext,private final non-sealed boolean removeIfNoop |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardStyleappendTagProcessor.java | StandardStyleappendTagProcessor | doProcess | class StandardStyleappendTagProcessor
extends AbstractStandardExpressionAttributeTagProcessor
implements IAttributeDefinitionsAware {
public static final int PRECEDENCE = 1100;
public static final String ATTR_NAME = "styleappend";
public static final String TARGET_ATTR_NAME = "styl... |
String newAttributeValue =
EscapedAttributeUtils.escapeAttribute(getTemplateMode(), expressionResult == null ? null : expressionResult.toString());
// If we are not adding anything, we'll just leave it untouched
if (newAttributeValue != null && newAttributeValue.length() > 0) ... | 363 | 202 | 565 | <methods><variables>private final non-sealed org.thymeleaf.standard.expression.StandardExpressionExecutionContext expressionExecutionContext,private final non-sealed boolean removeIfNoop |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardSwitchTagProcessor.java | StandardSwitchTagProcessor | doProcess | class StandardSwitchTagProcessor extends AbstractAttributeTagProcessor {
public static final int PRECEDENCE = 250;
public static final String ATTR_NAME = "switch";
public static final String SWITCH_VARIABLE_NAME = "%%SWITCH_EXPR%%";
public StandardSwitchTagProcessor(final TemplateMode templateMode, ... |
final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(context.getConfiguration());
final IStandardExpression switchExpression =
expressionParser.parseExpression(context, attributeValue);
structureHandler.setLocalVariable(SWITCH_VARIABLE_NA... | 337 | 80 | 417 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardTextTagProcessor.java | StandardTextTagProcessor | doProcess | class StandardTextTagProcessor extends AbstractStandardExpressionAttributeTagProcessor {
public static final int PRECEDENCE = 1300;
public static final String ATTR_NAME = "text";
public StandardTextTagProcessor(final TemplateMode templateMode, final String dialectPrefix) {
// We will only use RES... |
final TemplateMode templateMode = getTemplateMode();
/*
* Depending on the template mode and the length of the text to be output escaped, we will try to opt for
* the most resource-efficient alternative.
*
* * If we are outputting RAW, there is no escape to do, ... | 400 | 545 | 945 | <methods><variables>private final non-sealed org.thymeleaf.standard.expression.StandardExpressionExecutionContext expressionExecutionContext,private final non-sealed boolean removeIfNoop |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardUnlessTagProcessor.java | StandardUnlessTagProcessor | isVisible | class StandardUnlessTagProcessor extends AbstractStandardConditionalVisibilityTagProcessor {
public static final int PRECEDENCE = 400;
public static final String ATTR_NAME = "unless";
public StandardUnlessTagProcessor(final TemplateMode templateMode, final String dialectPrefix) {
super(templateMod... |
final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(context.getConfiguration());
final IStandardExpression expression = expressionParser.parseExpression(context, attributeValue);
final Object value = expression.execute(context);
return !Evaluati... | 157 | 77 | 234 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardUtextTagProcessor.java | StandardUtextTagProcessor | doProcess | class StandardUtextTagProcessor extends AbstractAttributeTagProcessor {
public static final int PRECEDENCE = 1400;
public static final String ATTR_NAME = "utext";
public StandardUtextTagProcessor(final TemplateMode templateMode, final String dialectPrefix) {
super(templateMode, dialectPrefix, nul... |
final IEngineConfiguration configuration = context.getConfiguration();
final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(configuration);
final IStandardExpression expression = expressionParser.parseExpression(context, attributeValue);
final O... | 370 | 993 | 1,363 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardWithTagProcessor.java | StandardWithTagProcessor | doProcess | class StandardWithTagProcessor extends AbstractAttributeTagProcessor {
public static final int PRECEDENCE = 600;
public static final String ATTR_NAME = "with";
public StandardWithTagProcessor(final TemplateMode templateMode, final String dialectPrefix) {
super(templateMode, dialectPrefix, null, fa... |
final AssignationSequence assignations =
AssignationUtils.parseAssignationSequence(
context, attributeValue, false /* no parameters without value */);
if (assignations == null) {
throw new TemplateProcessingException(
"Could not p... | 171 | 562 | 733 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/processor/StandardXmlNsTagProcessor.java | StandardXmlNsTagProcessor | doProcess | class StandardXmlNsTagProcessor extends AbstractAttributeTagProcessor {
public static final int PRECEDENCE = 1000;
public static final String ATTR_NAME_PREFIX = "xmlns:";
public StandardXmlNsTagProcessor(final TemplateMode templateMode, final String dialectPrefix) {
super(templateMode, null, nul... |
// Nothing to do really, we are just removing the "xmlns:th" (or equivalent) attribute
| 187 | 29 | 216 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/serializer/StandardCSSSerializer.java | StandardCSSSerializer | serializeValue | class StandardCSSSerializer implements IStandardCSSSerializer {
public StandardCSSSerializer() {
super();
}
public void serializeValue(final Object object, final Writer writer) {<FILL_FUNCTION_BODY>}
private static void writeValue(final Writer writer, final Object object) throws IO... |
try {
writeValue(writer, object);
} catch (final IOException e) {
throw new TemplateProcessingException(
"An exception was raised while trying to serialize object to CSS", e);
}
| 400 | 56 | 456 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/serializer/StandardSerializers.java | StandardSerializers | getCSSSerializer | class StandardSerializers {
/**
* Name used for registering the <i>Standard JavaScript Serializer</i> object as an
* <i>execution attribute</i> at the Standard Dialects.
*/
public static final String STANDARD_JAVASCRIPT_SERIALIZER_ATTRIBUTE_NAME = "StandardJavaScriptSerializer";
/**
*... |
final Object serializer =
configuration.getExecutionAttributes().get(STANDARD_CSS_SERIALIZER_ATTRIBUTE_NAME);
if (serializer == null || (!(serializer instanceof IStandardCSSSerializer))) {
throw new TemplateProcessingException(
"No CSS Serializer has been... | 638 | 205 | 843 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/util/StandardConditionalCommentUtils.java | StandardConditionalCommentUtils | parseConditionalComment | class StandardConditionalCommentUtils {
/**
* <p>
* Tries to parse the text passed as argument as a conditional comment.
* </p>
* <p>
* Result is an object of class {@link ConditionalCommentParsingResult}, or
* {@code null} if text does not have the expected format for a conditi... |
final int len = text.length();
int i = 4; // We start right after the "<!--"
// discard all initial whitespace
while (i < len && Character.isWhitespace(text.charAt(i))) { i++; }
// check the first char after whitespace is '['
if (i >= len || text.charAt(i++) != '[') ... | 553 | 801 | 1,354 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/util/StandardExpressionUtils.java | StandardExpressionUtils | containsOGNLInstantiationOrStaticOrParam | class StandardExpressionUtils {
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_ARRAY.leng... |
/*
* Checks whether the expression contains instantiation of objects ("new SomeClass") or makes use of
* static methods ("@SomeClass@") as both are forbidden in certain contexts in restricted mode.
*/
final String exp = ExpressionUtils.normalize(expression);
final ... | 274 | 722 | 996 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/standard/util/StandardProcessorUtils.java | StandardProcessorUtils | replaceAttribute | class StandardProcessorUtils {
public static void replaceAttribute(
final IElementTagStructureHandler structureHandler,
final AttributeName oldAttributeName,
final AttributeDefinition attributeDefinition, final String attributeName, final String attributeValue) {<FILL_FUNCTION... |
if (structureHandler instanceof ElementTagStructureHandler) {
((ElementTagStructureHandler) structureHandler).replaceAttribute(oldAttributeName, attributeDefinition, attributeName, attributeValue, null);
} else {
structureHandler.replaceAttribute(oldAttributeName, attributeName... | 204 | 75 | 279 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/markup/InlinedOutputExpressionMarkupHandler.java | InlineMarkupAdapterPreProcessorHandler | handleStandaloneElementStart | class InlineMarkupAdapterPreProcessorHandler implements IInlinePreProcessorHandler {
private IMarkupHandler handler;
InlineMarkupAdapterPreProcessorHandler(final IMarkupHandler handler) {
super();
this.handler = handler;
}
public void handleText(
... |
try {
this.handler.handleStandaloneElementStart(buffer, nameOffset, nameLen, minimized, line, col);
} catch (final ParseException e) {
throw new TemplateProcessingException("Parse exception during processing of inlining", e);
}
| 1,405 | 69 | 1,474 | <methods>public void handleAttribute(char[], int, int, int, int, int, int, int, int, int, int, int, int, int, int) throws org.attoparser.ParseException,public void handleAutoCloseElementEnd(char[], int, int, int, int) throws org.attoparser.ParseException,public void handleAutoCloseElementStart(char[], int, int, int, in... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/markup/TemplateFragmentMarkupReferenceResolver.java | TemplateFragmentMarkupReferenceResolver | forHTMLPrefix | class TemplateFragmentMarkupReferenceResolver implements IMarkupSelectorReferenceResolver {
private static final TemplateFragmentMarkupReferenceResolver HTML_INSTANCE_NO_PREFIX;
private static final ConcurrentHashMap<String,TemplateFragmentMarkupReferenceResolver> HTML_INSTANCES_BY_PREFIX;
private static f... |
if (standardDialectPrefix == null || standardDialectPrefix.length() == 0) {
return HTML_INSTANCE_NO_PREFIX;
}
final String prefix = standardDialectPrefix.toLowerCase();
final TemplateFragmentMarkupReferenceResolver resolver = HTML_INSTANCES_BY_PREFIX.get(prefix);
if ... | 1,241 | 176 | 1,417 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/markup/decoupled/DecoupledInjectedAttribute.java | DecoupledInjectedAttribute | toString | class DecoupledInjectedAttribute {
final char[] buffer;
final int nameOffset;
final int nameLen;
final int operatorOffset;
final int operatorLen;
final int valueContentOffset;
final int valueContentLen;
final int valueOuterOffset;
final int valueOuterLen;
/*
* We use a fa... |
// The internal buffer should not be shared, it should only contain this attribute
return new String(this.buffer);
| 754 | 30 | 784 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/markup/decoupled/DecoupledTemplateLogic.java | DecoupledTemplateLogic | addInjectedAttribute | class DecoupledTemplateLogic {
private final Map<String, List<DecoupledInjectedAttribute>> injectedAttributes =
new HashMap<String, List<DecoupledInjectedAttribute>>(20);
public DecoupledTemplateLogic() {
super();
}
public boolean hasInjectedAttributes() {
return this.... |
Validate.notNull(selector, "Selector cannot be null");
Validate.notNull(injectedAttribute, "Injected Attribute cannot be null");
List<DecoupledInjectedAttribute> injectedAttributesForSelector = this.injectedAttributes.get(selector);
if (injectedAttributesForSelector == null) {
... | 421 | 140 | 561 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/markup/decoupled/DecoupledTemplateLogicMarkupHandler.java | DecoupledTemplateLogicMarkupHandler | handleOpenElementEnd | class DecoupledTemplateLogicMarkupHandler extends AbstractChainedMarkupHandler {
// The node-selection markup handler should be the first one in the chain, so that we make sure that any
// block selection operations (like the ones performed by the block-selection markup handlers) can be
// performed on at... |
if (this.injectAttributes) {
processInjectedAttributes(line, col);
}
super.handleOpenElementEnd(buffer, nameOffset, nameLen, line, col);
| 1,209 | 52 | 1,261 | <methods>public void handleAttribute(char[], int, int, int, int, int, int, int, int, int, int, int, int, int, int) throws org.attoparser.ParseException,public void handleAutoCloseElementEnd(char[], int, int, int, int) throws org.attoparser.ParseException,public void handleAutoCloseElementStart(char[], int, int, int, in... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/markup/decoupled/DecoupledTemplateLogicUtils.java | DecoupledTemplateLogicUtils | computeDecoupledTemplateLogic | class DecoupledTemplateLogicUtils {
private static final Logger logger = LoggerFactory.getLogger(DecoupledTemplateLogicUtils.class);
public static DecoupledTemplateLogic computeDecoupledTemplateLogic(
final IEngineConfiguration configuration,
final String ownerTemplate, final Strin... |
Validate.notNull(configuration, "Engine Configuration cannot be null");
Validate.notNull(template, "Template cannot be null");
Validate.notNull(resource, "Template Resource cannot be null");
Validate.notNull(templateMode, "Template Mode cannot be null");
final IDecoupledTempla... | 155 | 506 | 661 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/markup/decoupled/StandardDecoupledTemplateLogicResolver.java | StandardDecoupledTemplateLogicResolver | resolveDecoupledTemplateLogic | class StandardDecoupledTemplateLogicResolver implements IDecoupledTemplateLogicResolver {
/**
* <p>
* Default suffix applied to the relative resources resolved: {@value}
* </p>
*/
public static final String DECOUPLED_TEMPLATE_LOGIC_FILE_SUFFIX = ".th.xml";
private String prefix = nu... |
String relativeLocation = resource.getBaseName();
if (this.prefix != null) {
relativeLocation = this.prefix + relativeLocation;
}
if (this.suffix != null) {
relativeLocation = relativeLocation + this.suffix;
}
return resource.relative(relativeLo... | 320 | 84 | 404 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/raw/RawParseException.java | RawParseException | message | class RawParseException extends Exception {
private static final long serialVersionUID = -104133072151159140L;
private final Integer line;
private final Integer col;
public RawParseException() {
super();
this.line = null;
this.col = null;
}
public RawParseException(... |
if (throwable != null && throwable instanceof RawParseException) {
final RawParseException exception = (RawParseException)throwable;
if (exception.getLine() != null && exception.getCol() != null) {
return "(Line = " + exception.getLine() + ", Column = " + exception.get... | 748 | 163 | 911 | <methods>public void <init>() ,public void <init>(java.lang.String) ,public void <init>(java.lang.Throwable) ,public void <init>(java.lang.String, java.lang.Throwable) <variables>static final long serialVersionUID |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/raw/RawParser.java | RawParser | parseDocument | class RawParser {
private final BufferPool pool;
RawParser(final int poolSize, final int bufferSize) {
super();
this.pool = new BufferPool(poolSize, bufferSize);
}
public void parse(final String document, final IRawHandler handler)
throws RawParseException {
... |
// We are trying to read the entire resource into the buffer. If it's not big enough,
// then it will have to be grown. Note grown buffers are not maintained by the pool,
// so template cache should play a more important role for this, allowing the system to
// not require the creation... | 1,063 | 601 | 1,664 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/raw/RawTemplateParser.java | RawTemplateParser | parseString | class RawTemplateParser implements ITemplateParser {
private final RawParser parser;
public RawTemplateParser(final int bufferPoolSize, final int bufferSize) {
super();
this.parser = new RawParser(bufferPoolSize, bufferSize);
}
/*
* -------------------
* PARSE METHODS
... |
Validate.notNull(configuration, "Engine Configuration cannot be null");
Validate.notNull(ownerTemplate, "Owner template cannot be null");
Validate.notNull(template, "Template cannot be null");
// NOTE selectors cannot be specified when parsing a nested template
Validate.notNull... | 920 | 161 | 1,081 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/text/AbstractChainedTextHandler.java | AbstractChainedTextHandler | handleAttribute | class AbstractChainedTextHandler extends AbstractTextHandler {
private final ITextHandler next;
protected AbstractChainedTextHandler(final ITextHandler next) {
super();
this.next = next;
}
protected ITextHandler getNext() {
return this.next;
}
public void handleD... |
this.next.handleAttribute(
buffer,
nameOffset, nameLen,
nameLine, nameCol,
operatorOffset, operatorLen,
operatorLine, operatorCol,
valueContentOffset, valueContentLen,
valueOuterOffset, valueOuterLen... | 937 | 78 | 1,015 | <methods>public void handleAttribute(char[], int, int, int, int, int, int, int, int, int, int, int, int, int, int) throws org.thymeleaf.templateparser.text.TextParseException,public void handleCloseElementEnd(char[], int, int, int, int) throws org.thymeleaf.templateparser.text.TextParseException,public void handleClose... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/text/AbstractTextHandler.java | AbstractTextHandler | handleOpenElementEnd | class AbstractTextHandler implements ITextHandler {
protected AbstractTextHandler() {
super();
}
public void handleDocumentStart(
final long startTimeNanos, final int line, final int col) throws TextParseException {
// Nothing to be done here, meant to be overridden if req... |
// Nothing to be done here, meant to be overridden if required
| 820 | 20 | 840 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/text/AbstractTextTemplateParser.java | AbstractTextTemplateParser | parse | class AbstractTextTemplateParser implements ITemplateParser {
private final TextParser parser;
protected AbstractTextTemplateParser(
final int bufferPoolSize, final int bufferSize, final boolean processCommentsAndLiterals,
final boolean standardDialectPresent) {
super();
... |
// For a String template, we will use the ownerTemplate as templateName for its parsed events
final String templateName = (resource != null? template : ownerTemplate);
try {
// The final step of the handler chain will be the adapter that will convert the text parser's handler ch... | 775 | 621 | 1,396 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/text/EventProcessorTextHandler.java | StructureNamesRepository | getStructureName | class StructureNamesRepository {
private static final int REPOSITORY_INITIAL_LEN = 20;
private static final int REPOSITORY_INITIAL_INC = 5;
private char[][] repository;
private int repositorySize;
StructureNamesRepository() {
super();
this.repository = ... |
// We are looking for exact matches here, disregarding the TEXT_PARSING_CASE_SENSITIVE constant value
final int index =
TextUtils.binarySearch(true, this.repository, 0, this.repositorySize, text, offset, len);
if (index >= 0) {
return this.repos... | 445 | 129 | 574 | <methods>public void handleAttribute(char[], int, int, int, int, int, int, int, int, int, int, int, int, int, int) throws org.thymeleaf.templateparser.text.TextParseException,public void handleCloseElementEnd(char[], int, int, int, int) throws org.thymeleaf.templateparser.text.TextParseException,public void handleClose... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/text/InlinedOutputExpressionTextHandler.java | InlineTextAdapterPreProcessorHandler | handleText | class InlineTextAdapterPreProcessorHandler implements IInlinePreProcessorHandler {
private ITextHandler handler;
InlineTextAdapterPreProcessorHandler(final ITextHandler handler) {
super();
this.handler = handler;
}
public void handleText(
fina... |
try {
this.handler.handleText(buffer, offset, len, line, col);
} catch (final TextParseException e) {
throw new TemplateProcessingException("Parse exception during processing of inlining", e);
}
| 1,265 | 61 | 1,326 | <methods>public void handleAttribute(char[], int, int, int, int, int, int, int, int, int, int, int, int, int, int) throws org.thymeleaf.templateparser.text.TextParseException,public void handleCloseElementEnd(char[], int, int, int, int) throws org.thymeleaf.templateparser.text.TextParseException,public void handleClose... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/text/ParsingLocatorUtil.java | ParsingLocatorUtil | countChar | class ParsingLocatorUtil {
public static void countChar(final int[] locator, final char c) {<FILL_FUNCTION_BODY>}
private ParsingLocatorUtil() {
super();
}
} |
if (c == '\n') {
locator[0]++;
locator[1] = 1;
return;
}
locator[1]++;
| 66 | 48 | 114 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/text/TextParseException.java | TextParseException | message | class TextParseException extends Exception {
private static final long serialVersionUID = -104133072151159140L;
private final Integer line;
private final Integer col;
public TextParseException() {
super();
this.line = null;
this.col = null;
}
public TextParseExcepti... |
if (throwable != null && throwable instanceof TextParseException) {
final TextParseException exception = (TextParseException)throwable;
if (exception.getLine() != null && exception.getCol() != null) {
return "(Line = " + exception.getLine() + ", Column = " + exception.... | 748 | 163 | 911 | <methods>public void <init>() ,public void <init>(java.lang.String) ,public void <init>(java.lang.Throwable) ,public void <init>(java.lang.String, java.lang.Throwable) <variables>static final long serialVersionUID |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/text/TextParsingCommentUtil.java | TextParsingCommentUtil | isCommentBlockEnd | class TextParsingCommentUtil {
private TextParsingCommentUtil() {
super();
}
public static void parseComment(
final char[] buffer,
final int offset, final int len,
final int line, final int col,
final ITextHandler handler)
throws Tex... |
return ((maxi - offset > 1) &&
buffer[offset] == '*' &&
buffer[offset + 1] == '/');
| 405 | 37 | 442 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateparser/text/TextParsingLiteralUtil.java | TextParsingLiteralUtil | isRegexLiteralStart | class TextParsingLiteralUtil {
private TextParsingLiteralUtil() {
super();
}
static boolean isRegexLiteralStart(final char[] buffer, final int offset, final int maxi) {<FILL_FUNCTION_BODY>}
/*
static boolean isRegexLiteralEnd(final char[] buffer, final int offset, final int maxi) {
... |
if (offset == 0 || buffer[offset] != '/') {
return false;
}
// We will check that this is not one of the other structures starting with a slash (comments)
if (TextParsingCommentUtil.isCommentBlockStart(buffer, offset, maxi)) {
return false;
}
... | 146 | 202 | 348 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateresolver/DefaultTemplateResolver.java | DefaultTemplateResolver | setTemplateMode | class DefaultTemplateResolver extends AbstractTemplateResolver {
/**
* <p>
* Default template mode: {@link TemplateMode#HTML}
* </p>
*/
public static final TemplateMode DEFAULT_TEMPLATE_MODE = TemplateMode.HTML;
private TemplateMode templateMode = DEFAULT_TEMPLATE_MODE;
privat... |
// Setter overload actually goes against the JavaBeans spec, but having this one is good for legacy
// compatibility reasons. Besides, given the getter returns TemplateMode, intelligent frameworks like
// Spring will recognized the property as TemplateMode-typed and simply ignore this setter.
... | 783 | 102 | 885 | <methods>public final boolean getCheckExistence() ,public final java.lang.String getName() ,public final java.lang.Integer getOrder() ,public final org.thymeleaf.util.PatternSpec getResolvablePatternSpec() ,public final Set<java.lang.String> getResolvablePatterns() ,public final boolean getUseDecoupledLogic() ,public f... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateresolver/StringTemplateResolver.java | StringTemplateResolver | setTemplateMode | class StringTemplateResolver extends AbstractTemplateResolver {
/**
* <p>
* Default template mode: {@link TemplateMode#HTML}
* </p>
*/
public static final TemplateMode DEFAULT_TEMPLATE_MODE = TemplateMode.HTML;
/**
* <p>
* Default value for the <i>cacheable</i> flag: {@v... |
// Setter overload actually goes against the JavaBeans spec, but having this one is good for legacy
// compatibility reasons. Besides, given the getter returns TemplateMode, intelligent frameworks like
// Spring will recognized the property as TemplateMode-typed and simply ignore this setter.
... | 1,471 | 102 | 1,573 | <methods>public final boolean getCheckExistence() ,public final java.lang.String getName() ,public final java.lang.Integer getOrder() ,public final org.thymeleaf.util.PatternSpec getResolvablePatternSpec() ,public final Set<java.lang.String> getResolvablePatterns() ,public final boolean getUseDecoupledLogic() ,public f... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateresolver/UrlTemplateResolver.java | UrlTemplateResolver | computeValidity | class UrlTemplateResolver extends AbstractConfigurableTemplateResolver {
private static final Pattern JSESSIONID_PATTERN = Pattern.compile("(.*?);jsessionid(.*?)");
public UrlTemplateResolver() {
super();
}
@Override
protected ITemplateResource computeTemplateResource(
... |
/*
* This check is made so that we don't fill the cache with entries for the same
* template with different jsessionid values.
*/
if (JSESSIONID_PATTERN.matcher(template.toLowerCase()).matches()) {
return NonCacheableCacheEntryValidity.INSTANCE;
}
... | 232 | 104 | 336 | <methods>public void <init>() ,public final void addTemplateAlias(java.lang.String, java.lang.String) ,public final void clearTemplateAliases() ,public final org.thymeleaf.util.PatternSpec getCSSTemplateModePatternSpec() ,public final Set<java.lang.String> getCSSTemplateModePatterns() ,public final java.lang.Long getCa... |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateresource/ClassLoaderTemplateResource.java | ClassLoaderTemplateResource | exists | class ClassLoaderTemplateResource implements ITemplateResource {
private final ClassLoader optionalClassLoader;
private final String path;
private final String characterEncoding;
/**
* <p>
* Create a ClassLoader-based template resource, without specifying the specific class loader
*... |
if (this.optionalClassLoader != null) {
return (this.optionalClassLoader.getResource(this.path) != null);
}
return ClassLoaderUtils.isResourcePresent(this.path);
| 885 | 56 | 941 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateresource/FileTemplateResource.java | FileTemplateResource | relative | class FileTemplateResource implements ITemplateResource, Serializable {
private final String path;
private final File file;
private final String characterEncoding;
public FileTemplateResource(final String path, final String characterEncoding) {
super();
Validate.notEmpty(path, "Re... |
Validate.notEmpty(relativeLocation, "Relative Path cannot be null or empty");
final String fullRelativeLocation = TemplateResourceUtils.computeRelativeLocation(this.path, relativeLocation);
return new FileTemplateResource(fullRelativeLocation, this.characterEncoding);
| 457 | 70 | 527 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateresource/TemplateResourceUtils.java | TemplateResourceUtils | cleanPath | class TemplateResourceUtils {
static String cleanPath(final String path) {<FILL_FUNCTION_BODY>}
static String computeRelativeLocation(final String location, final String relativeLocation) {
final int separatorPos = location.lastIndexOf('/');
if (separatorPos != -1) {
final Str... |
if (path == null) {
return null;
}
// First replace Windows folder separators with UNIX's
String unixPath = StringUtils.replace(path, "\\", "/");
// Some shortcuts, just in case this is empty or simply has no '.' or '..' (and no double-/ we should simplify)
... | 475 | 645 | 1,120 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateresource/UrlTemplateResource.java | UrlTemplateResource | inputStream | class UrlTemplateResource implements ITemplateResource, Serializable {
private final URL url;
private final String characterEncoding;
public UrlTemplateResource(final String path, final String characterEncoding) throws MalformedURLException {
super();
Validate.notEmpty(path, "Resource... |
final URLConnection connection = this.url.openConnection();
if (connection.getClass().getSimpleName().startsWith("JNLP")) {
connection.setUseCaches(true);
}
final InputStream inputStream;
try {
inputStream = connection.getInputStream();
} catch ... | 1,225 | 149 | 1,374 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/templateresource/WebApplicationTemplateResource.java | WebApplicationTemplateResource | reader | class WebApplicationTemplateResource implements ITemplateResource {
private final IWebApplication webApplication;
private final String path;
private final String characterEncoding;
public WebApplicationTemplateResource(final IWebApplication webApplication, final String path, final String characterE... |
final InputStream inputStream = this.webApplication.getResourceAsStream(this.path);
if (inputStream == null) {
throw new FileNotFoundException(String.format("Web Application resource \"%s\" does not exist", this.path));
}
if (!StringUtils.isEmptyOrWhitespace(this.character... | 402 | 138 | 540 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/util/AbstractLazyCharSequence.java | AbstractLazyCharSequence | write | class AbstractLazyCharSequence implements IWritableCharSequence {
private String resolvedText = null;
protected AbstractLazyCharSequence() {
super();
}
protected abstract String resolveText();
private String getText() {
if (this.resolvedText == null) {
this.re... |
if (writer == null) {
throw new IllegalArgumentException("Writer cannot be null");
}
if (this.resolvedText != null) {
writer.write(this.resolvedText);
} else {
writeUnresolved(writer);
}
| 408 | 67 | 475 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/util/ArrayUtils.java | ArrayUtils | containsAll | class ArrayUtils {
public static Object[] toArray(final Object target) {
return toArray(null, target);
}
public static Object[] toStringArray(final Object target) {
return toArray(String.class, target);
}
public static Object[] toIntegerArray(final Object target) {
... |
Validate.notNull(target, "Cannot execute array contains: target is null");
Validate.notNull(elements, "Cannot execute array containsAll: elements is null");
final Set<?> remainingElements = new HashSet<Object>(elements);
remainingElements.removeAll(Arrays.asList(target));
return... | 1,539 | 87 | 1,626 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/util/CharArrayWrapperSequence.java | CharArrayWrapperSequence | hashCode | class CharArrayWrapperSequence implements CharSequence, Cloneable {
private final char[] buffer;
private final int offset;
private final int len;
public CharArrayWrapperSequence(final char[] array) {
this(array, 0, (array != null? array.length : -1));
}
public CharA... |
/*
* This implementation is compatible with java.lang.String#hashCode(),
* even if equals(obj) cannot be because java.lang.String requires
* the obj to be an instance of String.
*/
if (this.len == 0) {
return 0;
}
final int prime = 31;
... | 814 | 152 | 966 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/util/EscapedAttributeUtils.java | EscapedAttributeUtils | escapeAttribute | class EscapedAttributeUtils {
public static String escapeAttribute(final TemplateMode templateMode, final String input) {<FILL_FUNCTION_BODY>}
public static String unescapeAttribute(final TemplateMode templateMode, final String input) {
if (input == null) {
return null;
}
... |
if (input == null) {
return null;
}
Validate.notNull(templateMode, "Template mode cannot be null");
/*
* Depending on the template mode that we are using, we might be receiving element attributes escaped in
* different ways.
*
* HTML an... | 477 | 344 | 821 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf/src/main/java/org/thymeleaf/util/FastStringWriter.java | FastStringWriter | write | class FastStringWriter extends Writer {
private final StringBuilder builder;
public FastStringWriter() {
super();
this.builder = new StringBuilder();
}
public FastStringWriter(final int initialSize) {
super();
if (initialSize < 0) {
throw new IllegalArgu... |
if ((off < 0) || (off > cbuf.length) || (len < 0) ||
((off + len) > cbuf.length) || ((off + len) < 0)) {
throw new IndexOutOfBoundsException();
} else if (len == 0) {
return;
}
this.builder.append(cbuf, off, len);
| 376 | 93 | 469 | <methods>public java.io.Writer append(java.lang.CharSequence) throws java.io.IOException,public java.io.Writer append(char) throws java.io.IOException,public java.io.Writer append(java.lang.CharSequence, int, int) throws java.io.IOException,public abstract void close() throws java.io.IOException,public abstract void fl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.