<commit_before>= Jipsy
:author: <NAME>
:revnumber: 0.1.0
:revremark: Configurable Java Annotation Processor to simplify the use of the Service Provider Interface

image::https://d2weczhvl823v0.cloudfront.net/aalmiray/griffon2/trend.png[Bitdeli Badge, link="https://bitdeli.com/free"]

Configurable Java Annotation Processor to simplify the use of the Service Provider Interface.

== Introduction

JDK6 added a neat facility named http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html[ServiceLoader] that
enables library authors to hook in implementations using an http://en.wikipedia.org/wiki/Service_provider_interface[SPI].
As explained at the http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html[service loader documentation],
services must follow certain rules in order to be considered as such; they also must be registered using an standard location
based on a naming convention. The following rules apply to classes that may be considered services

. The class must implement at least one target interface (the service interface).
. The class must provide a no-args constructor.
. The class must be public.
. The class name should be added to a file named `META-INF/services/<target_interface_name>`

This library provides a mechanism for enforcing those rules by simply adding an annotation on each service implementation, for
example say there exists the following `Calculator` service interface

[source,java]
----
package com.acme;

public interface Calculator {
    double add(double a, double b);
}
----

A basic implementation of such service may be as follows

[source,java]
----
package com.acme;

@org.kordamp.jipsy.ServiceProviderFor(Calculator.class)
public class BasicCalculator implements Calculator {
    public double add(double a, double b) { return a + b; }
}
----

Compile your code. If you look closely at your project's output you'll see a file named
`META-INF/services/com.acme.Calculator` whose contents should look similar to

[source]
[subs="verbatim,attributes"]
----
# Generated by org.kordamp.jipsy.processor.service.ServiceProviderProcessor ({revnumber})
# Wed, 25 Dec 2013 22:28:50 +0100
com.acme.BasicCalculator
----

Et voilà! There are no additional sources to be touched nor files to be created; Jipsy will take care of the boiler plate.

== Installing

Jipsy is package as a standalone jars with no additional dependencies. Jipsy requires JDK6 as a minimum as it relies on the
Annotation Processor facility to do its work. You must enable annotation processing on your IDE if you want Jipsy to work
correctly.

Jipsy can be downloaded directly from https://bintray.com/aalmiray/kordamp/jipsy[Bintray] or configure it via Maven or Gradle.

.Maven
[subs="verbatim,attributes"]
----
<dependency>
  <groupId>org.kordamp.jipsy</groupId>
  <artifactId>jipsy</artifactId>
  <version>{revnumber}</version>
  <scope>provided</scope>
</dependency>
----

.Gradle
[subs="verbatim,attributes"]
----
configurations {
    compileOnly
}
dependencies {
    compileOnly "org.kordamp.jipsy:jipsy:{revnumber}"
}
sourceSets {
    main {
        compileClasspath += configurations.compileOnly
    }
}
// if using the idea plugin
idea {
    module {
        scopes.PROVIDED.plus += configurations.compileOnly
    }
}
----

Use the `provided` scope in order to mark Jipsy as a compile-only dependency; this also avoids exposing Jipsy to
consumers of your library.

== Origin

Jipsy is a re-implementation of the https://code.google.com/p/spi[org.mangosdk.spi] project, original by <NAME> and
<NAME>; copyrighted by TOPdesk; source distributed under Apache Software License 2.0

== Creating Your Own Processors

TBD<commit_msg>Hook in Travis badge; use custom version attr instead of revnumber<commit_after>= Jipsy
:author: <NAME>
:version: 0.1.0

image:https://travis-ci.org/aalmiray/jipsy.png?branch=master["Build Status", link="https://travis-ci.org/aalmiray/jipsy"]

image::https://d2weczhvl823v0.cloudfront.net/aalmiray/griffon2/trend.png["Bitdeli Badge", link="https://bitdeli.com/free"]

Configurable Java Annotation Processor to simplify the use of the Service Provider Interface.

== Introduction

JDK6 added a neat facility named http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html[ServiceLoader] that
enables library authors to hook in implementations using an http://en.wikipedia.org/wiki/Service_provider_interface[SPI].
As explained at the http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html[service loader documentation],
services must follow certain rules in order to be considered as such; they also must be registered using an standard location
based on a naming convention. The following rules apply to classes that may be considered services

. The class must implement at least one target interface (the service interface).
. The class must provide a no-args constructor.
. The class must be public.
. The class name should be added to a file named `META-INF/services/<target_interface_name>`

This library provides a mechanism for enforcing those rules by simply adding an annotation on each service implementation, for
example say there exists the following `Calculator` service interface

[source,java]
----
package com.acme;

public interface Calculator {
    double add(double a, double b);
}
----

A basic implementation of such service may be as follows

[source,java]
----
package com.acme;

@org.kordamp.jipsy.ServiceProviderFor(Calculator.class)
public class BasicCalculator implements Calculator {
    public double add(double a, double b) { return a + b; }
}
----

Compile your code. If you look closely at your project's output you'll see a file named
`META-INF/services/com.acme.Calculator` whose contents should look similar to

[source]
[subs="verbatim,attributes"]
----
# Generated by org.kordamp.jipsy.processor.service.ServiceProviderProcessor ({version})
# Wed, 25 Dec 2013 22:28:50 +0100
com.acme.BasicCalculator
----

Et voilà! There are no additional sources to be touched nor files to be created; Jipsy will take care of the boiler plate.

== Installing

Jipsy is package as a standalone jars with no additional dependencies. Jipsy requires JDK6 as a minimum as it relies on the
Annotation Processor facility to do its work. You must enable annotation processing on your IDE if you want Jipsy to work
correctly.

Jipsy can be downloaded directly from https://bintray.com/aalmiray/kordamp/jipsy[Bintray] or configure it via Maven or Gradle.

.Maven
[subs="verbatim,attributes"]
----
<dependency>
  <groupId>org.kordamp.jipsy</groupId>
  <artifactId>jipsy</artifactId>
  <version>{version}</version>
  <scope>provided</scope>
</dependency>
----

.Gradle
[subs="verbatim,attributes"]
----
configurations {
    compileOnly
}
dependencies {
    compileOnly "org.kordamp.jipsy:jipsy:{version}"
}
sourceSets {
    main {
        compileClasspath += configurations.compileOnly
    }
}
// if using the idea plugin
idea {
    module {
        scopes.PROVIDED.plus += configurations.compileOnly
    }
}
----

Use the `provided` scope in order to mark Jipsy as a compile-only dependency; this also avoids exposing Jipsy to
consumers of your library.

== Origin

Jipsy is a re-implementation of the https://code.google.com/p/spi[org.mangosdk.spi] project, original by <NAME> and
<NAME>; copyrighted by TOPdesk; source distributed under Apache Software License 2.0

== Creating Your Own Processors

TBD
{'fraction_non_alphanumeric': 0.09233050276317563, 'fraction_numerical': 0.00835692141798086, 'mean_word_length': 4.423976608187134, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '284517', 'n_tokens_mistral': 2270, 'n_tokens_neox': 2128, 'n_words': 796}