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/examples/spring6/thymeleaf-examples-spring6-stsm/src/main/java/org/thymeleaf/examples/spring6/stsm/web/controller/SeedStarterMngController.java | SeedStarterMngController | saveSeedstarter | class SeedStarterMngController {
@Autowired
private VarietyService varietyService;
@Autowired
private SeedStarterService seedStarterService;
public SeedStarterMngController() {
super();
}
@ModelAttribute("allTypes")
public List<Type> populateTypes... |
if (bindingResult.hasErrors()) {
return "seedstartermng";
}
this.seedStarterService.add(seedStarter);
model.clear();
return "redirect:/seedstartermng";
| 568 | 59 | 627 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/spring6/thymeleaf-examples-spring6-stsm/src/main/java/org/thymeleaf/examples/spring6/stsm/web/conversion/DateFormatter.java | DateFormatter | createDateFormat | class DateFormatter implements Formatter<Date> {
@Autowired
private MessageSource messageSource;
public DateFormatter() {
super();
}
public Date parse(final String text, final Locale locale) throws ParseException {
final SimpleDateFormat dateFormat = createDateFormat(locale);
... |
final String format = this.messageSource.getMessage("date.format", null, locale);
final SimpleDateFormat dateFormat = new SimpleDateFormat(format);
dateFormat.setLenient(false);
return dateFormat;
| 170 | 57 | 227 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/spring6/thymeleaf-examples-spring6-thvsjsp/src/main/java/org/thymeleaf/examples/spring6/thvsjsp/SpringWebApplicationInitializer.java | SpringWebApplicationInitializer | getServletFilters | class SpringWebApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
public static final String CHARACTER_ENCODING = "UTF-8";
public SpringWebApplicationInitializer() {
super();
}
@Override
protected Class<?>[] getServletConfigClasses() {
return ... |
final CharacterEncodingFilter encodingFilter = new CharacterEncodingFilter();
encodingFilter.setEncoding(CHARACTER_ENCODING);
encodingFilter.setForceEncoding(true);
return new Filter[] { encodingFilter };
| 190 | 55 | 245 | <methods>public void <init>() <variables> |
thymeleaf_thymeleaf | thymeleaf/examples/spring6/thymeleaf-examples-spring6-thvsjsp/src/main/java/org/thymeleaf/examples/spring6/thvsjsp/business/entities/Subscription.java | Subscription | toString | class Subscription {
private String email;
private SubscriptionType subscriptionType = SubscriptionType.ALL_EMAILS;
public Subscription() {
super();
}
public String getEmail() {
return this.email;
}
public void setEmail(final String email) {
this.email ... |
return "Subscription [email=" + this.email + ", subscriptionType="
+ this.subscriptionType + "]";
| 186 | 35 | 221 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/spring6/thymeleaf-examples-spring6-thvsjsp/src/main/java/org/thymeleaf/examples/spring6/thvsjsp/web/SpringWebConfig.java | SpringWebConfig | templateResolver | class SpringWebConfig implements WebMvcConfigurer, ApplicationContextAware {
private ApplicationContext applicationContext;
public SpringWebConfig() {
super();
}
public void setApplicationContext(final ApplicationContext applicationContext) throws BeansException {
this.application... |
SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver();
templateResolver.setApplicationContext(this.applicationContext);
templateResolver.setPrefix("/WEB-INF/templates/");
templateResolver.setSuffix(".html");
templateResolver.setTemplateMode(Templ... | 760 | 120 | 880 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/spring6/thymeleaf-examples-spring6-thvsjsp/src/main/java/org/thymeleaf/examples/spring6/thvsjsp/web/controller/SubscribeJsp.java | SubscribeJsp | subscribe | class SubscribeJsp {
private static final Logger log = LoggerFactory.getLogger(SubscribeJsp.class);
public SubscribeJsp() {
super();
}
@ModelAttribute("allTypes")
public SubscriptionType[] populateTypes() {
return new SubscriptionType[] { SubscriptionType.A... |
if (bindingResult.hasErrors()) {
return "subscribejsp";
}
log.info("JUST ADDED SUBSCRIPTION: " + subscription);
model.clear();
return "redirect:/subscribejsp";
| 220 | 61 | 281 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/spring6/thymeleaf-examples-spring6-thvsjsp/src/main/java/org/thymeleaf/examples/spring6/thvsjsp/web/controller/SubscribeTh.java | SubscribeTh | subscribe | class SubscribeTh {
private static final Logger log = LoggerFactory.getLogger(SubscribeTh.class);
public SubscribeTh() {
super();
}
@ModelAttribute("allTypes")
public SubscriptionType[] populateTypes() {
return new SubscriptionType[] { SubscriptionType.ALL_... |
if (bindingResult.hasErrors()) {
return "subscribeth";
}
log.info("JUST ADDED SUBSCRIPTION: " + subscription);
model.clear();
return "redirect:/subscribeth";
| 220 | 63 | 283 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-biglist-mvc/src/main/java/org/thymeleaf/examples/springboot2/biglist/mvc/BigListMvcAppConfig.java | BigListMvcAppConfig | dataSource | class BigListMvcAppConfig implements ApplicationContextAware {
private static final Logger logger = LoggerFactory.getLogger(BigListMvcAppConfig.class);
private ApplicationContext applicationContext;
public BigListMvcAppConfig() {
super();
}
@Override
public void setApplicationCont... |
try {
final Resource dbResource = this.applicationContext.getResource("classpath:data/chinook.sqlite");
logger.debug("Database path: " + dbResource.getURL().getPath());
final DataSourceBuilder dataSourceBuilder = DataSourceBuilder.create();
dataSourceBuilder.dr... | 134 | 153 | 287 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-biglist-mvc/src/main/java/org/thymeleaf/examples/springboot2/biglist/mvc/business/repository/PlaylistEntryRepository.java | PlaylistEntryRepository | hasNext | class PlaylistEntryRepository {
private static final String QUERY_FIND_ALL_PLAYLIST_ENTRIES =
"SELECT p.PlaylistId as 'playlistID', " +
" p.Name as 'playlistName', " +
" t.Name as 'trackName', " +
" ar.Name as 'artistName', " +
" a... |
if (this.currentIterator != null && this.currentIterator.hasNext()) {
return true;
}
if (this.repeatCount < REPEATS) {
this.currentIterator = baseList.iterator();
this.repeatCount++;
return t... | 676 | 80 | 756 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-biglist-mvc/src/main/java/org/thymeleaf/examples/springboot2/biglist/mvc/web/controller/FreeMarkerController.java | FreeMarkerController | bigListFreeMarker | class FreeMarkerController {
private PlaylistEntryRepository playlistEntryRepository;
public FreeMarkerController() {
super();
}
@Autowired
public void setPlaylistEntryRepository(final PlaylistEntryRepository playlistEntryRepository) {
this.playlistEntryRepository = playlistEn... |
final Iterator<PlaylistEntry> playlistEntries = this.playlistEntryRepository.findLargeCollectionPlaylistEntries();
model.addAttribute("dataSource", playlistEntries);
return "freemarker/biglist";
| 231 | 63 | 294 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-biglist-mvc/src/main/java/org/thymeleaf/examples/springboot2/biglist/mvc/web/controller/ThymeleafController.java | ThymeleafController | bigList | class ThymeleafController {
private PlaylistEntryRepository playlistEntryRepository;
public ThymeleafController() {
super();
}
@Autowired
public void setPlaylistEntryRepository(final PlaylistEntryRepository playlistEntryRepository) {
this.playlistEntryRepository = playlistEntr... |
final Iterator<PlaylistEntry> playlistEntries = this.playlistEntryRepository.findLargeCollectionPlaylistEntries();
model.addAttribute("dataSource", playlistEntries);
return "thymeleaf/biglist";
| 237 | 63 | 300 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-biglist-webflux/src/main/java/org/thymeleaf/examples/springboot2/biglist/webflux/BigListWebFluxAppConfig.java | BigListWebFluxAppConfig | dataSource | class BigListWebFluxAppConfig implements ApplicationContextAware {
private static final Logger logger = LoggerFactory.getLogger(BigListWebFluxAppConfig.class);
private ApplicationContext applicationContext;
public BigListWebFluxAppConfig() {
super();
}
@Override
public void setApp... |
try {
final Resource dbResource = this.applicationContext.getResource("classpath:data/chinook.sqlite");
logger.debug("Database path: " + dbResource.getURL().getPath());
final DataSourceBuilder dataSourceBuilder = DataSourceBuilder.create();
dataSourceBuilder.dr... | 137 | 153 | 290 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-biglist-webflux/src/main/java/org/thymeleaf/examples/springboot2/biglist/webflux/BigListWebFluxWebConfig.java | BigListWebFluxWebConfig | freeMarkerViewResolver | class BigListWebFluxWebConfig {
private ApplicationContext applicationContext;
public BigListWebFluxWebConfig(final ApplicationContext applicationContext) {
super();
this.applicationContext = applicationContext;
}
/*
* -------------------------------------------------------... |
final FreeMarkerViewResolver freeMarkerViewResolver = new FreeMarkerViewResolver("", ".ftlh");
freeMarkerViewResolver.setOrder(4);
// TODO * Apparently no way to specify which views can be handled by this ViewResolver (viewNames property)
return freeMarkerViewResolver;
| 296 | 72 | 368 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-biglist-webflux/src/main/java/org/thymeleaf/examples/springboot2/biglist/webflux/business/repository/PlaylistEntryRepository.java | PlaylistEntryRepository | findLargeCollectionPlaylistEntries | class PlaylistEntryRepository {
private static final String QUERY_FIND_ALL_PLAYLIST_ENTRIES =
"SELECT p.PlaylistId as 'playlistID', " +
" p.Name as 'playlistName', " +
" t.Name as 'trackName', " +
" ar.Name as 'artistName', " +
" a... |
return Flux.fromIterable(
this.jdbcTemplate.query(
QUERY_FIND_ALL_PLAYLIST_ENTRIES,
(resultSet, i) -> {
return new PlaylistEntry(
Integer.valueOf(resultSet.getInt("playlistID")),
... | 445 | 133 | 578 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-biglist-webflux/src/main/java/org/thymeleaf/examples/springboot2/biglist/webflux/web/controller/FreeMarkerController.java | FreeMarkerController | bigList | class FreeMarkerController {
private PlaylistEntryRepository playlistEntryRepository;
public FreeMarkerController() {
super();
}
@Autowired
public void setPlaylistEntryRepository(final PlaylistEntryRepository playlistEntryRepository) {
this.playlistEntryRepository = playlistEn... |
// Will be async resolved by Spring WebFlux before calling the view
final Flux<PlaylistEntry> playlistStream = this.playlistEntryRepository.findLargeCollectionPlaylistEntries();
model.addAttribute("dataSource", playlistStream);
return "freemarker/biglist";
| 229 | 78 | 307 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-biglist-webflux/src/main/java/org/thymeleaf/examples/springboot2/biglist/webflux/web/controller/ThymeleafController.java | ThymeleafController | bigListChunked | class ThymeleafController {
private PlaylistEntryRepository playlistEntryRepository;
public ThymeleafController() {
super();
}
@Autowired
public void setPlaylistEntryRepository(final PlaylistEntryRepository playlistEntryRepository) {
this.playlistEntryRepository = playlistEntr... |
// Will be async resolved by Spring WebFlux before calling the view
final Flux<PlaylistEntry> playlistStream = this.playlistEntryRepository.findLargeCollectionPlaylistEntries();
model.addAttribute("dataSource", playlistStream);
return "thymeleaf/biglist-chunked";
| 487 | 82 | 569 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-sse-webflux/src/main/java/org/thymeleaf/examples/springboot2/sse/webflux/SSEWebFluxAppConfig.java | SSEWebFluxAppConfig | dataSource | class SSEWebFluxAppConfig implements ApplicationContextAware {
private static final Logger logger = LoggerFactory.getLogger(SSEWebFluxAppConfig.class);
private ApplicationContext applicationContext;
public SSEWebFluxAppConfig() {
super();
}
@Override
public void setApplicationCont... |
try {
final Resource dbResource = this.applicationContext.getResource("classpath:data/chinook.sqlite");
logger.debug("Database path: " + dbResource.getURL().getPath());
final DataSourceBuilder dataSourceBuilder = DataSourceBuilder.create();
dataSourceBuilder.dr... | 137 | 153 | 290 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-sse-webflux/src/main/java/org/thymeleaf/examples/springboot2/sse/webflux/business/repository/PlaylistEntryRepository.java | PlaylistEntryRepository | findLargeCollectionPlaylistEntries | class PlaylistEntryRepository {
private static final String QUERY_FIND_ALL_PLAYLIST_ENTRIES =
"SELECT p.PlaylistId as 'playlistID', " +
" p.Name as 'playlistName', " +
" t.Name as 'trackName', " +
" ar.Name as 'artistName', " +
" a... |
return Flux.fromIterable(
this.jdbcTemplate.query(
QUERY_FIND_ALL_PLAYLIST_ENTRIES,
(resultSet, i) -> {
return new PlaylistEntry(
Integer.valueOf(resultSet.getInt("playlistID")),
... | 309 | 145 | 454 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-sse-webflux/src/main/java/org/thymeleaf/examples/springboot2/sse/webflux/web/controller/SSEController.java | SSEController | events | class SSEController {
private PlaylistEntryRepository playlistEntryRepository;
public SSEController() {
super();
}
@Autowired
public void setPlaylistEntryRepository(final PlaylistEntryRepository playlistEntryRepository) {
this.playlistEntryRepository = playlistEntryRepository;... |
final Flux<PlaylistEntry> playlistStream = this.playlistEntryRepository.findLargeCollectionPlaylistEntries();
final IReactiveDataDriverContextVariable dataDriver =
new ReactiveDataDriverContextVariable(playlistStream, 1, 1);
model.addAttribute("data", dataDriver);
re... | 147 | 88 | 235 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-stsm-mvc/src/main/java/org/thymeleaf/examples/springboot2/stsm/mvc/business/entities/Row.java | Row | toString | class Row {
private Variety variety = null;
private Integer seedsPerCell = null;
public Row() {
super();
}
public Variety getVariety() {
return this.variety;
}
public void setVariety(final Variety variety) {
this.variety = variety;
}
... |
return "Row [variety=" + this.variety + ", seedsPerCell=" + this.seedsPerCell + "]";
| 186 | 36 | 222 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-stsm-mvc/src/main/java/org/thymeleaf/examples/springboot2/stsm/mvc/business/entities/SeedStarter.java | SeedStarter | toString | class SeedStarter {
private Integer id = null;
private Date datePlanted = null;
private Boolean covered = null;
private Type type = Type.PLASTIC;
private Feature[] features = null;
private List<Row> rows = new ArrayList<Row>();
public SeedStarter() {
super();
}
... |
return "SeedStarter [id=" + this.id + ", datePlanted=" + this.datePlanted
+ ", covered=" + this.covered + ", type=" + this.type + ", features="
+ Arrays.toString(this.features) + ", rows=" + this.rows + "]";
| 388 | 83 | 471 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-stsm-mvc/src/main/java/org/thymeleaf/examples/springboot2/stsm/mvc/web/controller/SeedStarterMngController.java | SeedStarterMngController | saveSeedstarter | class SeedStarterMngController {
private VarietyService varietyService;
private SeedStarterService seedStarterService;
public SeedStarterMngController() {
super();
}
@Autowired
public void setVarietyService(final VarietyService varietyService) {
this.varietySer... |
if (bindingResult.hasErrors()) {
return "seedstartermng";
}
this.seedStarterService.add(seedStarter);
return "redirect:/seedstartermng";
| 633 | 53 | 686 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-stsm-mvc/src/main/java/org/thymeleaf/examples/springboot2/stsm/mvc/web/conversion/DateFormatter.java | DateFormatter | createDateFormat | class DateFormatter implements Formatter<Date> {
@Autowired
private MessageSource messageSource;
public DateFormatter() {
super();
}
public Date parse(final String text, final Locale locale) throws ParseException {
final SimpleDateFormat dateFormat = createDateFormat(locale);
... |
final String format = this.messageSource.getMessage("date.format", null, locale);
final SimpleDateFormat dateFormat = new SimpleDateFormat(format);
dateFormat.setLenient(false);
return dateFormat;
| 170 | 57 | 227 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-stsm-webflux/src/main/java/org/thymeleaf/examples/springboot2/stsm/webflux/business/entities/Row.java | Row | toString | class Row {
private Variety variety = null;
private Integer seedsPerCell = null;
public Row() {
super();
}
public Variety getVariety() {
return this.variety;
}
public void setVariety(final Variety variety) {
this.variety = variety;
}
... |
return "Row [variety=" + this.variety + ", seedsPerCell=" + this.seedsPerCell + "]";
| 186 | 36 | 222 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-stsm-webflux/src/main/java/org/thymeleaf/examples/springboot2/stsm/webflux/business/entities/SeedStarter.java | SeedStarter | toString | class SeedStarter {
private Integer id = null;
private Date datePlanted = null;
private Boolean covered = null;
private Type type = Type.PLASTIC;
private Feature[] features = null;
private List<Row> rows = new ArrayList<Row>();
public SeedStarter() {
super();
}
... |
return "SeedStarter [id=" + this.id + ", datePlanted=" + this.datePlanted
+ ", covered=" + this.covered + ", type=" + this.type + ", features="
+ Arrays.toString(this.features) + ", rows=" + this.rows + "]";
| 389 | 83 | 472 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-stsm-webflux/src/main/java/org/thymeleaf/examples/springboot2/stsm/webflux/web/controller/SeedStarterMngController.java | SeedStarterMngController | doSeedstarter | class SeedStarterMngController {
private VarietyService varietyService;
private SeedStarterService seedStarterService;
public SeedStarterMngController() {
super();
}
@Autowired
public void setVarietyService(final VarietyService varietyService) {
this.varietySer... |
return exchange.getFormData().flatMap(
formData -> {
if (formData.containsKey("save")) {
return saveSeedstarter(seedStarter, bindingResult);
}
if (formData.containsKey("addRow")) {
retu... | 975 | 157 | 1,132 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-stsm-webflux/src/main/java/org/thymeleaf/examples/springboot2/stsm/webflux/web/conversion/DateFormatter.java | DateFormatter | createDateFormat | class DateFormatter implements Formatter<Date> {
@Autowired
private MessageSource messageSource;
public DateFormatter() {
super();
}
public Date parse(final String text, final Locale locale) throws ParseException {
final SimpleDateFormat dateFormat = createDateFormat(locale);
... |
final String format = this.messageSource.getMessage("date.format", null, locale);
final SimpleDateFormat dateFormat = new SimpleDateFormat(format);
dateFormat.setLenient(false);
return dateFormat;
| 170 | 57 | 227 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot2/thymeleaf-examples-springboot2-stsm-webflux/src/main/java/org/thymeleaf/examples/springboot2/stsm/webflux/web/conversion/VarietyFormatter.java | VarietyFormatter | parse | class VarietyFormatter implements Formatter<Variety> {
@Autowired
private VarietyService varietyService;
public VarietyFormatter() {
super();
}
public Variety parse(final String text, final Locale locale) throws ParseException {<FILL_FUNCTION_BODY>}
public String print(final Variet... |
final Integer varietyId = Integer.valueOf(text);
// There is no Formatter API yet that allows us to return a Publisher, so we need to block
return this.varietyService.findById(varietyId).block();
| 125 | 59 | 184 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-biglist-mvc/src/main/java/org/thymeleaf/examples/springboot3/biglist/mvc/BigListMvcAppConfig.java | BigListMvcAppConfig | dataSource | class BigListMvcAppConfig implements ApplicationContextAware {
private static final Logger logger = LoggerFactory.getLogger(BigListMvcAppConfig.class);
private ApplicationContext applicationContext;
public BigListMvcAppConfig() {
super();
}
@Override
public void setApplicationCont... |
try {
final Resource dbResource = this.applicationContext.getResource("classpath:data/chinook.sqlite");
logger.debug("Database path: " + dbResource.getURL().getPath());
final DataSourceBuilder dataSourceBuilder = DataSourceBuilder.create();
dataSourceBuilder.dr... | 134 | 153 | 287 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-biglist-mvc/src/main/java/org/thymeleaf/examples/springboot3/biglist/mvc/business/repository/PlaylistEntryRepository.java | PlaylistEntryRepository | findLargeCollectionPlaylistEntries | class PlaylistEntryRepository {
private static final String QUERY_FIND_ALL_PLAYLIST_ENTRIES =
"SELECT p.PlaylistId as 'playlistID', " +
" p.Name as 'playlistName', " +
" t.Name as 'trackName', " +
" ar.Name as 'artistName', " +
" a... |
final List<PlaylistEntry> baseList =
this.jdbcTemplate.query(
QUERY_FIND_ALL_PLAYLIST_ENTRIES,
(resultSet, i) -> {
return new PlaylistEntry(
Integer.valueOf(resultSet.getInt("playlistID")),
... | 449 | 307 | 756 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-biglist-mvc/src/main/java/org/thymeleaf/examples/springboot3/biglist/mvc/web/controller/FreeMarkerController.java | FreeMarkerController | bigListFreeMarker | class FreeMarkerController {
private PlaylistEntryRepository playlistEntryRepository;
public FreeMarkerController() {
super();
}
@Autowired
public void setPlaylistEntryRepository(final PlaylistEntryRepository playlistEntryRepository) {
this.playlistEntryRepository = playlistEn... |
final Iterator<PlaylistEntry> playlistEntries = this.playlistEntryRepository.findLargeCollectionPlaylistEntries();
model.addAttribute("dataSource", playlistEntries);
return "freemarker/biglist";
| 231 | 63 | 294 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-biglist-mvc/src/main/java/org/thymeleaf/examples/springboot3/biglist/mvc/web/controller/ThymeleafController.java | ThymeleafController | bigList | class ThymeleafController {
private PlaylistEntryRepository playlistEntryRepository;
public ThymeleafController() {
super();
}
@Autowired
public void setPlaylistEntryRepository(final PlaylistEntryRepository playlistEntryRepository) {
this.playlistEntryRepository = playlistEntr... |
final Iterator<PlaylistEntry> playlistEntries = this.playlistEntryRepository.findLargeCollectionPlaylistEntries();
model.addAttribute("dataSource", playlistEntries);
return "thymeleaf/biglist";
| 237 | 63 | 300 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-biglist-webflux/src/main/java/org/thymeleaf/examples/springboot3/biglist/webflux/BigListWebFluxAppConfig.java | BigListWebFluxAppConfig | dataSource | class BigListWebFluxAppConfig implements ApplicationContextAware {
private static final Logger logger = LoggerFactory.getLogger(BigListWebFluxAppConfig.class);
private ApplicationContext applicationContext;
public BigListWebFluxAppConfig() {
super();
}
@Override
public void setApp... |
try {
final Resource dbResource = this.applicationContext.getResource("classpath:data/chinook.sqlite");
logger.debug("Database path: " + dbResource.getURL().getPath());
final DataSourceBuilder dataSourceBuilder = DataSourceBuilder.create();
dataSourceBuilder.dr... | 137 | 153 | 290 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-biglist-webflux/src/main/java/org/thymeleaf/examples/springboot3/biglist/webflux/BigListWebFluxWebConfig.java | BigListWebFluxWebConfig | freeMarkerConfig | class BigListWebFluxWebConfig {
private ApplicationContext applicationContext;
public BigListWebFluxWebConfig(final ApplicationContext applicationContext) {
super();
this.applicationContext = applicationContext;
}
/*
* -------------------------------------------------------... |
// Note this is the reactive version of FreeMarker's configuration, so there is no auto-configuration yet.
final FreeMarkerConfigurer freeMarkerConfigurer = new FreeMarkerConfigurer();
freeMarkerConfigurer.setPreTemplateLoaders(new SpringTemplateLoader(this.applicationContext, "classpath:/templ... | 277 | 91 | 368 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-biglist-webflux/src/main/java/org/thymeleaf/examples/springboot3/biglist/webflux/business/repository/PlaylistEntryRepository.java | PlaylistEntryRepository | findLargeCollectionPlaylistEntries | class PlaylistEntryRepository {
private static final String QUERY_FIND_ALL_PLAYLIST_ENTRIES =
"SELECT p.PlaylistId as 'playlistID', " +
" p.Name as 'playlistName', " +
" t.Name as 'trackName', " +
" ar.Name as 'artistName', " +
" a... |
return Flux.fromIterable(
this.jdbcTemplate.query(
QUERY_FIND_ALL_PLAYLIST_ENTRIES,
(resultSet, i) -> {
return new PlaylistEntry(
Integer.valueOf(resultSet.getInt("playlistID")),
... | 445 | 133 | 578 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-biglist-webflux/src/main/java/org/thymeleaf/examples/springboot3/biglist/webflux/web/controller/FreeMarkerController.java | FreeMarkerController | bigList | class FreeMarkerController {
private PlaylistEntryRepository playlistEntryRepository;
public FreeMarkerController() {
super();
}
@Autowired
public void setPlaylistEntryRepository(final PlaylistEntryRepository playlistEntryRepository) {
this.playlistEntryRepository = playlistEn... |
// Will be async resolved by Spring WebFlux before calling the view
final Flux<PlaylistEntry> playlistStream = this.playlistEntryRepository.findLargeCollectionPlaylistEntries();
model.addAttribute("dataSource", playlistStream);
return "freemarker/biglist";
| 229 | 78 | 307 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-biglist-webflux/src/main/java/org/thymeleaf/examples/springboot3/biglist/webflux/web/controller/ThymeleafController.java | ThymeleafController | bigListFull | class ThymeleafController {
private PlaylistEntryRepository playlistEntryRepository;
public ThymeleafController() {
super();
}
@Autowired
public void setPlaylistEntryRepository(final PlaylistEntryRepository playlistEntryRepository) {
this.playlistEntryRepository = playlistEntr... |
// Will be async resolved by Spring WebFlux before calling the view
final Flux<PlaylistEntry> playlistStream = this.playlistEntryRepository.findLargeCollectionPlaylistEntries();
model.addAttribute("dataSource", playlistStream);
return "thymeleaf/biglist-full";
| 489 | 80 | 569 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-sse-webflux/src/main/java/org/thymeleaf/examples/springboot3/sse/webflux/SSEWebFluxAppConfig.java | SSEWebFluxAppConfig | dataSource | class SSEWebFluxAppConfig implements ApplicationContextAware {
private static final Logger logger = LoggerFactory.getLogger(SSEWebFluxAppConfig.class);
private ApplicationContext applicationContext;
public SSEWebFluxAppConfig() {
super();
}
@Override
public void setApplicationCont... |
try {
final Resource dbResource = this.applicationContext.getResource("classpath:data/chinook.sqlite");
logger.debug("Database path: " + dbResource.getURL().getPath());
final DataSourceBuilder dataSourceBuilder = DataSourceBuilder.create();
dataSourceBuilder.dr... | 137 | 153 | 290 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-sse-webflux/src/main/java/org/thymeleaf/examples/springboot3/sse/webflux/business/repository/PlaylistEntryRepository.java | PlaylistEntryRepository | findLargeCollectionPlaylistEntries | class PlaylistEntryRepository {
private static final String QUERY_FIND_ALL_PLAYLIST_ENTRIES =
"SELECT p.PlaylistId as 'playlistID', " +
" p.Name as 'playlistName', " +
" t.Name as 'trackName', " +
" ar.Name as 'artistName', " +
" a... |
return Flux.fromIterable(
this.jdbcTemplate.query(
QUERY_FIND_ALL_PLAYLIST_ENTRIES,
(resultSet, i) -> {
return new PlaylistEntry(
Integer.valueOf(resultSet.getInt("playlistID")),
... | 309 | 145 | 454 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-sse-webflux/src/main/java/org/thymeleaf/examples/springboot3/sse/webflux/web/controller/SSEController.java | SSEController | events | class SSEController {
private PlaylistEntryRepository playlistEntryRepository;
public SSEController() {
super();
}
@Autowired
public void setPlaylistEntryRepository(final PlaylistEntryRepository playlistEntryRepository) {
this.playlistEntryRepository = playlistEntryRepository;... |
final Flux<PlaylistEntry> playlistStream = this.playlistEntryRepository.findLargeCollectionPlaylistEntries();
final IReactiveDataDriverContextVariable dataDriver =
new ReactiveDataDriverContextVariable(playlistStream, 1, 1);
model.addAttribute("data", dataDriver);
re... | 147 | 88 | 235 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-stsm-mvc/src/main/java/org/thymeleaf/examples/springboot3/stsm/mvc/business/entities/Row.java | Row | toString | class Row {
private Variety variety = null;
private Integer seedsPerCell = null;
public Row() {
super();
}
public Variety getVariety() {
return this.variety;
}
public void setVariety(final Variety variety) {
this.variety = variety;
}
... |
return "Row [variety=" + this.variety + ", seedsPerCell=" + this.seedsPerCell + "]";
| 186 | 36 | 222 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-stsm-mvc/src/main/java/org/thymeleaf/examples/springboot3/stsm/mvc/business/entities/SeedStarter.java | SeedStarter | toString | class SeedStarter {
private Integer id = null;
private Date datePlanted = null;
private Boolean covered = null;
private Type type = Type.PLASTIC;
private Feature[] features = null;
private List<Row> rows = new ArrayList<Row>();
public SeedStarter() {
super();
}
... |
return "SeedStarter [id=" + this.id + ", datePlanted=" + this.datePlanted
+ ", covered=" + this.covered + ", type=" + this.type + ", features="
+ Arrays.toString(this.features) + ", rows=" + this.rows + "]";
| 388 | 83 | 471 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-stsm-mvc/src/main/java/org/thymeleaf/examples/springboot3/stsm/mvc/web/controller/SeedStarterMngController.java | SeedStarterMngController | saveSeedstarter | class SeedStarterMngController {
private VarietyService varietyService;
private SeedStarterService seedStarterService;
public SeedStarterMngController() {
super();
}
@Autowired
public void setVarietyService(final VarietyService varietyService) {
this.varietySer... |
if (bindingResult.hasErrors()) {
return "seedstartermng";
}
this.seedStarterService.add(seedStarter);
return "redirect:/seedstartermng";
| 633 | 53 | 686 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-stsm-mvc/src/main/java/org/thymeleaf/examples/springboot3/stsm/mvc/web/conversion/DateFormatter.java | DateFormatter | createDateFormat | class DateFormatter implements Formatter<Date> {
@Autowired
private MessageSource messageSource;
public DateFormatter() {
super();
}
public Date parse(final String text, final Locale locale) throws ParseException {
final SimpleDateFormat dateFormat = createDateFormat(locale);
... |
final String format = this.messageSource.getMessage("date.format", null, locale);
final SimpleDateFormat dateFormat = new SimpleDateFormat(format);
dateFormat.setLenient(false);
return dateFormat;
| 170 | 57 | 227 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-stsm-webflux/src/main/java/org/thymeleaf/examples/springboot3/stsm/webflux/business/entities/Row.java | Row | toString | class Row {
private Variety variety = null;
private Integer seedsPerCell = null;
public Row() {
super();
}
public Variety getVariety() {
return this.variety;
}
public void setVariety(final Variety variety) {
this.variety = variety;
}
... |
return "Row [variety=" + this.variety + ", seedsPerCell=" + this.seedsPerCell + "]";
| 186 | 36 | 222 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-stsm-webflux/src/main/java/org/thymeleaf/examples/springboot3/stsm/webflux/business/entities/SeedStarter.java | SeedStarter | toString | class SeedStarter {
private Integer id = null;
private Date datePlanted = null;
private Boolean covered = null;
private Type type = Type.PLASTIC;
private Feature[] features = null;
private List<Row> rows = new ArrayList<Row>();
public SeedStarter() {
super();
}
... |
return "SeedStarter [id=" + this.id + ", datePlanted=" + this.datePlanted
+ ", covered=" + this.covered + ", type=" + this.type + ", features="
+ Arrays.toString(this.features) + ", rows=" + this.rows + "]";
| 389 | 83 | 472 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-stsm-webflux/src/main/java/org/thymeleaf/examples/springboot3/stsm/webflux/web/controller/SeedStarterMngController.java | SeedStarterMngController | doSeedstarter | class SeedStarterMngController {
private VarietyService varietyService;
private SeedStarterService seedStarterService;
public SeedStarterMngController() {
super();
}
@Autowired
public void setVarietyService(final VarietyService varietyService) {
this.varietySer... |
return exchange.getFormData().flatMap(
formData -> {
if (formData.containsKey("save")) {
return saveSeedstarter(seedStarter, bindingResult);
}
if (formData.containsKey("addRow")) {
retu... | 975 | 157 | 1,132 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-stsm-webflux/src/main/java/org/thymeleaf/examples/springboot3/stsm/webflux/web/conversion/DateFormatter.java | DateFormatter | createDateFormat | class DateFormatter implements Formatter<Date> {
@Autowired
private MessageSource messageSource;
public DateFormatter() {
super();
}
public Date parse(final String text, final Locale locale) throws ParseException {
final SimpleDateFormat dateFormat = createDateFormat(locale);
... |
final String format = this.messageSource.getMessage("date.format", null, locale);
final SimpleDateFormat dateFormat = new SimpleDateFormat(format);
dateFormat.setLenient(false);
return dateFormat;
| 170 | 57 | 227 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springboot3/thymeleaf-examples-springboot3-stsm-webflux/src/main/java/org/thymeleaf/examples/springboot3/stsm/webflux/web/conversion/VarietyFormatter.java | VarietyFormatter | parse | class VarietyFormatter implements Formatter<Variety> {
@Autowired
private VarietyService varietyService;
public VarietyFormatter() {
super();
}
public Variety parse(final String text, final Locale locale) throws ParseException {<FILL_FUNCTION_BODY>}
public String print(final Variet... |
final Integer varietyId = Integer.valueOf(text);
// There is no Formatter API yet that allows us to return a Publisher, so we need to block
return this.varietyService.findById(varietyId).block();
| 125 | 59 | 184 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springsecurity5/thymeleaf-examples-springsecurity5-websecurity/src/main/java/org/thymeleaf/examples/springsecurity5/websecurity/SpringWebApplicationInitializer.java | SpringWebApplicationInitializer | getServletFilters | class SpringWebApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
public static final String CHARACTER_ENCODING = "UTF-8";
public SpringWebApplicationInitializer() {
super();
}
@Override
protected Class<?>[] getServletConfigClasses() {
return n... |
final CharacterEncodingFilter encodingFilter = new CharacterEncodingFilter();
encodingFilter.setEncoding(CHARACTER_ENCODING);
encodingFilter.setForceEncoding(true);
return new Filter[] { encodingFilter };
| 191 | 55 | 246 | <methods>public void <init>() <variables> |
thymeleaf_thymeleaf | thymeleaf/examples/springsecurity5/thymeleaf-examples-springsecurity5-websecurity/src/main/java/org/thymeleaf/examples/springsecurity5/websecurity/security/SpringSecurityConfig.java | SpringSecurityConfig | filterChain | class SpringSecurityConfig {
public SpringSecurityConfig() {
super();
}
@Bean
public SecurityFilterChain filterChain(final HttpSecurity http) throws Exception {<FILL_FUNCTION_BODY>}
@Bean
public InMemoryUserDetailsManager userDetailsService() {
return new InMemoryUserDetails... |
http
.formLogin()
.loginPage("/login.html")
.failureUrl("/login-error.html")
.and()
.logout()
.logoutSuccessUrl("/index.html")
.and()
.authorizeRequests()
.mvcMatchers("/admin... | 177 | 157 | 334 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springsecurity5/thymeleaf-examples-springsecurity5-websecurity/src/main/java/org/thymeleaf/examples/springsecurity5/websecurity/web/SpringWebConfig.java | SpringWebConfig | templateResolver | class SpringWebConfig implements WebMvcConfigurer, ApplicationContextAware {
private ApplicationContext applicationContext;
public SpringWebConfig() {
super();
}
public void setApplicationContext(final ApplicationContext applicationContext) throws BeansException {
this.application... |
SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver();
templateResolver.setApplicationContext(this.applicationContext);
templateResolver.setPrefix("/WEB-INF/templates/");
templateResolver.setSuffix(".html");
templateResolver.setTemplateMode(Templ... | 559 | 120 | 679 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springsecurity5/thymeleaf-examples-springsecurity5-websecurity/src/main/java/org/thymeleaf/examples/springsecurity5/websecurity/web/controller/ErrorController.java | ErrorController | exception | class ErrorController {
private static Logger logger = LoggerFactory.getLogger(ErrorController.class);
@ExceptionHandler(Throwable.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public String exception(final Throwable throwable, final Model model) {<FILL_FUNCTION_BODY>}
} |
logger.error("Exception during execution of SpringSecurity application", throwable);
String errorMessage = (throwable != null ? throwable.getMessage() : "Unknown error");
model.addAttribute("errorMessage", errorMessage);
model.addAttribute("httpStatus", HttpStatus.INTERNAL_SERVER_ERROR)... | 88 | 83 | 171 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springsecurity5/thymeleaf-examples-springsecurity5-websecurity/src/main/java/org/thymeleaf/examples/springsecurity5/websecurity/web/controller/MainController.java | MainController | error | class MainController {
@RequestMapping("/")
public String root(Locale locale) {
return "redirect:/index.html";
}
/** Home page. */
@RequestMapping("/index.html")
public String index() {
return "index";
}
/** User zone index. */
@RequestMapping("/user/index.html")
... |
model.addAttribute("errorCode", "Error " + request.getAttribute("javax.servlet.error.status_code"));
Throwable throwable = (Throwable) request.getAttribute("javax.servlet.error.exception");
StringBuilder errorMessage = new StringBuilder();
errorMessage.append("<ul>");
while (thr... | 416 | 176 | 592 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springsecurity6/thymeleaf-examples-springsecurity6-websecurity/src/main/java/org/thymeleaf/examples/springsecurity6/websecurity/SpringWebApplicationInitializer.java | SpringWebApplicationInitializer | getServletFilters | class SpringWebApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
public static final String CHARACTER_ENCODING = "UTF-8";
public SpringWebApplicationInitializer() {
super();
}
@Override
protected Class<?>[] getServletConfigClasses() {
return n... |
final CharacterEncodingFilter encodingFilter = new CharacterEncodingFilter();
encodingFilter.setEncoding(CHARACTER_ENCODING);
encodingFilter.setForceEncoding(true);
return new Filter[] { encodingFilter };
| 184 | 55 | 239 | <methods>public void <init>() <variables> |
thymeleaf_thymeleaf | thymeleaf/examples/springsecurity6/thymeleaf-examples-springsecurity6-websecurity/src/main/java/org/thymeleaf/examples/springsecurity6/websecurity/security/SpringSecurityConfig.java | SpringSecurityConfig | filterChain | class SpringSecurityConfig {
public SpringSecurityConfig() {
super();
}
@Bean
public SecurityFilterChain filterChain(final HttpSecurity http) throws Exception {<FILL_FUNCTION_BODY>}
@Bean
public InMemoryUserDetailsManager userDetailsService() {
return new InMemoryUserDetails... |
http
.formLogin(formLogin -> formLogin
.loginPage("/login.html")
.failureUrl("/login-error.html"))
.logout(logout -> logout
.logoutSuccessUrl("/index.html"))
.authorizeHttpRequests(authorize -> authorize
... | 177 | 272 | 449 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springsecurity6/thymeleaf-examples-springsecurity6-websecurity/src/main/java/org/thymeleaf/examples/springsecurity6/websecurity/web/SpringWebConfig.java | SpringWebConfig | templateResolver | class SpringWebConfig implements WebMvcConfigurer, ApplicationContextAware {
private ApplicationContext applicationContext;
public SpringWebConfig() {
super();
}
public void setApplicationContext(final ApplicationContext applicationContext) throws BeansException {
this.application... |
SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver();
templateResolver.setApplicationContext(this.applicationContext);
templateResolver.setPrefix("/WEB-INF/templates/");
templateResolver.setSuffix(".html");
templateResolver.setTemplateMode(Templ... | 559 | 120 | 679 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springsecurity6/thymeleaf-examples-springsecurity6-websecurity/src/main/java/org/thymeleaf/examples/springsecurity6/websecurity/web/controller/ErrorController.java | ErrorController | exception | class ErrorController {
private static Logger logger = LoggerFactory.getLogger(ErrorController.class);
@ExceptionHandler(Throwable.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public String exception(final Throwable throwable, final Model model) {<FILL_FUNCTION_BODY>}
} |
logger.error("Exception during execution of SpringSecurity application", throwable);
String errorMessage = (throwable != null ? throwable.getMessage() : "Unknown error");
model.addAttribute("errorMessage", errorMessage);
model.addAttribute("httpStatus", HttpStatus.INTERNAL_SERVER_ERROR)... | 88 | 83 | 171 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/examples/springsecurity6/thymeleaf-examples-springsecurity6-websecurity/src/main/java/org/thymeleaf/examples/springsecurity6/websecurity/web/controller/MainController.java | MainController | error | class MainController {
@RequestMapping("/")
public String root(Locale locale) {
return "redirect:/index.html";
}
/** Home page. */
@RequestMapping("/index.html")
public String index() {
return "index";
}
/** User zone index. */
@RequestMapping("/user/index.html")
... |
model.addAttribute("errorCode", "Error " + request.getAttribute("javax.servlet.error.status_code"));
Throwable throwable = (Throwable) request.getAttribute("javax.servlet.error.exception");
StringBuilder errorMessage = new StringBuilder();
errorMessage.append("<ul>");
while (thr... | 416 | 176 | 592 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity5/src/main/java/org/thymeleaf/extras/springsecurity5/auth/AclAuthUtils.java | AclAuthUtils | parsePermissionsString | class AclAuthUtils {
private static final Logger logger = LoggerFactory.getLogger(AclAuthUtils.class);
private AclAuthUtils() {
super();
}
public static boolean authorizeUsingAccessControlList(
final IExpressionContext context,
final Object domainObject,
... |
if (logger.isTraceEnabled()) {
logger.trace("[THYMELEAF][{}] Parsing permissions string \"{}\".",
new Object[] {TemplateEngine.threadIndex(), permissionsString});
}
if (permissionsString == null || permissionsString.trim().length() == 0) {
r... | 1,410 | 293 | 1,703 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity5/src/main/java/org/thymeleaf/extras/springsecurity5/auth/AclAuthorization.java | AclAuthorization | acl | class AclAuthorization {
private final IExpressionContext context;
private final Authentication authentication;
public AclAuthorization(
final IExpressionContext context,
final Authentication authentication) {
super();
this.context = context;
th... |
Validate.notEmpty(permissions, "permissions cannot be null or empty");
final ApplicationContext applicationContext = AuthUtils.getContext(this.context);
final List<Permission> permissionsList =
AclAuthUtils.parsePermissionsString(applicationContext, permission... | 140 | 109 | 249 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity5/src/main/java/org/thymeleaf/extras/springsecurity5/auth/Authorization.java | Authorization | url | class Authorization {
private final IExpressionContext context;
private final Authentication authentication;
public Authorization(
final IExpressionContext context,
final Authentication authentication) {
super();
this.context = context;
thi... |
Validate.notEmpty(url, "URL cannot be null");
return AuthUtils.authorizeUsingUrlCheck(this.context, url, method, this.authentication);
| 282 | 50 | 332 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity5/src/main/java/org/thymeleaf/extras/springsecurity5/dialect/SpringSecurityDialect.java | SpringSecurityDialect | getProcessors | class SpringSecurityDialect
extends AbstractDialect
implements IProcessorDialect, IExpressionObjectDialect, IExecutionAttributeDialect {
public static final String NAME = "SpringSecurity";
public static final String DEFAULT_PREFIX = "sec";
public static final int PROCESSOR_PRECEDENCE = 800;... |
final Set<IProcessor> processors = new LinkedHashSet<IProcessor>();
final TemplateMode[] templateModes =
new TemplateMode[] {
TemplateMode.HTML, TemplateMode.XML,
TemplateMode.TEXT, TemplateMode.JAVASCRIPT, TemplateMode.CSS };
f... | 1,078 | 283 | 1,361 | <methods>public final java.lang.String getName() <variables>private final non-sealed java.lang.String name |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity5/src/main/java/org/thymeleaf/extras/springsecurity5/dialect/expression/SpringSecurityExpressionObjectFactory.java | SpringSecurityExpressionObjectFactory | buildObject | class SpringSecurityExpressionObjectFactory implements IExpressionObjectFactory {
/*
* Any new objects added here should also be added to the "ALL_EXPRESSION_OBJECT_NAMES" See below.
*/
public static final String AUTHENTICATION_EXPRESSION_OBJECT_NAME = "authentication";
public static final Stri... |
if (AUTHENTICATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
if (SpringVersionSpecificUtils.isWebContext(context)) {
return AuthUtils.getAuthenticationObject(context);
}
}
if (AUTHORIZATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName... | 338 | 196 | 534 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity5/src/main/java/org/thymeleaf/extras/springsecurity5/dialect/processor/AuthenticationAttrProcessor.java | AuthenticationAttrProcessor | doProcess | class AuthenticationAttrProcessor extends AbstractAttributeTagProcessor {
public static final int ATTR_PRECEDENCE = 1300;
public static final String ATTR_NAME = "authentication";
public AuthenticationAttrProcessor(final TemplateMode templateMode, final String dialectPrefix) {
super(templat... |
final String attrValue = (attributeValue == null? null : attributeValue.trim());
if (attrValue == null || attrValue.length() == 0) {
return;
}
final Authentication authentication = AuthUtils.getAuthenticationObject(context);
final Object authenticationProperty = A... | 183 | 146 | 329 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity5/src/main/java/org/thymeleaf/extras/springsecurity5/dialect/processor/AuthorizeAclAttrProcessor.java | AuthorizeAclAttrProcessor | getExpressionDefaultToLiteral | class AuthorizeAclAttrProcessor extends AbstractStandardConditionalVisibilityTagProcessor {
public static final int ATTR_PRECEDENCE = 300;
public static final String ATTR_NAME = "authorize-acl";
private static final String VALUE_SEPARATOR = "::";
public AuthorizeAclAttrProcessor(final Templat... |
final IStandardExpression expression = expressionParser.parseExpression(context, input);
if (expression == null) {
return new TextLiteralExpression(input);
}
return expression;
| 638 | 50 | 688 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity5/src/main/java/org/thymeleaf/extras/springsecurity5/dialect/processor/AuthorizeAttrProcessor.java | AuthorizeAttrProcessor | isVisible | class AuthorizeAttrProcessor extends AbstractStandardConditionalVisibilityTagProcessor {
public static final int ATTR_PRECEDENCE = 300;
public static final String ATTR_NAME = "authorize";
public static final String ATTR_NAME_EXPR = "authorize-expr";
public AuthorizeAttrProcessor(final Template... |
final String attrValue = (attributeValue == null? null : attributeValue.trim());
if (attrValue == null || attrValue.length() == 0) {
return false;
}
final Authentication authentication = AuthUtils.getAuthenticationObject(context);
if (authentication == null) {
... | 192 | 108 | 300 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity5/src/main/java/org/thymeleaf/extras/springsecurity5/dialect/processor/AuthorizeUrlAttrProcessor.java | AuthorizeUrlAttrProcessor | isVisible | class AuthorizeUrlAttrProcessor extends AbstractStandardConditionalVisibilityTagProcessor {
public static final int ATTR_PRECEDENCE = 300;
public static final String ATTR_NAME = "authorize-url";
public AuthorizeUrlAttrProcessor(final TemplateMode templateMode, final String dialectP... |
final String attrValue = (attributeValue == null? null : attributeValue.trim());
if (attrValue == null || attrValue.length() == 0) {
return false;
}
final int spaceIndex = attrValue.indexOf(' ');
final String url =
(spaceIndex < 0? attrValue : attr... | 174 | 185 | 359 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity5/src/main/java/org/thymeleaf/extras/springsecurity5/util/Spring5VersionSpecificUtility.java | Spring5VersionSpecificUtility | getServletWebExchange | class Spring5VersionSpecificUtility implements ISpringVersionSpecificUtility {
Spring5VersionSpecificUtility() {
super();
}
public EvaluationContext wrapEvaluationContext(
final EvaluationContext evaluationContext, final IExpressionObjects expresionObjects) {
final IThymel... |
IWebExchange webExchange = getWebExchange(context);
if (webExchange instanceof IServletWebExchange) {
return (IServletWebExchange) webExchange;
}
throw new TemplateProcessingException(
"Cannot obtain IServletWebExchange from a non-Servlet context implementati... | 771 | 97 | 868 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity5/src/main/java/org/thymeleaf/extras/springsecurity5/util/SpringSecurityVersionUtils.java | SpringSecurityVersionUtils | testClassExistence | class SpringSecurityVersionUtils {
private static final int SPRING_SECURITY_VERSION_MAJOR;
private static final int SPRING_SECURITY_VERSION_MINOR;
static {
String springSecurityVersion = SpringSecurityCoreVersion.getVersion();
// We will first compute the package name root for the spr... |
final ClassLoader classLoader = ClassLoaderUtils.getClassLoader(SpringSecurityVersionUtils.class);
try {
Class.forName(className, false, classLoader);
return true;
} catch (final Throwable t) {
return false;
}
| 1,680 | 70 | 1,750 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity5/src/main/java/org/thymeleaf/extras/springsecurity5/util/SpringVersionSpecificUtils.java | SpringVersionSpecificUtils | wrapEvaluationContext | class SpringVersionSpecificUtils {
private static final Logger LOG = LoggerFactory.getLogger(SpringVersionSpecificUtils.class);
private static final String PACKAGE_NAME = SpringVersionSpecificUtils.class.getPackage().getName();
// Spring Security 5 requires at least Spring 5
private static final Stri... |
if (spring5Delegate != null) {
return spring5Delegate.wrapEvaluationContext(evaluationContext, expresionObjects);
}
throw new ConfigurationException(
"The authorization infrastructure could not create initializer for the specific version of Spring being" +
... | 1,100 | 85 | 1,185 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity6/src/main/java/org/thymeleaf/extras/springsecurity6/auth/AclAuthUtils.java | AclAuthUtils | getBeanOfType | class AclAuthUtils {
private static final Logger logger = LoggerFactory.getLogger(AclAuthUtils.class);
private AclAuthUtils() {
super();
}
public static boolean authorizeUsingAccessControlList(
final IExpressionContext context,
final Object domainObject,
... |
final Map<String, T> map = applicationContext.getBeansOfType(type);
for (ApplicationContext context = applicationContext.getParent(); context != null; context = context.getParent()) {
map.putAll(context.getBeansOfType(type));
}
if (map.size() == 0) {
return nu... | 1,505 | 164 | 1,669 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity6/src/main/java/org/thymeleaf/extras/springsecurity6/auth/AclAuthorization.java | AclAuthorization | acl | class AclAuthorization {
private final IExpressionContext context;
private final Authentication authentication;
public AclAuthorization(
final IExpressionContext context,
final Authentication authentication) {
super();
this.context = context;
this.authe... |
Validate.notEmpty(permissions, "permissions cannot be null or empty");
final ApplicationContext applicationContext = AuthUtils.getContext(this.context);
final List<Permission> permissionsList =
AclAuthUtils.parsePermissionsString(applicationContext, permissions);
ret... | 138 | 105 | 243 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity6/src/main/java/org/thymeleaf/extras/springsecurity6/auth/AuthUtils.java | MinimalAuthenticationExpressionSupport | evaluateMinimalExpression | class MinimalAuthenticationExpressionSupport {
// -----------------------------------------------------------------------------------------------
// This class is meant to given a minimal support to Spring Security expressions available at
// the sec:authorize tags for Spring WebFlux applicatio... |
if (EXPR_ISAUTHENTICATED.equals(accessExpression)) {
return isAuthenticated(authentication);
}
if (EXPR_ISFULLYAUTHENTICATED.equals(accessExpression)) {
return isFullyAuthenticated(authentication);
}
if (EXPR_ISANONYMOUS.equals... | 587 | 181 | 768 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity6/src/main/java/org/thymeleaf/extras/springsecurity6/auth/Authorization.java | Authorization | url | class Authorization {
private final IExpressionContext context;
private final Authentication authentication;
public Authorization(
final IExpressionContext context,
final Authentication authentication) {
super();
this.context = context;
this.authentica... |
Validate.notEmpty(url, "URL cannot be null");
return AuthUtils.authorizeUsingUrlCheck(this.context, url, method, this.authentication);
| 271 | 47 | 318 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity6/src/main/java/org/thymeleaf/extras/springsecurity6/dialect/SpringSecurityDialect.java | SpringSecurityDialect | getProcessors | class SpringSecurityDialect
extends AbstractDialect
implements IProcessorDialect, IExpressionObjectDialect, IExecutionAttributeDialect {
public static final String NAME = "SpringSecurity";
public static final String DEFAULT_PREFIX = "sec";
public static final int PROCESSOR_PRECEDENCE = 800;... |
final Set<IProcessor> processors = new LinkedHashSet<IProcessor>();
final TemplateMode[] templateModes =
new TemplateMode[] {
TemplateMode.HTML, TemplateMode.XML,
TemplateMode.TEXT, TemplateMode.JAVASCRIPT, TemplateMode.CSS };
f... | 1,075 | 283 | 1,358 | <methods>public final java.lang.String getName() <variables>private final non-sealed java.lang.String name |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity6/src/main/java/org/thymeleaf/extras/springsecurity6/dialect/expression/SpringSecurityExpressionObjectFactory.java | SpringSecurityExpressionObjectFactory | buildObject | class SpringSecurityExpressionObjectFactory implements IExpressionObjectFactory {
/*
* Any new objects added here should also be added to the "ALL_EXPRESSION_OBJECT_NAMES" See below.
*/
public static final String AUTHENTICATION_EXPRESSION_OBJECT_NAME = "authentication";
public static final Stri... |
if (AUTHENTICATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
if (SpringVersionSpecificUtils.isWebContext(context)) {
return AuthUtils.getAuthenticationObject(context);
}
}
if (AUTHORIZATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName... | 338 | 196 | 534 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity6/src/main/java/org/thymeleaf/extras/springsecurity6/dialect/processor/AuthenticationAttrProcessor.java | AuthenticationAttrProcessor | doProcess | class AuthenticationAttrProcessor extends AbstractAttributeTagProcessor {
public static final int ATTR_PRECEDENCE = 1300;
public static final String ATTR_NAME = "authentication";
public AuthenticationAttrProcessor(final TemplateMode templateMode, final String dialectPrefix) {
super(templateMod... |
final String attrValue = (attributeValue == null? null : attributeValue.trim());
if (attrValue == null || attrValue.length() == 0) {
return;
}
final Authentication authentication = AuthUtils.getAuthenticationObject(context);
final Object authenticationProperty = A... | 181 | 146 | 327 | <methods><variables>private final non-sealed boolean removeAttribute |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity6/src/main/java/org/thymeleaf/extras/springsecurity6/dialect/processor/AuthorizeAclAttrProcessor.java | AuthorizeAclAttrProcessor | isVisible | class AuthorizeAclAttrProcessor extends AbstractStandardConditionalVisibilityTagProcessor {
public static final int ATTR_PRECEDENCE = 300;
public static final String ATTR_NAME = "authorize-acl";
private static final String VALUE_SEPARATOR = "::";
public AuthorizeAclAttrProcessor(final TemplateMod... |
final String attrValue = (attributeValue == null? null : attributeValue.trim());
if (attrValue == null || attrValue.length() == 0) {
return false;
}
final Authentication authentication = AuthUtils.getAuthenticationObject(context);
if (authentication == null) {
... | 275 | 410 | 685 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity6/src/main/java/org/thymeleaf/extras/springsecurity6/dialect/processor/AuthorizeAttrProcessor.java | AuthorizeAttrProcessor | isVisible | class AuthorizeAttrProcessor extends AbstractStandardConditionalVisibilityTagProcessor {
public static final int ATTR_PRECEDENCE = 300;
public static final String ATTR_NAME = "authorize";
public static final String ATTR_NAME_EXPR = "authorize-expr";
public AuthorizeAttrProcessor(final TemplateMode... |
final String attrValue = (attributeValue == null? null : attributeValue.trim());
if (attrValue == null || attrValue.length() == 0) {
return false;
}
final Authentication authentication = AuthUtils.getAuthenticationObject(context);
if (authentication == null) {
... | 189 | 108 | 297 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity6/src/main/java/org/thymeleaf/extras/springsecurity6/dialect/processor/AuthorizeUrlAttrProcessor.java | AuthorizeUrlAttrProcessor | isVisible | class AuthorizeUrlAttrProcessor extends AbstractStandardConditionalVisibilityTagProcessor {
public static final int ATTR_PRECEDENCE = 300;
public static final String ATTR_NAME = "authorize-url";
public AuthorizeUrlAttrProcessor(final TemplateMode templateMode, final String dialectPrefix) {
sup... |
final String attrValue = (attributeValue == null? null : attributeValue.trim());
if (attrValue == null || attrValue.length() == 0) {
return false;
}
final int spaceIndex = attrValue.indexOf(' ');
final String url =
(spaceIndex < 0? attrValue : attr... | 167 | 185 | 352 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity6/src/main/java/org/thymeleaf/extras/springsecurity6/util/Spring6VersionSpecificUtility.java | Spring6VersionSpecificUtility | isWebMvcContext | class Spring6VersionSpecificUtility implements ISpringVersionSpecificUtility {
Spring6VersionSpecificUtility() {
super();
}
public EvaluationContext wrapEvaluationContext(
final EvaluationContext evaluationContext, final IExpressionObjects expresionObjects) {
final IThymel... |
if (context instanceof IWebContext) {
IWebContext webContext = (IWebContext) context;
IWebExchange webExchange = webContext.getExchange();
if (webExchange instanceof IServletWebExchange) {
return true;
}
}
return false;
| 783 | 78 | 861 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity6/src/main/java/org/thymeleaf/extras/springsecurity6/util/SpringSecurityContextUtils.java | SpringSecurityWebMvcApplicationContextUtils | findRequiredWebApplicationContext | class SpringSecurityWebMvcApplicationContextUtils {
static Object getRequestAttribute(final IContext context, final String attributeName) {
return ((IWebContext)context).getExchange().getAttributeValue(attributeName);
}
static String getContextPath(final IContext context) {
... |
IServletWebApplication application = (IServletWebApplication) ((IWebContext) context).getExchange().getApplication();
ServletContext servletContext = (ServletContext) application.getNativeServletContextObject();
WebApplicationContext wac = WebApplicationContextUtils.getWebApplicat... | 521 | 275 | 796 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity6/src/main/java/org/thymeleaf/extras/springsecurity6/util/SpringSecurityVersionUtils.java | SpringSecurityVersionUtils | getClass | class SpringSecurityVersionUtils {
private static final int SPRING_SECURITY_VERSION_MAJOR;
private static final int SPRING_SECURITY_VERSION_MINOR;
static {
String springSecurityVersion = SpringSecurityCoreVersion.getVersion();
// We will first compute the package name root for the spr... |
final ClassLoader classLoader = ClassLoaderUtils.getClassLoader(SpringSecurityVersionUtils.class);
try {
return Class.forName(className, false, classLoader);
} catch (final Throwable t) {
return null;
}
| 1,684 | 66 | 1,750 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-extras-springsecurity6/src/main/java/org/thymeleaf/extras/springsecurity6/util/SpringVersionSpecificUtils.java | SpringVersionSpecificUtils | wrapEvaluationContext | class SpringVersionSpecificUtils {
private static final Logger LOG = LoggerFactory.getLogger(SpringVersionSpecificUtils.class);
private static final String PACKAGE_NAME = SpringVersionSpecificUtils.class.getPackage().getName();
// Spring Security 6 requires at least Spring 6
private static final Stri... |
if (spring6Delegate != null) {
return spring6Delegate.wrapEvaluationContext(evaluationContext, expresionObjects);
}
throw new ConfigurationException(
"The authorization infrastructure could not create initializer for the specific version of Spring being" +
... | 1,092 | 87 | 1,179 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/context/SpringContextUtils.java | SpringContextUtils | getApplicationContext | 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;
}
// The ThymeleafEvaluationContext is set into the model by ThymeleafView (or wrapped by the SPEL evaluator)
final IThymeleafEvaluationContext evaluationContext =
(IThymeleafEvaluationContext) context.getVariable(Thymeleaf... | 947 | 277 | 1,224 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/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-spring5/src/main/java/org/thymeleaf/spring5/context/webflux/SpringWebFluxThymeleafRequestDataValueProcessor.java | SpringWebFluxThymeleafRequestDataValueProcessor | getExtraHiddenFields | 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 null;
}
return this.requestDataValueProcessor.getExtraHiddenFields(this.exchange);
| 403 | 60 | 463 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/context/webmvc/SpringWebMvcThymeleafRequestDataValueProcessor.java | SpringWebMvcThymeleafRequestDataValueProcessor | processUrl | 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 url;
}
return this.requestDataValueProcessor.processUrl(this.httpServletRequest, url);
| 414 | 60 | 474 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/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-spring5/src/main/java/org/thymeleaf/spring5/expression/SPELContextMapWrapper.java | SPELContextMapWrapper | containsKey | 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... |
if (this.evaluationContext.isVariableAccessRestricted()) {
if (REQUEST_PARAMETERS_RESTRICTED_VARIABLE_NAME.equals(key)) {
throw new TemplateProcessingException(
"Access to variable \"" + key + "\" is forbidden in this context. Note some restrictions apply to ... | 751 | 222 | 973 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/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-spring5/src/main/java/org/thymeleaf/spring5/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-spring5/src/main/java/org/thymeleaf/spring5/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)) {
return new Themes(context);
}
if (FIELDS_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)... | 466 | 195 | 661 | <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-spring5/src/main/java/org/thymeleaf/spring5/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-spring5/src/main/java/org/thymeleaf/spring5/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 ... |
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, "",... | 264 | 76 | 340 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/expression/ThymeleafEvaluationContext.java | ThymeleafEvaluationContextACLPropertyAccessor | canRead | class ThymeleafEvaluationContextACLPropertyAccessor extends ReflectivePropertyAccessor {
private final ReflectivePropertyAccessor propertyAccessor;
ThymeleafEvaluationContextACLPropertyAccessor() {
this(null);
}
ThymeleafEvaluationContextACLPropertyAccessor(final Reflectiv... |
final boolean canRead;
if (this.propertyAccessor != null) {
canRead = this.propertyAccessor.canRead(context, targetObject, name);
} else {
canRead = super.canRead(context, targetObject, name);
}
if (canRead) {
... | 174 | 263 | 437 | <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-spring5/src/main/java/org/thymeleaf/spring5/expression/ThymeleafEvaluationContextWrapper.java | ThymeleafEvaluationContextWrapper | lookupVariable | 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.expressionObjects != null && this.expressionObjects.containsObject(name)) {
final Object result = this.expressionObjects.getObject(name);
if (result != null) {
return result;
}
}
if (this.additionalVariables != null && this.addition... | 1,173 | 154 | 1,327 | <no_super_class> |
thymeleaf_thymeleaf | thymeleaf/lib/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/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(... | 521 | 382 | 903 | <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-spring5/src/main/java/org/thymeleaf/spring5/processor/AbstractSpringFieldTagProcessor.java | AbstractSpringFieldTagProcessor | matchesDiscriminator | 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... |
if (this.discriminatorAttrName == null) {
return true;
}
final boolean hasDiscriminatorAttr = tag.hasAttribute(this.discriminatorAttributeDefinition.getAttributeName());
if (this.discriminatorAttrValues == null || this.discriminatorAttrValues.length == 0) {
retu... | 1,731 | 270 | 2,001 | <methods><variables>private final non-sealed boolean removeAttribute |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.