org.devocative:adroit

Utility classes specially used in Demeter project

License

License

GroupId

GroupId

org.devocative
ArtifactId

ArtifactId

adroit
Last Version

Last Version

2.1
Release Date

Release Date

Type

Type

jar
Description

Description

org.devocative:adroit
Utility classes specially used in Demeter project
Project URL

Project URL

https://github.com/mbizhani/Adroit
Source Code Management

Source Code Management

https://github.com/mbizhani/Adroit.git

Download adroit

How to add to project

<!-- https://jarcasting.com/artifacts/org.devocative/adroit/ -->
<dependency>
    <groupId>org.devocative</groupId>
    <artifactId>adroit</artifactId>
    <version>2.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.devocative/adroit/
implementation 'org.devocative:adroit:2.1'
// https://jarcasting.com/artifacts/org.devocative/adroit/
implementation ("org.devocative:adroit:2.1")
'org.devocative:adroit:jar:2.1'
<dependency org="org.devocative" name="adroit" rev="2.1">
  <artifact name="adroit" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.devocative', module='adroit', version='2.1')
)
libraryDependencies += "org.devocative" % "adroit" % "2.1"
[org.devocative/adroit "2.1"]

Dependencies

compile (5)

Group / Artifact Type Version
org.apache.poi : poi-ooxml jar 4.0.1
com.ibm.icu : icu4j jar 63.1
org.slf4j : slf4j-api jar 1.7.25
commons-beanutils : commons-beanutils jar 1.9.3
com.thoughtworks.xstream : xstream jar 1.4.9

test (3)

Group / Artifact Type Version
org.slf4j : slf4j-log4j12 jar 1.7.25
junit : junit jar 4.12
org.hsqldb : hsqldb jar 2.4.1

Project Modules

There are no modules declared in this project.

Adroit

Maven Central

The Adroit project is a collection of utility classes, specially used in Demeter project. Some of important classes are as follows:

  • CalendarUtil: Handling date conversion between Gregorian and Jalali (Persian) calendar, using icu4j library.
  • ExcelExporter: Converting a list of data to an Excel file.
  • ObjectBuilder: A wrapper class around classes using method chaining to add/modify elements easily.
  • ConfigUil: A utility class to get application configuration from config.properties file located in the root of classpath. The IConfigKey interface, used in ConfigUtil, is provided to be implemented by an enum class where its literals are used as config keys.
  • NamedParameterStatement: Like Java's prepared statement, except using named parameters instead of ?
    • Using a plugin architecture to alter default behavior and modify query
    • FilterPlugin: replace %FILTER% value in the query string with appropriate sequential and clauses based on a passed Map object as filter
    • PaginationPlugin: alter query for proper pagination clause for HSQLDB, MySQL, and Oracle databases
    • SchemaPlugin: alter query and prepend tables with the passed schema name
  • StringEncryptorUtil: A utility class providing encryption/decryption, encoding/decoding and hashing functions of strings
  • ObjectUtil: A utility class providing bean introspection and other general operation regarding objects
  • AdroitXStream: A subclass of XStream with two features
    • Using CDATA for tag with string body
    • A boolean converter which ignores false value.
  • LRUCache: Using LinkedHashMap as its core for caching objects with more utilities.
  • SQL Helper Classes: ExportImportHelper and SqlHelper classes are wrapper around NamedParameterStatement
    • ExportImportHelper: a class to export/import SQL result to/from XML
    • SqlHelp: it uses an XML file based on XQuery class as the SQL queries reference (it is hard to embed SQL queries) in Java code and lots of other helper methods for result conversion to List, Map, or List of Beans

Some samples are provided in the test class, TestAdroit. For testing NamedParameterStatement, the sample schema is provided in the test/resources/init_hsql.sql file for HSQLDB database and imported on test startup using InitDB class.

Versions

Version
2.1
2.0
1.6
1.5
1.4
1.3
1.2
1.1
1.0