Skip to content

Commit

Permalink
Merge pull request #21 from Norconex/feature/json-schema
Browse files Browse the repository at this point in the history
New Configurable interface + Jackson now 2.15.2.
  • Loading branch information
essiembre authored Aug 14, 2023
2 parents 95fcf1c + f9cf19e commit 248cfbe
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
New XMLAdapters class to add JAXB support for the same type offered
by GenericConverter.
</action>
<action dev="essiembre" type="add">
New Configurable interface.
</action>
<action dev="essiembre" type="update">
Now require Java 17+.
</action>
Expand Down
7 changes: 5 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<commons-text.version>1.10.0</commons-text.version>
<java-cup.version>10k</java-cup.version>
<json.version>1.8</json.version>
<jackson.version>2.15.0</jackson.version>
<jackson.version>2.15.2</jackson.version>
<log4j.version>2.20.0</log4j.version>
<okhttp3.version>4.10.0</okhttp3.version>
<slf4j.version>2.0.7</slf4j.version>
Expand Down Expand Up @@ -82,6 +82,7 @@
</repositories>

<dependencies>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down Expand Up @@ -201,13 +202,15 @@
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>

<!-- Jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
<scope>provided</scope>
</dependency>

<!-- okhttp/mockwebserver used to test Certificateutil -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
Expand Down
31 changes: 31 additions & 0 deletions src/main/java/com/norconex/commons/lang/config/Configurable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* Copyright 2023 Norconex Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.norconex.commons.lang.config;

/**
* The implementing class can be configured via the object returned
* by {@link #getConfiguration()}.
* Provides a consistent way to obtain a file configuration dynamically.
* Could be useful for object mapping, for instance.
* @param <T> The configuration class type
* @since 3.0.0
*/
public interface Configurable<T> {
/**
* Gets the configuration for a configurable object.
* @return configuration
*/
T getConfiguration();
}

0 comments on commit 248cfbe

Please sign in to comment.