Skip to content

mgc.common

Seppel Hardt edited this page Mar 11, 2019 · 1 revision
de.micromata.mgc.common contains some basic functions, which are commonly used.

Use MGC in your projects

MGC uses Maven as build system. If you use MGC in your own project, you have to include the MGC repository in your pom.

<dependencies>
    <dependency>
      <groupId>de.micromata.mgc</groupId>
      <artifactId>de.micromata.mgc.common</artifactId>
      <version>${mgc.version}</version>
    </dependency>
</dependencies>

PrivateBeanUtils

Want to read/write fields or invoke methods - if public or not - not dealing with complex Exceptionhandling? PrivateBeanUtils is your friend.

Matcher Framework

See Matcher Framework (German)

Matchers are framework to create filters to varios objects. The base interface is

de.micromata.genome.util.matcher.Matcher<T>, where T is the object to matched against Matchers can be either created explizit composing in java or via a de.micromata.genome.util.matcher.MatcherFactory<T>. To understand Matchers here some samples.

PrivateBeanUtils.copyInstanceProperties(JpaTriggerJobDO.class, toupdate, jjob,
            CommonMatchers.and(FieldMatchers.hasNotModifier(Modifier.STATIC),
                FieldMatchers.fieldName("+*,-createdAt,-createdBy,-updateCounter,-pk,-attributes")));

LocalSettings und LocalSettingsEnv

LocalSettings and LocalSettingsEnv is a very easy to use but very powerfull configuration via simple properties files. It has also integrates the ability to declare DataSources, Mailsessions and JNDI Elements.