Skip to content

Commit

Permalink
Fix all Javadoc problems
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed May 10, 2024
1 parent 3ef1335 commit 46adc63
Show file tree
Hide file tree
Showing 13 changed files with 197 additions and 60 deletions.
128 changes: 128 additions & 0 deletions src/main/java/tools/jackson/core/JsonGenerator.java

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/main/java/tools/jackson/core/JsonToken.java
Expand Up @@ -223,6 +223,10 @@ public enum JsonToken
/**
* Helper method for constructing description like "Object value" given
* {@link JsonToken} encountered.
*
* @param t Token to get description for
*
* @return Description for token
*/
public static String valueDescFor(JsonToken t) {
if (t == null) {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/tools/jackson/core/TokenStreamFactory.java
Expand Up @@ -252,6 +252,8 @@ public static int collectDefaults() {
* factory instance.
*
* @param src StreamReadConstraints to use with parsers factory creates
* @param swc StreamWriteConstraints to use with generators factory creates
* @param erc ErrorReportConfiguration to use with parsers factory creates
* @param formatReadFeatures Bitmask of format-specific read features enabled
* @param formatWriteFeatures Bitmask of format-specific write features enabled
*/
Expand Down Expand Up @@ -1222,6 +1224,8 @@ public BufferRecycler _getBufferRecycler()
/**
* Accessor for getting access to {@link RecyclerPool} for getting
* {@link BufferRecycler} instance to use.
*
* @return RecyclerPool configured for (and used by) this factory.
*/
public RecyclerPool<BufferRecycler> _getRecyclerPool() {
return _recyclerPool;
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/tools/jackson/core/base/ParserBase.java
Expand Up @@ -910,6 +910,8 @@ protected BigInteger _convertBigDecimalToBigInteger(BigDecimal bigDec) {
/**
* Internal accessor that needs to be used for accessing number value of type
* {@link BigInteger} which -- as of 2.14 -- is typically lazily parsed.
*
* @return BigInteger value decoded or converted for the current event
*/
protected BigInteger _getBigInteger() {
if (_numberBigInt != null) {
Expand All @@ -932,6 +934,8 @@ protected BigInteger _getBigInteger() {
/**
* Internal accessor that needs to be used for accessing number value of type
* {@link BigDecimal} which -- as of 2.14 -- is typically lazily parsed.
*
* @return BigDecimal value decoded or converted for the current event
*/
protected BigDecimal _getBigDecimal() {
if (_numberBigDecimal != null) {
Expand All @@ -954,6 +958,8 @@ protected BigDecimal _getBigDecimal() {
/**
* Internal accessor that needs to be used for accessing number value of type
* {@code double} which will be lazily parsed.
*
* @return {@code double} value decoded or converted for the current event
*/
protected double _getNumberDouble() {
if (_numberString != null) {
Expand All @@ -972,6 +978,8 @@ protected double _getNumberDouble() {
* Internal accessor that needs to be used for accessing number value of type
* {@code float} which will be lazily parsed.
*
* @return {@code float} value decoded or converted for the current event
*
* @since 2.15
*/
protected float _getNumberFloat() {
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/tools/jackson/core/base/ParserMinimalBase.java
Expand Up @@ -320,6 +320,8 @@ public void close() throws JacksonException
/**
* Abstract method for sub-classes to implement; to be called by
* {@link #close()} implementation here.
*
* @throws IOException from underlying input source if thrown
*/
protected abstract void _closeInput() throws IOException;

Expand Down Expand Up @@ -860,8 +862,12 @@ protected void _decodeBase64(String str, ByteArrayBuilder builder, Base64Variant
* In case of JSON this also includes invalid forms like positive sign and
* leading zeroes.
*
* @param <T> Nominal type parameter for bogus return value
* @param msg Base exception message to use
*
* @return Nothing: never returns; declared so caller can use fake return
* to keep compiler happy
*
* @throws StreamReadException Exception that describes problem with number validity
*/
protected <T> T _reportInvalidNumber(String msg) throws StreamReadException {
Expand Down
Expand Up @@ -54,7 +54,7 @@ public JsonPointerBasedFilter(JsonPointer pathToMatch, boolean includeAllElement
* @param includeAllElements Whether to just include all array elements
* of matching Array-valued path automatically
*
* @since 2.16
* @return Filter constructed
*/
protected JsonPointerBasedFilter construct(JsonPointer pathToMatch, boolean includeAllElements) {
return new JsonPointerBasedFilter(pathToMatch, includeAllElements);
Expand Down
30 changes: 20 additions & 10 deletions src/main/java/tools/jackson/core/io/BigDecimalParser.java
Expand Up @@ -5,8 +5,8 @@
import java.math.BigDecimal;

/**
* Internal Jackson Helper class used to implement more optimized parsing of {@link BigDecimal} for REALLY
* big values (over 500 characters).
* Internal Jackson Helper class used to implement more optimized parsing of
* {@link BigDecimal} for REALLY big values (over 500 characters).
*<p>
* This class is not meant to be used directly. It is designed to be used by Jackson JSON parsers (and parsers
* for other Jackson supported data formats). The parsers check for invalid characters and the length of the number.
Expand All @@ -32,9 +32,11 @@ private BigDecimalParser() {}
* of {@link BigDecimal} value: parsers in {@code jackson-core} do that; other
* code must do the same.
*
* @param valueStr
* @param valueStr Value to parse
*
* @return BigDecimal value
* @throws NumberFormatException
*
* @throws NumberFormatException for decoding failures
*/
public static BigDecimal parse(String valueStr) {
return parse(valueStr.toCharArray());
Expand All @@ -47,8 +49,13 @@ public static BigDecimal parse(String valueStr) {
* of {@link BigDecimal} value: parsers in {@code jackson-core} do that; other
* code must do the same.
*
* @param chars Buffer that contains value to parse
* @param off Offset of the first character to decode
* @param len Length of value to parse in buffer
*
* @return BigDecimal value
* @throws NumberFormatException
*
* @throws NumberFormatException for decoding failures
*/
public static BigDecimal parse(final char[] chars, final int off, final int len) {
try {
Expand All @@ -71,9 +78,9 @@ public static BigDecimal parse(final char[] chars, final int off, final int len)
* of {@link BigDecimal} value: parsers in {@code jackson-core} do that; other
* code must do the same.
*
* @param chars
* @param chars Value to parse
* @return BigDecimal value
* @throws NumberFormatException
* @throws NumberFormatException for decoding failures
*/
public static BigDecimal parse(char[] chars) {
return parse(chars, 0, chars.length);
Expand All @@ -86,9 +93,11 @@ public static BigDecimal parse(char[] chars) {
* of {@link BigDecimal} value: parsers in {@code jackson-core} do that; other
* code must do the same.
*
* @param valueStr
* @param valueStr Value to parse
*
* @return BigDecimal value
* @throws NumberFormatException
*
* @throws NumberFormatException for decoding failures
*/
public static BigDecimal parseWithFastParser(final String valueStr) {
try {
Expand All @@ -106,7 +115,8 @@ public static BigDecimal parseWithFastParser(final String valueStr) {
* code must do the same.
*
* @return BigDecimal value
* @throws NumberFormatException
*
* @throws NumberFormatException for decoding failures
*/
public static BigDecimal parseWithFastParser(final char[] ch, final int off, final int len) {
try {
Expand Down
36 changes: 1 addition & 35 deletions src/main/java/tools/jackson/core/io/ContentReference.java
Expand Up @@ -68,9 +68,7 @@ public class ContentReference
protected final boolean _isContentTextual;

/**
* max raw content to return as configured
*
* @since 2.16
* Max raw content to return as configured
*/
protected final int _maxRawContentLength;

Expand All @@ -80,17 +78,11 @@ public class ContentReference
/**********************************************************************
*/

/**
* @since 2.16
*/
protected ContentReference(boolean isContentTextual, Object rawContent, ErrorReportConfiguration errorReportConfiguration)
{
this(isContentTextual, rawContent, -1, -1, errorReportConfiguration);
}

/**
* @since 2.16
*/
protected ContentReference(boolean isContentTextual, Object rawContent,
int offset, int length, ErrorReportConfiguration errorReportConfiguration)
{
Expand Down Expand Up @@ -119,43 +111,17 @@ public static ContentReference unknown() {
*
* @return Placeholder instance to use in cases where reference is explicitly
* blocked, usually for security reasons.
*
* @since 2.16
*/
public static ContentReference redacted() {
return REDACTED_CONTENT;
}


/**
* @deprecated Since 2.16. Use {@link #construct(boolean, Object, ErrorReportConfiguration)} instead.
*/
@Deprecated
public static ContentReference construct(boolean isContentTextual, Object rawContent) {
return new ContentReference(isContentTextual, rawContent, ErrorReportConfiguration.defaults());
}

/**
* @deprecated Since 2.16. Use {@link #construct(boolean, Object, int, int, ErrorReportConfiguration)} instead.
*/
@Deprecated
public static ContentReference construct(boolean isContentTextual, Object rawContent,
int offset, int length) {
return new ContentReference(isContentTextual, rawContent, offset, length, ErrorReportConfiguration.defaults());
}

/**
* @since 2.16
*/
public static ContentReference construct(boolean isContentTextual, Object rawContent,
int offset, int length, ErrorReportConfiguration errorReportConfiguration)
{
return new ContentReference(isContentTextual, rawContent, offset, length, errorReportConfiguration);
}

/**
* @since 2.16
*/
public static ContentReference construct(boolean isContentTextual, Object rawContent,
ErrorReportConfiguration errorReportConfiguration)
{
Expand Down
Expand Up @@ -191,7 +191,7 @@ public byte[] toByteArray()
* clear state; returns buffer(s) to {@link BufferRecycler} configured,
* if any, and returns output to caller.
*
* @since 2.17
* @return Byte array with built contents
*/
public byte[] getClearAndRelease()
{
Expand Down
20 changes: 16 additions & 4 deletions src/main/java/tools/jackson/core/util/DefaultPrettyPrinter.java
Expand Up @@ -110,12 +110,18 @@ public interface Indenter
/**********************************************************************
*/

/**
* Default constructor for "vanilla" instance with default settings.
*/
public DefaultPrettyPrinter() {
this(DEFAULT_SEPARATORS);
}

/**
* @since 2.16
* Default constructor for "vanilla" instance with default settings,
* except for {@link Separators} overrides.
*
* @param separators Custom separator definition over defaults.
*/
public DefaultPrettyPrinter(Separators separators)
{
Expand All @@ -131,9 +137,9 @@ public DefaultPrettyPrinter(Separators separators)
}

/**
* Copy constructor
*
* @since 2.16
* Copy constructor.
*
* @param base DefaultPrettyPrinter being copied
*/
public DefaultPrettyPrinter(DefaultPrettyPrinter base) {
_arrayIndenter = base._arrayIndenter;
Expand All @@ -149,6 +155,12 @@ public DefaultPrettyPrinter(DefaultPrettyPrinter base) {
_arrayEmptySeparator = base._arrayEmptySeparator;
}

/**
* Copy constructor with override
*
* @param base DefaultPrettyPrinter being copied
* @param separators Separators to use instead of ones {@code base} had
*/
public DefaultPrettyPrinter(DefaultPrettyPrinter base, Separators separators) {
_arrayIndenter = base._arrayIndenter;
_objectIndenter = base._objectIndenter;
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/tools/jackson/core/util/RecyclerPool.java
Expand Up @@ -25,10 +25,6 @@
* <li>{@link BoundedPoolBase} is "bounded pool" and retains at most N objects (default value being
* {@link BoundedPoolBase#DEFAULT_CAPACITY}) at any given time.
* </li>
* <li>Two implementations -- {@link ConcurrentDequePoolBase}, {@link LockFreePoolBase}
* -- are "unbounded" and retain any number of objects released: in practice
* it is at most the highest number of concurrently used {@link BufferRecycler}s.
* </li>
*</ul>
*
*<p>
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/tools/jackson/core/util/Separators.java
Expand Up @@ -84,6 +84,10 @@ public Separators() {
/**
* Constructor for creating an instance with default settings for all
* separators.
*
* @param objectNameValueSeparator Separator between Object property name and value
* @param objectEntrySeparator Separator between name-value entries in Object
* @param arrayElementSeparator Separator between Array elements
*/
public Separators(
char objectNameValueSeparator,
Expand All @@ -96,9 +100,6 @@ public Separators(
arrayElementSeparator, Spacing.NONE, DEFAULT_ARRAY_EMPTY_SEPARATOR);
}

/**
* Create an instance with the specified separator characters and spaces around those characters.
*/
public Separators(
String rootSeparator,
char objectNameValueSeparator,
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/tools/jackson/core/util/TextBuffer.java
Expand Up @@ -363,7 +363,8 @@ private void clearSegments()
*/

/**
* @since 2.17
* @return BufferRecycler this buffer uses when it needs to release underlying
* encoding buffer(s).
*/
public BufferRecycler bufferRecycler() {
return _allocator;
Expand Down Expand Up @@ -652,7 +653,8 @@ public long contentsAsLong(boolean neg) {
*
* @return Number of characters written (same as {@link #size()})
*
* @throws JacksonException If write using {@link Writer} parameter fails
* @throws IOException if the write using given {@code Writer} fails (exception
* that {@code Writer} throws)
*/
public int contentsToWriter(Writer w) throws IOException, JacksonException
{
Expand Down

0 comments on commit 46adc63

Please sign in to comment.