Class TreeNode
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<TreeItem>
-
- com.composum.sling.core.pckgmgr.jcrpckg.tree.TreeNode
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<TreeItem>
,Collection<TreeItem>
,List<TreeItem>
,RandomAccess
public class TreeNode extends ArrayList<TreeItem>
the tree node implementation for the requested path (folder or package)- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TreeNode.TreeItemComparator
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addPackage(org.apache.jackrabbit.vault.packaging.JcrPackage jcrPackage)
adds a package or the appropriate folder to the nodes children if it is a child of this nodeboolean
isLeaf()
void
sort()
void
toJson(com.google.gson.stream.JsonWriter writer)
-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
Constructor Detail
-
TreeNode
public TreeNode(String path)
-
-
Method Detail
-
addPackage
public boolean addPackage(org.apache.jackrabbit.vault.packaging.JcrPackage jcrPackage) throws javax.jcr.RepositoryException
adds a package or the appropriate folder to the nodes children if it is a child of this node- Parameters:
jcrPackage
- the current package in the iteration- Returns:
- true, if this package is the nodes target and a leaf - iteration can be stopped
- Throws:
javax.jcr.RepositoryException
-
isLeaf
public boolean isLeaf()
-
sort
public void sort()
-
toJson
public void toJson(com.google.gson.stream.JsonWriter writer) throws IOException, javax.jcr.RepositoryException
- Throws:
IOException
javax.jcr.RepositoryException
-
-