Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ladutsko/isbn-core
ISBN core
https://github.com/ladutsko/isbn-core
isbn osgi
Last synced: about 1 month ago
JSON representation
ISBN core
- Host: GitHub
- URL: https://github.com/ladutsko/isbn-core
- Owner: ladutsko
- License: mit
- Created: 2013-08-26T15:41:52.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-04-05T13:26:23.000Z (2 months ago)
- Last Synced: 2024-04-05T14:32:59.394Z (2 months ago)
- Topics: isbn, osgi
- Language: Java
- Size: 289 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Lists
- awesome-java - ISBN core - A small library that contains a representation object of ISBN-10 and ISBN-13 and tools to parse, validate and format one. (Projects / Miscellaneous)
README
# ISBN core ![Main CI](https://github.com/ladutsko/isbn-core/actions/workflows/main.yml/badge.svg) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.ladutsko/isbn-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.ladutsko/isbn-core) [![javadoc](https://javadoc.io/badge2/com.github.ladutsko/isbn-core/javadoc.svg)](https://javadoc.io/doc/com.github.ladutsko/isbn-core)
`ISBN core` is a small library that contains a representation object of ISBN-10 and ISBN-13 and
tools to parse, validate and format one.
* Java 1.5+
* OSGi compatible
* GraalVM compatible```xml
com.github.ladutsko
isbn-core
1.5.1```
```groovy
implementation 'com.github.ladutsko:isbn-core:1.5.1'
```## Quick start
```java
import com.github.ladutsko.isbn.ISBN;
import com.github.ladutsko.isbn.ISBNException;
import com.github.ladutsko.isbn.ISBNFormat;class HelloWorld {
public static void main(String[] args) {
try {
ISBN isbn = ISBN.parseIsbn("0131872486"); // or 978-0131872486
// Valid isbn string
ISBNFormat format = new ISBNFormat();
System.out.println(format.format(isbn.getIsbn10())); // output: 0-13-187248-6
System.out.println(format.format(isbn.getIsbn13())); // output: 978-0-13-187248-6
} catch (ISBNException e) {
// Invalid isbn string
e.printStackTrace(); // Reason
}
}
}
```