Minor stylistic changes, remove extraneous throws types
diff --git a/src/main/java/com/fasterxml/jackson/core/util/DefaultPrettyPrinter.java b/src/main/java/com/fasterxml/jackson/core/util/DefaultPrettyPrinter.java
index d787423..e80159d 100644
--- a/src/main/java/com/fasterxml/jackson/core/util/DefaultPrettyPrinter.java
+++ b/src/main/java/com/fasterxml/jackson/core/util/DefaultPrettyPrinter.java
@@ -35,7 +35,7 @@
*/
public interface Indenter
{
- void writeIndentation(JsonGenerator jg, int level) throws IOException;
+ void writeIndentation(JsonGenerator g, int level) throws IOException;
/**
* @return True if indenter is considered inline (does not add linefeeds),
@@ -245,26 +245,26 @@
*/
@Override
- public void writeRootValueSeparator(JsonGenerator jg) throws IOException
+ public void writeRootValueSeparator(JsonGenerator g) throws IOException
{
if (_rootSeparator != null) {
- jg.writeRaw(_rootSeparator);
+ g.writeRaw(_rootSeparator);
}
}
@Override
- public void writeStartObject(JsonGenerator jg) throws IOException
+ public void writeStartObject(JsonGenerator g) throws IOException
{
- jg.writeRaw('{');
+ g.writeRaw('{');
if (!_objectIndenter.isInline()) {
++_nesting;
}
}
@Override
- public void beforeObjectEntries(JsonGenerator jg) throws IOException
+ public void beforeObjectEntries(JsonGenerator g) throws IOException
{
- _objectIndenter.writeIndentation(jg, _nesting);
+ _objectIndenter.writeIndentation(g, _nesting);
}
/**
@@ -277,12 +277,12 @@
* (white-space) decoration.
*/
@Override
- public void writeObjectFieldValueSeparator(JsonGenerator jg) throws IOException
+ public void writeObjectFieldValueSeparator(JsonGenerator g) throws IOException
{
if (_spacesInObjectEntries) {
- jg.writeRaw(" : ");
+ g.writeRaw(" : ");
} else {
- jg.writeRaw(':');
+ g.writeRaw(':');
}
}
@@ -296,38 +296,38 @@
* (white-space) decoration.
*/
@Override
- public void writeObjectEntrySeparator(JsonGenerator jg) throws IOException
+ public void writeObjectEntrySeparator(JsonGenerator g) throws IOException
{
- jg.writeRaw(',');
- _objectIndenter.writeIndentation(jg, _nesting);
+ g.writeRaw(',');
+ _objectIndenter.writeIndentation(g, _nesting);
}
@Override
- public void writeEndObject(JsonGenerator jg, int nrOfEntries) throws IOException
+ public void writeEndObject(JsonGenerator g, int nrOfEntries) throws IOException
{
if (!_objectIndenter.isInline()) {
--_nesting;
}
if (nrOfEntries > 0) {
- _objectIndenter.writeIndentation(jg, _nesting);
+ _objectIndenter.writeIndentation(g, _nesting);
} else {
- jg.writeRaw(' ');
+ g.writeRaw(' ');
}
- jg.writeRaw('}');
+ g.writeRaw('}');
}
@Override
- public void writeStartArray(JsonGenerator jg) throws IOException
+ public void writeStartArray(JsonGenerator g) throws IOException
{
if (!_arrayIndenter.isInline()) {
++_nesting;
}
- jg.writeRaw('[');
+ g.writeRaw('[');
}
@Override
- public void beforeArrayValues(JsonGenerator jg) throws IOException {
- _arrayIndenter.writeIndentation(jg, _nesting);
+ public void beforeArrayValues(JsonGenerator g) throws IOException {
+ _arrayIndenter.writeIndentation(g, _nesting);
}
/**
@@ -375,7 +375,7 @@
public static final NopIndenter instance = new NopIndenter();
@Override
- public void writeIndentation(JsonGenerator jg, int level) throws IOException { }
+ public void writeIndentation(JsonGenerator g, int level) throws IOException { }
@Override
public boolean isInline() { return true; }
@@ -392,9 +392,9 @@
public static final FixedSpaceIndenter instance = new FixedSpaceIndenter();
@Override
- public void writeIndentation(JsonGenerator jg, int level) throws IOException
+ public void writeIndentation(JsonGenerator g, int level) throws IOException
{
- jg.writeRaw(' ');
+ g.writeRaw(' ');
}
@Override
diff --git a/src/main/java/com/fasterxml/jackson/core/util/MinimalPrettyPrinter.java b/src/main/java/com/fasterxml/jackson/core/util/MinimalPrettyPrinter.java
index 889d853..92b7dc2 100644
--- a/src/main/java/com/fasterxml/jackson/core/util/MinimalPrettyPrinter.java
+++ b/src/main/java/com/fasterxml/jackson/core/util/MinimalPrettyPrinter.java
@@ -2,7 +2,6 @@
import java.io.IOException;
-import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.PrettyPrinter;
@@ -32,7 +31,7 @@
* Default String used for separating root values is single space.
*/
public final static String DEFAULT_ROOT_VALUE_SEPARATOR = " ";
-
+
protected String _rootValueSeparator = DEFAULT_ROOT_VALUE_SEPARATOR;
/*
@@ -40,7 +39,7 @@
/* Life-cycle, construction, configuration
/**********************************************************
*/
-
+
public MinimalPrettyPrinter() {
this(DEFAULT_ROOT_VALUE_SEPARATOR);
}
@@ -48,11 +47,11 @@
public MinimalPrettyPrinter(String rootValueSeparator) {
_rootValueSeparator = rootValueSeparator;
}
-
+
public void setRootValueSeparator(String sep) {
_rootValueSeparator = sep;
}
-
+
/*
/**********************************************************
/* PrettyPrinter impl
@@ -60,23 +59,21 @@
*/
@Override
- public void writeRootValueSeparator(JsonGenerator jg) throws IOException, JsonGenerationException
+ public void writeRootValueSeparator(JsonGenerator g) throws IOException
{
if (_rootValueSeparator != null) {
- jg.writeRaw(_rootValueSeparator);
+ g.writeRaw(_rootValueSeparator);
}
}
-
+
@Override
- public void writeStartObject(JsonGenerator jg)
- throws IOException, JsonGenerationException
+ public void writeStartObject(JsonGenerator g) throws IOException
{
- jg.writeRaw('{');
+ g.writeRaw('{');
}
@Override
- public void beforeObjectEntries(JsonGenerator jg)
- throws IOException, JsonGenerationException
+ public void beforeObjectEntries(JsonGenerator g) throws IOException
{
// nothing special, since no indentation is added
}
@@ -89,10 +86,9 @@
* colon to separate the two, without additional spaces.
*/
@Override
- public void writeObjectFieldValueSeparator(JsonGenerator jg)
- throws IOException, JsonGenerationException
+ public void writeObjectFieldValueSeparator(JsonGenerator g) throws IOException
{
- jg.writeRaw(':');
+ g.writeRaw(':');
}
/**
@@ -103,29 +99,25 @@
* comma to separate the two.
*/
@Override
- public void writeObjectEntrySeparator(JsonGenerator jg)
- throws IOException, JsonGenerationException
+ public void writeObjectEntrySeparator(JsonGenerator g) throws IOException
{
- jg.writeRaw(',');
+ g.writeRaw(',');
}
@Override
- public void writeEndObject(JsonGenerator jg, int nrOfEntries)
- throws IOException, JsonGenerationException
+ public void writeEndObject(JsonGenerator g, int nrOfEntries) throws IOException
{
- jg.writeRaw('}');
+ g.writeRaw('}');
}
@Override
- public void writeStartArray(JsonGenerator jg)
- throws IOException, JsonGenerationException
+ public void writeStartArray(JsonGenerator g) throws IOException
{
- jg.writeRaw('[');
+ g.writeRaw('[');
}
@Override
- public void beforeArrayValues(JsonGenerator jg)
- throws IOException, JsonGenerationException
+ public void beforeArrayValues(JsonGenerator g) throws IOException
{
// nothing special, since no indentation is added
}
@@ -138,16 +130,14 @@
* comma to separate values.
*/
@Override
- public void writeArrayValueSeparator(JsonGenerator jg)
- throws IOException, JsonGenerationException
+ public void writeArrayValueSeparator(JsonGenerator g) throws IOException
{
- jg.writeRaw(',');
+ g.writeRaw(',');
}
@Override
- public void writeEndArray(JsonGenerator jg, int nrOfValues)
- throws IOException, JsonGenerationException
+ public void writeEndArray(JsonGenerator g, int nrOfValues) throws IOException
{
- jg.writeRaw(']');
+ g.writeRaw(']');
}
}