Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2 update README.md - for oleg #2

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1891,30 +1891,7 @@ final class JacksonFactory {
* json framework
*/
public static JacksonEngine createPrettyPrintJsonEngine(JsonSettings settings) {
}
}
```

### `StaticJsonEngineFactory`

The full name of this class is `ru.olegcherednik.json.impl.StaticJsonEngineFactory`. This is an implementation of
the `JsonEngineFactory` interface. `json-api` does not scan the whole project for the factory class, it just tries to
find the one with predefined name. So this is an entry point to the implementation.

```java
// TODO the package name is predefined
package ru.olegcherednik.json.impl;

public final class StaticJsonEngineFactory implements JsonEngineFactory {

private static final StaticJsonEngineFactory INSTANCE = new StaticJsonEngineFactory();

/*
* Mandatory method.
*
* Retrieves a singleton instance of the factory. The method must have the
* signature like this. Do not change it!
*
* @return not `null` singleton instance of the factory
*/
public static StaticJsonEngineFactory getInstance() {
Expand All @@ -1941,18 +1918,6 @@ public final class StaticJsonEngineFactory implements JsonEngineFactory {
return JacksonFactory.createJsonEngine(settings);
}

@Override
public JsonEngine createPrettyPrintJsonEngine(JsonSettings settings) {
return JacksonFactory.createPrettyPrintJsonEngine(settings);
}
}
```

There are two main classes. All other code of the implementation is under your control. As an example you can use any
of existed implementations, e.g. [json-jackson-impl](https://github.com/oleg-cherednik/json-jackson-impl)
or [json-gson-impl](https://github.com/oleg-cherednik/json-gson-impl).

## Links

* Home page: <https://github.com/oleg-cherednik/json-api>
* Maven:
Expand Down