mugwort provides some utitilities for enterprise software development using
spring, hibernate, servlets, xstream, java-bean-validation, …
… for using Hibernate and Spring
- BaseRepository - A very mightfull basic repository to be used with spring and hibernate. (Can also be used with spring-data-jpa for custom repositories.)
- IdentifiedEntity - A basic class for persisted entities.
- BaseService - A spring base service, with support for manual transactions (and more to come)
- SecureEnvironment – Supports encrypted property values.
- ImmutableCheckInterceptor – To make entities really immutable (and log and suppress attempts to modifiy them)
… for working with Servlets
- ServletUtils - Gets headers/cookies/paramaters as string lists, gets dump, …
- DumpFilter - Used to dump the servlet reuest.
… for extending XStream
Converts a map to a list of xml-attributes. The key of the Map becomes the name of the xml-attribute, and the value of the Map becomes the value of the xml-attribute.
… for validating beans
- Occurence - The annotated list must not have more than one elements, where the specified field (getter) has the specified value
- OneNotEmpty - At least one of the given fields must be non-empty (for strings, collections and arrays) or non-null (for anything else).
- DependantNotEmpty – The value of the field ‘fieldname’ must not be empty, if the value of the file ‘dependantField’ is equal to the ‘dependantValue’.
- Country – The annotated element must be a valid country code (ISO 3166-1 ALPHA-2 code)
- Curreny - The annotated element must be a valid currency code (ISO 4217 ALPHA)
- Locale - The annotated element must be a valid locale code
… more to come …
Browse the Javadoc of the latest version.
<dependency> <groupId>net.thk-systems.commons</groupId> <artifactId>mugwort</artifactId> <version>3.7.1</version> </dependency>
You can browse maven-central to download the jar or other versions.
(A downloadable zip-file packed with all dependencies is currently not deployed.)
Note: mugwort comes with no maven dependencies to spring, hibernate, servlet-api, … .
3.7.0 / 3.7.1
- Updated dependencies
3.5.0 / 3.6.2
- Removed ValidatedByValidator
- Added LocaleValidator
- Added ValidatedByValidator
- Added CurrencyValidator
- Added CountryValidator
- Added BaseService.runInTransaction
- Added ConditionalNotEmptyValidator
- Move to Java 8 (first without changing anything
- Added OneNotEmptyValidator
- Added ImmutableCheckInterceptor and @Immutable and @Mutable annotations
- Added OccurenceValidator
- Renamed ExtendedEnvironment to SecureEnvironment and added a ‘merging’ with ‘default’ environment
- Added ExtendedEnvironment and JasyptTool
- Released as 2.0.0 under new maven group id