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

add propertyNamesSpliterator #1369

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions src/main/java/tools/jackson/core/TreeNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package tools.jackson.core;

import java.util.Iterator;
import java.util.Spliterator;

/**
* Marker interface used to denote JSON Tree nodes, as far as
Expand Down Expand Up @@ -227,6 +228,17 @@ public interface TreeNode
*/
Iterator<String> propertyNames();

/**
* Method for accessing names of all properties for this node via a <code>Spliterator</code> ,
* if (and only if) this node is an Object node. Number of property names accessible
* will be {@link #size}.
*
* @return A <code>Spliterator</code> for traversing names of all properties this Object node
* has (if Object node); empty {@link Spliterator} otherwise (never {@code null}).
* @since 3.0
*/
Spliterator<String> propertyNamesSpliterator();

/**
* Method for locating node specified by given JSON pointer instances.
* Method will never return null; if no matching node exists,
Expand Down
6 changes: 6 additions & 0 deletions src/test/java/tools/jackson/core/util/DelegatesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Iterator;
import java.util.Spliterator;

import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -96,6 +97,11 @@ public Iterator<String> propertyNames() {
return null;
}

@Override
public Spliterator<String> propertyNamesSpliterator() {
return null;
}

@Override
public TreeNode at(JsonPointer ptr) {
return null;
Expand Down