BaseElement
instead@Deprecated public abstract class SimpleElement extends Object implements Element, Cloneable
Element
interface intended to be extended.Constructor and Description |
---|
SimpleElement()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
SimpleElement |
clone()
Deprecated.
Returns a shallow copy of this element.
|
SortedSet<? extends Element> |
getChildren()
Deprecated.
This default implementation uses the
newChildrenInstance() to initialize the children set and wraps
it in a private set implementation that automagically changes the parent of the elements based on the
membership. |
protected <T extends Element> |
getDirectChildrenOfType(Class<T> type)
Deprecated.
|
String |
getFullHumanReadableString()
Deprecated.
This default implementation assumes that
toString() can do the job. |
Element |
getParent()
Deprecated.
|
Iterator |
iterateOverChildren(Class resultType,
boolean recurse,
Filter filter)
Deprecated.
Similar to search methods but avoids the traversal over the whole forest.
|
protected SortedSet<Element> |
newChildrenInstance()
Deprecated.
Override this method if you need some specialized instance of sorted set or want to do some custom pre-populating
or initialization of the children.
|
List |
searchChildren(Class resultType,
boolean recurse,
Filter filter)
Deprecated.
This method is functionally equivalent to
Element.searchChildren(java.util.List, java.lang.Class, boolean,
org.revapi.query.Filter) but returns the result in a newly allocated list instance. |
void |
searchChildren(List results,
Class resultType,
boolean recurse,
Filter filter)
Deprecated.
Recursively searches the children of this element for elements of given type, potentially applicable to given
filter.
|
void |
setParent(Element parent)
Deprecated.
Sets the parent element.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
as, getApi, getArchive, stream
compareTo
public SimpleElement clone()
@Nonnull public SortedSet<? extends Element> getChildren()
newChildrenInstance()
to initialize the children set and wraps
it in a private set implementation that automagically changes the parent of the elements based on the
membership.getChildren
in interface Element
@Nonnull protected SortedSet<Element> newChildrenInstance()
TreeSet
instance.public void setParent(@Nullable Element parent)
@Nonnull public final List searchChildren(@Nonnull Class resultType, boolean recurse, @Nullable Filter filter)
Element
Element.searchChildren(java.util.List, java.lang.Class, boolean,
org.revapi.query.Filter)
but returns the result in a newly allocated list instance. This is basically
a convenience method to enable a more succinct expressions.searchChildren
in interface Element
resultType
- the type of the elements to look forrecurse
- false to search only in direct children of the element, true to search recursivelyfilter
- optional filter to further trim the number of results @return the list of child elements of
given type potentially satisfying given filterpublic final void searchChildren(@Nonnull List results, @Nonnull Class resultType, boolean recurse, @Nullable Filter filter)
Element
This is identical to Element.searchChildren(Class, boolean, org.revapi.query.Filter)
in behavior but avoids
the instantiation of a new list.
searchChildren
in interface Element
results
- the list of the results to fillresultType
- the type of the elements to look forrecurse
- false to search only in direct children of the element, true to search recursivelyfilter
- optional filter to further trim the number of results@Nonnull public String getFullHumanReadableString()
toString()
can do the job.getFullHumanReadableString
in interface Element
Element.getFullHumanReadableString()
@Nonnull public Iterator iterateOverChildren(@Nonnull Class resultType, boolean recurse, @Nullable Filter filter)
Element
iterateOverChildren
in interface Element
resultType
- the type of elements to look forrecurse
- if true, the iterator traverses the element forest using depth first searchfilter
- optional filter to further trim the number of resultsElement.searchChildren(Class, boolean, org.revapi.query.Filter)
Copyright © 2014-2021 Lukas Krejci. All Rights Reserved.