Skip to content
This repository was archived by the owner on Nov 21, 2024. It is now read-only.

Commit a79fd46

Browse files
author
Kato Shinya
committed
add interface
1 parent 24a2195 commit a79fd46

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2021 Kato Shinya.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
* in compliance with the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License
10+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11+
* or implied. See the License for the specific language governing permissions and limitations under
12+
* the License.
13+
*/
14+
15+
package org.thinkit.formatter.json;
16+
17+
import lombok.NonNull;
18+
19+
/**
20+
* 整形処理を行うフォーマッターを抽象化したインターフェースです。 {@link Formatter} インターフェースを実装する具象クラスは
21+
* {@link Formatter#format(String)} メソッドを必ず実装してください。
22+
*
23+
* @author Kato Shinya
24+
* @since 1.0.0
25+
*/
26+
public interface Formatter {
27+
28+
/**
29+
* 引数として渡された {@code unformatted} に格納された文字列を整形し返却します。
30+
*
31+
* @param rawJson 整形されていないJSON文字列
32+
* @return 整形された文字列
33+
*
34+
* @exception NullPointerException 引数として {@code null} が渡された場合
35+
*/
36+
public String format(@NonNull final String rawJson);
37+
}

src/main/java/org/thinkit/formatter/json/JsonFormatter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
package org.thinkit.formatter.json;
1616

17-
import org.thinkit.formatter.common.Formatter;
1817
import org.thinkit.formatter.common.Tokenizable;
1918
import org.thinkit.formatter.json.catalog.Brace;
2019
import org.thinkit.formatter.json.catalog.Bracket;

0 commit comments

Comments
 (0)