Class JavaElementDelta
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.SimpleDelta
org.aspectj.org.eclipse.jdt.internal.core.JavaElementDelta
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class org.aspectj.org.eclipse.jdt.internal.core.SimpleDelta
changeFlags, kindFields inherited from interface org.aspectj.org.eclipse.jdt.core.IJavaElementDelta
ADDED, CHANGED, F_ADDED_TO_CLASSPATH, F_ANNOTATIONS, F_ARCHIVE_CONTENT_CHANGED, F_AST_AFFECTED, F_CATEGORIES, F_CHILDREN, F_CLASSPATH_ATTRIBUTES, F_CLASSPATH_CHANGED, F_CLASSPATH_REORDER, F_CLOSED, F_CONTENT, F_FINE_GRAINED, F_MODIFIERS, F_MOVED_FROM, F_MOVED_TO, F_OPENED, F_PRIMARY_RESOURCE, F_PRIMARY_WORKING_COPY, F_REMOVED_FROM_CLASSPATH, F_REORDER, F_RESOLVED_CLASSPATH_CHANGED, F_SOURCEATTACHED, F_SOURCEDETACHED, F_SUPER_TYPES, REMOVED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAffectedChild(JavaElementDelta child) Adds the child delta to the collection of affected children.voidadded(IJavaElement element) Creates the nested deltas resulting from an add operation.voidadded(IJavaElement element, int flags) protected voidaddNewChild(JavaElementDelta child) Adds the new child delta to the collection of affected children.protected voidaddResourceDelta(org.eclipse.core.resources.IResourceDelta child) Adds the child delta to the collection of affected children.changed(IJavaElement element, int changeFlag) Creates the nested deltas resulting from a change operation.voidchangedAST(CompilationUnit changedAST) protected voidClears the collection of affected children.voidclosed(IJavaElement element) Creates the nested deltas for a closed element.voidMark this delta as a content changed delta.protected JavaElementDeltacreateDeltaTree(IJavaElement element, JavaElementDelta delta) Creates the nested delta deltas based on the affected element its delta, and the root of this delta tree.protected static booleanReturns whether the two java elements are equals and have the same parent.protected JavaElementDeltafind(IJavaElement e) Returns theJavaElementDeltafor the given element in the delta tree, or null, if no delta for the given element is found.protected JavaElementDeltaReturns the descendant delta for the given key, ornull, if no delta for the given key is found in the delta tree below this delta.voidMark this delta as a fine-grained delta.Returns deltas for the children that have been added.Returns deltas for the affected (added, removed, or changed) children.Returns deltas for affected annotations (added, removed, or changed).Returns deltas for the children which have changed.protected IntegerReturns the index of the delta in the collection of affected children, ornullif the child delta for the given key is not found.protected IJavaElementDelta[]getChildrenOfType(int type) Returns deltas for affected attributes (added, removed, or changed).Returns the compilation unit AST created by the last reconcile operation on this delta's element.protected JavaElementDeltagetDeltaFor(IJavaElement element) Returns the delta for a given element.Returns the element that this delta describes a change to.Returns an element describing this element before it was moved to its current location, ornullif theIJavaElementDelta.F_MOVED_FROMchange flag is not set.Returns an element describing this element in its new location, ornullif theIJavaElementDelta.F_MOVED_TOchange flag is not set.Returns deltas for the children which have been removed.org.eclipse.core.resources.IResourceDelta[]Return the collection of resource deltas.protected IJavaElementDelta[]growAndAddToArray(IJavaElementDelta[] array, IJavaElementDelta addition) Adds the new element to a new array that contains all of the elements of the old array.protected voidinsertDeltaTree(IJavaElement element, JavaElementDelta delta) Creates the delta tree for the given element and delta, and then inserts the tree as an affected child of this node.voidmovedFrom(IJavaElement movedFromElement, IJavaElement movedToElement) Creates the nested deltas resulting from an move operation.voidmovedTo(IJavaElement movedToElement, IJavaElement movedFromElement) Creates the nested deltas resulting from an move operation.voidopened(IJavaElement element) Creates the nested deltas for an opened element.protected voidRemoves the child delta from the collection of affected children.protected IJavaElementDelta[]removeAndShrinkArray(IJavaElementDelta[] old, int index) Removes the element from the array.voidremoved(IJavaElement element) Creates the nested deltas resulting from an delete operation.voidremoved(IJavaElement element, int flags) protected voidremoveExistingChild(JavaElementDelta.Key key, int index) Removes the existing child delta from the collection of affected children.voidsourceAttached(IJavaElement element) Creates the nested deltas resulting from a change operation.voidsourceDetached(IJavaElement element) Creates the nested deltas resulting from a change operation.toDebugString(int depth) Returns a string representation of this delta's structure suitable for debug purposes.protected booleantoDebugString(StringBuilder buffer, int flags) toString()Returns a string representation of this delta's structure suitable for debug purposes.Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.SimpleDelta
added, changed, getFlags, getKind, modifiers, removed, superTypes, toDebugStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.aspectj.org.eclipse.jdt.core.IJavaElementDelta
getFlags, getKind
-
Field Details
-
ignoreFromTests
public boolean ignoreFromTests
-
-
Constructor Details
-
JavaElementDelta
Creates the root delta. To create the nested delta hierarchies use the following convenience methods. The root delta can be created at any level (for example: project, package root, package fragment...).added(IJavaElement)changed(IJavaElement)moved(IJavaElement, IJavaElement)removed(IJavaElement)renamed(IJavaElement, IJavaElement)
-
-
Method Details
-
addAffectedChild
Adds the child delta to the collection of affected children. If the child is already in the collection, walk down the hierarchy. -
added
Creates the nested deltas resulting from an add operation. Convenience method for creating add deltas. The constructor should be used to create the root delta and then an add operation should call this method. -
added
-
addNewChild
Adds the new child delta to the collection of affected children. -
addResourceDelta
protected void addResourceDelta(org.eclipse.core.resources.IResourceDelta child) Adds the child delta to the collection of affected children. If the child is already in the collection, walk down the hierarchy. -
changed
Creates the nested deltas resulting from a change operation. Convenience method for creating change deltas. The constructor should be used to create the root delta and then a change operation should call this method. -
changedAST
-
clearAffectedChildren
protected void clearAffectedChildren()Clears the collection of affected children. -
contentChanged
public void contentChanged()Mark this delta as a content changed delta. -
closed
Creates the nested deltas for a closed element. -
createDeltaTree
Creates the nested delta deltas based on the affected element its delta, and the root of this delta tree. Returns the root of the created delta tree. -
equalsAndSameParent
Returns whether the two java elements are equals and have the same parent. -
find
Returns theJavaElementDeltafor the given element in the delta tree, or null, if no delta for the given element is found. -
findDescendant
Returns the descendant delta for the given key, ornull, if no delta for the given key is found in the delta tree below this delta. -
fineGrained
public void fineGrained()Mark this delta as a fine-grained delta. -
getAddedChildren
Description copied from interface:IJavaElementDeltaReturns deltas for the children that have been added.- Specified by:
getAddedChildrenin interfaceIJavaElementDelta- Returns:
- deltas for the children that have been added
- See Also:
-
getAffectedChildren
Description copied from interface:IJavaElementDeltaReturns deltas for the affected (added, removed, or changed) children.- Specified by:
getAffectedChildrenin interfaceIJavaElementDelta- Returns:
- deltas for the affected (added, removed, or changed) children
- See Also:
-
getCompilationUnitAST
Description copied from interface:IJavaElementDeltaReturns the compilation unit AST created by the last reconcile operation on this delta's element. This returns a non-null value if and only if:- the last reconcile operation on this working copy requested an AST
- this delta's element is an
ICompilationUnitin working copy mode - the delta comes from a
ElementChangedEvent.POST_RECONCILEevent
- Specified by:
getCompilationUnitASTin interfaceIJavaElementDelta- Returns:
- the AST created during the last reconcile operation
- See Also:
-
getAnnotationDeltas
Description copied from interface:IJavaElementDeltaReturns deltas for affected annotations (added, removed, or changed). Returns an empty array if no annotations was affected, or if this delta's element is not anIAnnotatable.- Specified by:
getAnnotationDeltasin interfaceIJavaElementDelta- Returns:
- deltas for affected annotations (added, removed, or changed)
-
getChangedChildren
Description copied from interface:IJavaElementDeltaReturns deltas for the children which have changed.- Specified by:
getChangedChildrenin interfaceIJavaElementDelta- Returns:
- deltas for the children which have changed
- See Also:
-
getChildIndex
Returns the index of the delta in the collection of affected children, ornullif the child delta for the given key is not found. -
getChildrenOfType
- See Also:
-
getDeltaFor
Returns the delta for a given element. Only looks below this delta. -
getElement
Description copied from interface:IJavaElementDeltaReturns the element that this delta describes a change to.- Specified by:
getElementin interfaceIJavaElementDelta- Returns:
- the element that this delta describes a change to
- See Also:
-
getMovedFromElement
Description copied from interface:IJavaElementDeltaReturns an element describing this element before it was moved to its current location, ornullif theIJavaElementDelta.F_MOVED_FROMchange flag is not set.- Specified by:
getMovedFromElementin interfaceIJavaElementDelta- Returns:
- an element describing this element before it was moved
to its current location, or
nullif theIJavaElementDelta.F_MOVED_FROMchange flag is not set - See Also:
-
getMovedToElement
Description copied from interface:IJavaElementDeltaReturns an element describing this element in its new location, ornullif theIJavaElementDelta.F_MOVED_TOchange flag is not set.- Specified by:
getMovedToElementin interfaceIJavaElementDelta- Returns:
- an element describing this element in its new location,
or
nullif theIJavaElementDelta.F_MOVED_TOchange flag is not set - See Also:
-
getRemovedChildren
Description copied from interface:IJavaElementDeltaReturns deltas for the children which have been removed.- Specified by:
getRemovedChildrenin interfaceIJavaElementDelta- Returns:
- deltas for the children which have been removed
- See Also:
-
getResourceDeltas
public org.eclipse.core.resources.IResourceDelta[] getResourceDeltas()Return the collection of resource deltas. Return null if none.- Specified by:
getResourceDeltasin interfaceIJavaElementDelta- Returns:
- the underlying resource deltas, or
nullif none
-
growAndAddToArray
protected IJavaElementDelta[] growAndAddToArray(IJavaElementDelta[] array, IJavaElementDelta addition) Adds the new element to a new array that contains all of the elements of the old array. Returns the new array. -
insertDeltaTree
Creates the delta tree for the given element and delta, and then inserts the tree as an affected child of this node. -
movedFrom
Creates the nested deltas resulting from an move operation. Convenience method for creating the "move from" delta. The constructor should be used to create the root delta and then the move operation should call this method. -
movedTo
Creates the nested deltas resulting from an move operation. Convenience method for creating the "move to" delta. The constructor should be used to create the root delta and then the move operation should call this method. -
opened
Creates the nested deltas for an opened element. -
removeAffectedChild
Removes the child delta from the collection of affected children. -
removeAndShrinkArray
Removes the element from the array. Returns the a new array which has shrunk. -
removed
Creates the nested deltas resulting from an delete operation. Convenience method for creating removed deltas. The constructor should be used to create the root delta and then the delete operation should call this method. -
removed
-
removeExistingChild
Removes the existing child delta from the collection of affected children. -
sourceAttached
Creates the nested deltas resulting from a change operation. Convenience method for creating change deltas. The constructor should be used to create the root delta and then a change operation should call this method. -
sourceDetached
Creates the nested deltas resulting from a change operation. Convenience method for creating change deltas. The constructor should be used to create the root delta and then a change operation should call this method. -
toDebugString
Returns a string representation of this delta's structure suitable for debug purposes.- See Also:
-
toDebugString
- Overrides:
toDebugStringin classSimpleDelta
-
toString
Returns a string representation of this delta's structure suitable for debug purposes.- Overrides:
toStringin classSimpleDelta
-
getClasspathAttributeDeltas
Description copied from interface:IJavaElementDeltaReturns deltas for affected attributes (added, removed, or changed). Returns an empty array if no attribute was affected, or if this delta's element is not for an affectedIClasspathEntry.- Specified by:
getClasspathAttributeDeltasin interfaceIJavaElementDelta- Returns:
- deltas for affected attributes (added, removed, or changed)
-