public class Body
extends java.lang.Object
IElement
.
This implementation is thread-safe under the condition that mutator methods are not invoked concurrently. If multiple threads access a body concurrently, and at most one of them modifies the body, which is the typical usage pattern, external synchronization is not required.
Clients can use this class as it stands or subclass it as circumstances warrant.
IBodyCache
Constructor and Description |
---|
Body() |
Modifier and Type | Method and Description |
---|---|
void |
addChild(IElement child)
Adds the given child element to this body if it is not already present.
|
void |
findContentChange(Body oldBody,
IElement element,
IElementDeltaBuilder builder)
Finds whether this body has had a content change.
|
IElement[] |
getChildren()
Returns the child elements for this body.
|
void |
removeChild(IElement child)
Removes the given child element from this body if it is present.
|
void |
setChildren(IElement[] children)
Sets the child elements for this body.
|
public IElement[] getChildren()
This implementation returns an array of exactly the same runtime type as
the array given in the most recent call to setChildren
.
null
).
Clients must not modify the returned array.public void setChildren(IElement[] children)
children
- not null
, must not contain null
elementspublic void addChild(IElement child)
child
- not null
public void removeChild(IElement child)
child
- may be null
public void findContentChange(Body oldBody, IElement element, IElementDeltaBuilder builder)
Implementations can compare this body and the given old body and,
if there are differences (excepting children), insert an appropriate
change delta (such as F_CONTENT
) for the given element into
the delta tree being built. Implementations should not take changes in
children into account.
oldBody
- the old version of the body (not null
)element
- the element this body corresponds to (not null
)builder
- represents the delta tree being built (not null
)Copyright (c) 2014, 2019 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0