|
@@ -1,304 +1,109 @@
|
|
|
package net.ranides.assira.reflection;
|
|
package net.ranides.assira.reflection;
|
|
|
|
|
|
|
|
-import lombok.AllArgsConstructor;
|
|
|
|
|
-import lombok.RequiredArgsConstructor;
|
|
|
|
|
|
|
+import net.ranides.assira.reflection.impl.scanner.ScanWalker;
|
|
|
|
|
|
|
|
-import net.ranides.assira.collection.arrays.NativeArray;
|
|
|
|
|
-import net.ranides.assira.collection.lists.NativeArrayList;
|
|
|
|
|
-import net.ranides.assira.functional.special.LazyFunction;
|
|
|
|
|
-import net.ranides.assira.generic.LazyReference;
|
|
|
|
|
-
|
|
|
|
|
-import javax.swing.text.html.Option;
|
|
|
|
|
-import java.lang.reflect.Array;
|
|
|
|
|
-import java.util.IdentityHashMap;
|
|
|
|
|
import java.util.Iterator;
|
|
import java.util.Iterator;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
-import java.util.Optional;
|
|
|
|
|
-import java.util.function.Consumer;
|
|
|
|
|
|
|
+import java.util.Set;
|
|
|
import java.util.function.Predicate;
|
|
import java.util.function.Predicate;
|
|
|
-import java.util.function.Supplier;
|
|
|
|
|
|
|
|
|
|
public class ObjectScanner {
|
|
public class ObjectScanner {
|
|
|
|
|
|
|
|
- public static boolean walk(Object input, ObjectListener listener) {
|
|
|
|
|
- return new Walker(input, listener).walk();
|
|
|
|
|
|
|
+ public static void walk(Object input, Predicate<ObjectContext> visitor) {
|
|
|
|
|
+ walk(input, new SimpleListener(visitor));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @AllArgsConstructor
|
|
|
|
|
- private static class Walker {
|
|
|
|
|
-
|
|
|
|
|
- private static final Object UNDEFINED = new Object(){
|
|
|
|
|
- @Override
|
|
|
|
|
- public String toString() {
|
|
|
|
|
- return "<UNDEFINED>";
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- private final Map<Object, Integer> visited = new IdentityHashMap<>();
|
|
|
|
|
- private final int counter = 0;
|
|
|
|
|
|
|
+ public static void walk(Object input, ObjectVisitor visitor) {
|
|
|
|
|
+ walk(input, new SimpleListener(visitor));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- private final Object root;
|
|
|
|
|
|
|
+ public static void walk(Object input, ObjectListener listener) {
|
|
|
|
|
+ new ScanWalker(input, listener).walk();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- private final ObjectListener listener;
|
|
|
|
|
|
|
+ public static class SimpleListener extends AbstractObjectListener {
|
|
|
|
|
|
|
|
- public boolean walk() {
|
|
|
|
|
- return walk(null, root);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ private final ObjectVisitor visitor;
|
|
|
|
|
|
|
|
- public boolean walk(ObjectContext context, Object input) {
|
|
|
|
|
- return
|
|
|
|
|
- walkArray(context, input) ||
|
|
|
|
|
- walkList(context, input) ||
|
|
|
|
|
- walkCollection(context, input) ||
|
|
|
|
|
- walkMap(context, input) ||
|
|
|
|
|
- walkObject(context, input);
|
|
|
|
|
|
|
+ public SimpleListener(ObjectVisitor visitor) {
|
|
|
|
|
+ this.visitor = visitor;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @RequiredArgsConstructor
|
|
|
|
|
- private class CObject implements ObjectContext {
|
|
|
|
|
- private final ObjectContext parent;
|
|
|
|
|
- private final String name;
|
|
|
|
|
- private final IClass<?> type;
|
|
|
|
|
- private final Object value;
|
|
|
|
|
- private final int id;
|
|
|
|
|
-
|
|
|
|
|
- private final Optional<IField> field;
|
|
|
|
|
-
|
|
|
|
|
- private final LazyFunction<String> typePath = LazyReference.concurrent();
|
|
|
|
|
- private final LazyFunction<String> namePath = LazyReference.concurrent();
|
|
|
|
|
- private final LazyFunction<String> idPath = LazyReference.concurrent();
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public ObjectContext parent() {
|
|
|
|
|
- return parent;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public String name() {
|
|
|
|
|
- return name;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public IClass<?> type() {
|
|
|
|
|
- IClass<Object> vtype = IClass.typefor(value);
|
|
|
|
|
- return type;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public Object value() {
|
|
|
|
|
- return value;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public long id() {
|
|
|
|
|
- return id;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public long ref() {
|
|
|
|
|
- return visited.get(value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public String typePath() {
|
|
|
|
|
- return typePath.apply(() -> {
|
|
|
|
|
- if(parent == null) {
|
|
|
|
|
- return type().shortname();
|
|
|
|
|
- } else {
|
|
|
|
|
- return parent.typePath() + "." + type().shortname();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public String namePath() {
|
|
|
|
|
- return namePath.apply(() -> {
|
|
|
|
|
- if(parent == null) {
|
|
|
|
|
- return name();
|
|
|
|
|
- } else {
|
|
|
|
|
- return parent.name() + "." + name();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public String idPath() {
|
|
|
|
|
- return idPath.apply(() -> {
|
|
|
|
|
- if(parent == null) {
|
|
|
|
|
- return String.valueOf(id());
|
|
|
|
|
- } else {
|
|
|
|
|
- return parent.idPath() + "." + id();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean isRoot() {
|
|
|
|
|
- return value == root;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean isField() {
|
|
|
|
|
- return field.isPresent();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean isVisited() {
|
|
|
|
|
- return visited.containsKey(value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean isDefined() {
|
|
|
|
|
- return value == UNDEFINED;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean isPrimitive() {
|
|
|
|
|
- return type.isPrimitive();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean isNull() {
|
|
|
|
|
- return value == null;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean isSubclass() {
|
|
|
|
|
- return type.isInstance(value) && !type.equals(IClass.typefor(value));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ public SimpleListener(Predicate<ObjectContext> predicate) {
|
|
|
|
|
+ this(new AbstractObjectVisitor() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public boolean visitObject(ObjectContext value) {
|
|
|
|
|
+ return predicate.test(value);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public static ObjectListener newListener(Predicate<ObjectContext> visitor) {
|
|
|
|
|
- return newListener(new AbstractObjectVisitor() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean visitObject(ObjectContext value) {
|
|
|
|
|
- return visitor.test(value);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public static ObjectListener newListener(ObjectVisitor visitor) {
|
|
|
|
|
- return new AbstractObjectListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean enterObject(ObjectContext value) {
|
|
|
|
|
- return visitor.visitObject(value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean leaveObject(ObjectContext value) {
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean enterArray(ArrayContext value) {
|
|
|
|
|
- return visitor.visitArray(value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean enterArrayItem(ArrayItemContext value) {
|
|
|
|
|
- return visitor.visitArrayItem(value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean enterCollection(CollectionContext value) {
|
|
|
|
|
- return visitor.visitCollection(value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean enterCollectionItem(CollectionItemContext value) {
|
|
|
|
|
- return visitor.visitCollectionItem(value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean enterList(ListContext value) {
|
|
|
|
|
- return visitor.visitList(value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean enterListItem(ListItemContext value) {
|
|
|
|
|
- return visitor.visitListItem(value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean enterMap(MapContext value) {
|
|
|
|
|
- return visitor.visitMap(value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean enterMapItem(MapItemContext value) {
|
|
|
|
|
- return visitor.visitMapItem(value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public static abstract class AbstractObjectListener implements ObjectListener {
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public abstract boolean enterObject(ObjectContext value);
|
|
|
|
|
|
|
+ public boolean enterObject(ObjectContext value) {
|
|
|
|
|
+ return visitor.visitObject(value);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public abstract boolean leaveObject(ObjectContext value);
|
|
|
|
|
|
|
+ public void leaveObject(ObjectContext value) {
|
|
|
|
|
+ // do nothing
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public boolean enterArray(ArrayContext value) {
|
|
public boolean enterArray(ArrayContext value) {
|
|
|
- return enterObject(value);
|
|
|
|
|
|
|
+ return visitor.visitArray(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public boolean leaveArray(ArrayContext value) {
|
|
|
|
|
- return leaveObject(value);
|
|
|
|
|
|
|
+ public boolean enterCollection(CollectionContext value) {
|
|
|
|
|
+ return visitor.visitCollection(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public boolean enterArrayItem(ArrayItemContext value) {
|
|
|
|
|
- return enterObject(value);
|
|
|
|
|
|
|
+ public boolean enterList(ListContext value) {
|
|
|
|
|
+ return visitor.visitList(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public boolean leaveArrayItem(ArrayItemContext value) {
|
|
|
|
|
- return leaveObject(value);
|
|
|
|
|
|
|
+ public boolean enterMap(MapContext value) {
|
|
|
|
|
+ return visitor.visitMap(value);
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ public static abstract class AbstractObjectListener implements ObjectListener {
|
|
|
@Override
|
|
@Override
|
|
|
- public boolean enterCollection(CollectionContext value) {
|
|
|
|
|
- return enterObject(value);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ public abstract boolean enterObject(ObjectContext value);
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public boolean leaveCollection(CollectionContext value) {
|
|
|
|
|
- return leaveObject(value);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ public abstract void leaveObject(ObjectContext value);
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public boolean enterCollectionItem(CollectionItemContext value) {
|
|
|
|
|
|
|
+ public boolean enterArray(ArrayContext value) {
|
|
|
return enterObject(value);
|
|
return enterObject(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public boolean leaveCollectionItem(CollectionItemContext value) {
|
|
|
|
|
- return leaveObject(value);
|
|
|
|
|
|
|
+ public void leaveArray(ArrayContext value) {
|
|
|
|
|
+ leaveObject(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public boolean enterList(ListContext value) {
|
|
|
|
|
|
|
+ public boolean enterCollection(CollectionContext value) {
|
|
|
return enterObject(value);
|
|
return enterObject(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public boolean leaveList(ListContext value) {
|
|
|
|
|
- return leaveObject(value);
|
|
|
|
|
|
|
+ public void leaveCollection(CollectionContext value) {
|
|
|
|
|
+ leaveObject(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public boolean enterListItem(ListItemContext value) {
|
|
|
|
|
|
|
+ public boolean enterList(ListContext value) {
|
|
|
return enterObject(value);
|
|
return enterObject(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public boolean leaveListItem(ListItemContext value) {
|
|
|
|
|
- return leaveObject(value);
|
|
|
|
|
|
|
+ public void leaveList(ListContext value) {
|
|
|
|
|
+ leaveObject(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -307,19 +112,10 @@ public class ObjectScanner {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public boolean leaveMap(MapContext value) {
|
|
|
|
|
- return leaveObject(value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean enterMapItem(MapItemContext value) {
|
|
|
|
|
- return enterObject(value);
|
|
|
|
|
|
|
+ public void leaveMap(MapContext value) {
|
|
|
|
|
+ leaveObject(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean leaveMapItem(MapItemContext value) {
|
|
|
|
|
- return leaveObject(value);
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static abstract class AbstractObjectVisitor implements ObjectVisitor {
|
|
public static abstract class AbstractObjectVisitor implements ObjectVisitor {
|
|
@@ -332,40 +128,21 @@ public class ObjectScanner {
|
|
|
return visitObject(value);
|
|
return visitObject(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean visitArrayItem(ArrayItemContext value) {
|
|
|
|
|
- return visitObject(value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public boolean visitCollection(CollectionContext value) {
|
|
public boolean visitCollection(CollectionContext value) {
|
|
|
return visitObject(value);
|
|
return visitObject(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean visitCollectionItem(CollectionItemContext value) {
|
|
|
|
|
- return visitObject(value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public boolean visitList(ListContext value) {
|
|
public boolean visitList(ListContext value) {
|
|
|
return visitObject(value);
|
|
return visitObject(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean visitListItem(ListItemContext value) {
|
|
|
|
|
- return visitObject(value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public boolean visitMap(MapContext value) {
|
|
public boolean visitMap(MapContext value) {
|
|
|
return visitObject(value);
|
|
return visitObject(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean visitMapItem(MapItemContext value) {
|
|
|
|
|
- return visitObject(value);
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public interface ObjectVisitor {
|
|
public interface ObjectVisitor {
|
|
@@ -374,69 +151,52 @@ public class ObjectScanner {
|
|
|
|
|
|
|
|
boolean visitArray(ArrayContext value);
|
|
boolean visitArray(ArrayContext value);
|
|
|
|
|
|
|
|
- boolean visitArrayItem(ArrayItemContext value);
|
|
|
|
|
-
|
|
|
|
|
boolean visitCollection(CollectionContext value);
|
|
boolean visitCollection(CollectionContext value);
|
|
|
|
|
|
|
|
- boolean visitCollectionItem(CollectionItemContext value);
|
|
|
|
|
-
|
|
|
|
|
boolean visitList(ListContext value);
|
|
boolean visitList(ListContext value);
|
|
|
|
|
|
|
|
- boolean visitListItem(ListItemContext value);
|
|
|
|
|
-
|
|
|
|
|
boolean visitMap(MapContext value);
|
|
boolean visitMap(MapContext value);
|
|
|
|
|
|
|
|
- boolean visitMapItem(MapItemContext value);
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public interface ObjectListener {
|
|
public interface ObjectListener {
|
|
|
|
|
|
|
|
boolean enterObject(ObjectContext value);
|
|
boolean enterObject(ObjectContext value);
|
|
|
|
|
|
|
|
- boolean leaveObject(ObjectContext value);
|
|
|
|
|
|
|
+ void leaveObject(ObjectContext value);
|
|
|
|
|
|
|
|
boolean enterArray(ArrayContext value);
|
|
boolean enterArray(ArrayContext value);
|
|
|
|
|
|
|
|
- boolean leaveArray(ArrayContext value);
|
|
|
|
|
-
|
|
|
|
|
- boolean enterArrayItem(ArrayItemContext value);
|
|
|
|
|
-
|
|
|
|
|
- boolean leaveArrayItem(ArrayItemContext value);
|
|
|
|
|
|
|
+ void leaveArray(ArrayContext value);
|
|
|
|
|
|
|
|
boolean enterCollection(CollectionContext value);
|
|
boolean enterCollection(CollectionContext value);
|
|
|
|
|
|
|
|
- boolean leaveCollection(CollectionContext value);
|
|
|
|
|
-
|
|
|
|
|
- boolean enterCollectionItem(CollectionItemContext value);
|
|
|
|
|
-
|
|
|
|
|
- boolean leaveCollectionItem(CollectionItemContext value);
|
|
|
|
|
|
|
+ void leaveCollection(CollectionContext value);
|
|
|
|
|
|
|
|
boolean enterList(ListContext value);
|
|
boolean enterList(ListContext value);
|
|
|
|
|
|
|
|
- boolean leaveList(ListContext value);
|
|
|
|
|
-
|
|
|
|
|
- boolean enterListItem(ListItemContext value);
|
|
|
|
|
-
|
|
|
|
|
- boolean leaveListItem(ListItemContext value);
|
|
|
|
|
|
|
+ void leaveList(ListContext value);
|
|
|
|
|
|
|
|
boolean enterMap(MapContext value);
|
|
boolean enterMap(MapContext value);
|
|
|
|
|
|
|
|
- boolean leaveMap(MapContext value);
|
|
|
|
|
|
|
+ void leaveMap(MapContext value);
|
|
|
|
|
|
|
|
- boolean enterMapItem(MapItemContext value);
|
|
|
|
|
-
|
|
|
|
|
- boolean leaveMapItem(MapItemContext value);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public interface ObjectContext {
|
|
public interface ObjectContext {
|
|
|
|
|
|
|
|
|
|
+ void accept(ObjectListener listener);
|
|
|
|
|
+
|
|
|
ObjectContext parent();
|
|
ObjectContext parent();
|
|
|
|
|
|
|
|
|
|
+ String typeName();
|
|
|
|
|
+
|
|
|
String name();
|
|
String name();
|
|
|
|
|
|
|
|
IClass<?> type();
|
|
IClass<?> type();
|
|
|
|
|
|
|
|
|
|
+ IClass<?> actual();
|
|
|
|
|
+
|
|
|
Object value();
|
|
Object value();
|
|
|
|
|
|
|
|
long id();
|
|
long id();
|
|
@@ -490,7 +250,7 @@ public class ObjectScanner {
|
|
|
|
|
|
|
|
int size();
|
|
int size();
|
|
|
|
|
|
|
|
- Iterator<Object> iterator();
|
|
|
|
|
|
|
+ Iterator<?> iterator();
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -502,41 +262,7 @@ public class ObjectScanner {
|
|
|
|
|
|
|
|
int size();
|
|
int size();
|
|
|
|
|
|
|
|
- Iterator<Map.Entry<?, ?>> entries();
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public interface ArrayItemContext extends ObjectContext {
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- ArrayContext parent();
|
|
|
|
|
-
|
|
|
|
|
- int index();
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public interface ListItemContext extends ObjectContext {
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- ListContext parent();
|
|
|
|
|
-
|
|
|
|
|
- int index();
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public interface CollectionItemContext extends ObjectContext {
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- CollectionContext parent();
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public interface MapItemContext extends ObjectContext {
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- MapContext parent();
|
|
|
|
|
-
|
|
|
|
|
- Object key();
|
|
|
|
|
|
|
+ Set<? extends Map.Entry<?, ?>> entries();
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|