Top Description Fields Constructors Methods
com.github.javaparser.printer.lexicalpreservation

pack-priv Class PhantomNodeLogic

extends Object
Class Inheritance
Imports
com.github.javaparser.ast.Node, com.github.javaparser.ast.observer.AstObserver, .AstObserverAdapter, com.github.javaparser.ast.type.UnknownType, java.util.IdentityHashMap, .Map

We want to recognize and ignore "phantom" nodes, like the fake type of variable in FieldDeclaration

Field Summary

Modifier and TypeField and Description
private static final AstObserver
private static final Map<Node, Boolean>
private static final int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static boolean
inPhantomNode(Node node, int levels)

A node contained in a phantom node is also a phantom node.

pack-priv static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheCleanerback to summary
private static final AstObserver cacheCleaner
isPhantomNodeCacheback to summary
private static final Map<Node, Boolean> isPhantomNodeCache
LEVELS_TO_EXPLOREback to summary
private static final int LEVELS_TO_EXPLORE

Constructor Detail

PhantomNodeLogicback to summary
pack-priv PhantomNodeLogic()

Method Detail

inPhantomNodeback to summary
private static boolean inPhantomNode(Node node, int levels)

A node contained in a phantom node is also a phantom node. We limit how many levels up we check just for performance reasons.

isPhantomNodeback to summary
pack-priv static boolean isPhantomNode(Node node)