Spring Batch XML File Reader and Writer Example
Learn to read and write XML files using StaxEventItemReader and StaxEventItemWriter classes in a Spring Batch application.
Learn to read and write XML files using StaxEventItemReader and StaxEventItemWriter classes in a Spring Batch application.
Learn to read all the rows from an Excel (.xls or .xlsx) file using Spring Batch and save them in a database in a Spring Boot application.
In LangChain4j, the AiServices helps in working with strongly typed objects and tasks such as extracting and parsing the structured output in JSON or XML format.
Executors.newVirtualThreadPerTaskExecutor() runs each task in a new virtual thread. Learn close(), invokeAll, Semaphore limits, thread names and errors.
This Spring Boot tutorial aims at Langchain4j Chat APIs to get started with and run a few examples to give you a high-level understanding.
In Lucene, ByteBuffersDirectory is for pure in-memory access for demos, and MMapDirectory uses memory-mapped files stored in the filesystem.
Spring AI structured output examples: entity() for records, lists and maps, native JSON schema output with Ollama, and the validation advisor.
Spring AI image generation with ImageModel and OpenAI gpt-image-1-mini: ImagePrompt, size and quality options, Base64 output and a banner endpoint.
Spring AI getting started guide: install Ollama, create a Spring Boot 4 project, write a ChatClient endpoint, run it locally and fix the common errors.
Learn to write SQL queries with ‘LIKE’ keyword in a Spring Boot JPA application and execute with JdbcClient, JdbcTemplate or JpaRepository template methods.
Learn to create a REST API controller using @RestController in a Spring Boot application, and add method validation, error handling and unit tests.
Learn to Spring Data JPA module and work with JpaRepository interface for performing the CRUD operations in underlying databases in a Spring Boot application.
The build error NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field ‘qualid’ means an old Lombok (1.18.28 or older) is compiling on JDK 21 or newer. Upgrade Lombok to 1.18.48 in Maven, Gradle or the IDE and rebuild.
Learn to filter a map by keys and values with Java streams, plus Predicate helpers, removeIf(), order-preserving toMap() and null-safe collecting.
Java Stream contains, containsAny and containsAll checks with anyMatch() and a Set, with empty-input rules, single-use streams and collection alternatives.
Learn to filter nested collections with Java streams using flatMap(), mapMulti() and anyMatch(), trim inner lists without mutation and handle null lists.
Learn Java Stream mapMulti() with examples, the type witness it needs, when it beats flatMap() and when it does not, primitive variants and a real case.
Get the first and last day of week, month or year in Java with TemporalAdjusters, WeekFields for locales, YearMonth and quarter boundaries.
Learn how to call an interface default method in Java, from Interface.super to proxies with InvocationHandler.invokeDefault() and MethodHandles.
Learn what an object identity string is in Java, how Objects.toIdentityString() and System.identityHashCode() build it, and what its hash part means.
Base64 encode and decode a file in Java with examples for text and image files, data URIs, streaming large files with wrap(), MIME and decoding errors.
Learn to initialize HashMap in Java with Map.of, newHashMap and streams, and see how initial capacity and load factor decide when the map resizes.
A subclass replaces a parent method by overriding it. Learn the override keyword, noImplicitOverride, super calls and the rules the compiler checks.
For each interface, we must write a custom XmlAdapter class that handles the conversion between the value in Java Object and XML string.
Compare camel case, Pascal case, snake case and kebab case with examples. Learn which styles suit Java, Python, URLs, CSS and constant names.
Learn to solve the error “No default constructor found” when unmarshaling an XML to Java object using JAXB @XmlTransient and @XmlJavaTypeAdapter annotations.
orElse vs orElseGet in Java explained with examples. Learn why orElse always computes its default, when orElseGet saves work and how to avoid side effects.
An interface cannot be instantiated with new, but any object with the right shape matches it. Learn seven ways to create such objects and when to use each.
instanceof checks whether an object was created by a class and narrows its type. Learn how it works, where it fails, and how to check interfaces with in and type guards.
An interface describes a shape and disappears after compilation; a class describes a shape, holds code and exists at runtime. Compare them feature by feature.
TypeScript generics let one function, class or interface work with many types while the compiler checks every value. Examples cover constraints, keyof, defaults and const type parameters.
Extend a TypeScript interface with extends, combine several parents, merge declarations, and learn when an intersection type (&) is the better fit.
A TypeScript interface names the shape of an object. Learn to declare one, use optional and readonly properties, implement it in a class, and choose between an interface and a type alias.
Learn to write Spring Boot RESTs that help in downloading the Excel files (.xlsx) either stored in the server or generating and then sending it.
Learn to create generic and custom error pages for specific HTTP error codes in a Spring Boot application with configuration examples.
By leveraging Spring @Import and @ImportResource annotations, we can create more modular, maintainable, and flexible Spring Boot applications.
Spring Boot provides various ways to load property files such as default application.properties, spring profiles, custom property files, environment variables, and system properties.
Learn to create a Spring Boot project with Gradle from scratch, configure the build script, create a Spring Boot application class, and run the application.
Filter a Python list with filter() and a lambda. See its syntax and return value, and filter strings, objects, None values and items by another list.
Find the most frequent element in a Python list with Counter.most_common(), statistics.mode() and multimode(), pandas and NumPy, including ties.
Remove duplicates from a Python list while keeping order with dict.fromkeys(), a seen set, NumPy np.unique() and pandas, plus dedupe by key and timings.
Use the Python multidict library to map one key to several values. Add, getall, update, popall, CIMultiDict for headers, and defaultdict(list) compared.
Keep the last N items in Python with deque(maxlen=n) or slicing [-n:]. Covers lists, NumPy arrays, strings, the n=0 trap, file tails and moving averages.
Calculate the weeks between two dates in Java with ChronoUnit.WEEKS.between(), get leftover days, round up started weeks and count calendar weeks.
Get the day name from a date in Java with getDisplayName() and TextStyle, print it in any language, list all names and parse names back.
Split a date-time range into equal intervals in Java, cut fixed-length chunks, or split by days, weeks, months and years with half-open ranges and DST.
Java StopWatch examples with Guava Stopwatch, Commons Lang and Spring StopWatch, plus a small testable java.time version that records named laps.
Get the elapsed time since midnight in Java in seconds or milliseconds with LocalTime, in any time zone, correct on daylight saving days.
Learn to get the quarter from a date in Java with IsoFields, find quarter start and end dates, format Q3 labels and calculate fiscal quarters.
Convert month number to name in Java with Month.getDisplayName(), and parse full or short month names back to numbers in any locale.
HowToDoInJava provides tutorials and how-to guides on Java and related technologies.
It also shares the best practices, algorithms & solutions and frequently asked interview questions.