Interface RegistryItem
-
- All Superinterfaces:
Map<String,Object>
,Serializable
- All Known Implementing Classes:
AbstractNode
,GroupNode
,PackageNode
,RegistryNode
,RegistryTree
,VersionNode
public interface RegistryItem extends Map<String,Object>, Serializable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
compactSubTree()
In some cases the tree can contain e.g.RegistryItem
compactTree()
CallscompactSubTree()
(see there for the why) on thegetParent()
, since the compaction might join same named siblings and replace this node for it to have all children.RegistryItem
getItem(String name)
Iterable<RegistryItem>
getItems()
String
getName()
RegistryItem
getParent()
String
getPath()
String
getText()
String
getType()
boolean
isLoaded()
void
load(com.composum.sling.core.BeanContext context)
Loads all details of this node from the package(s) and makes sure all children (getItems()
) are present, though not necessarily loaded.void
loadForItems(com.composum.sling.core.BeanContext context)
Makes suregetItems()
are present, though not necessarily loaded.void
toJson(com.google.gson.stream.JsonWriter writer)
void
toTree(com.google.gson.stream.JsonWriter writer, boolean children, boolean showRoot)
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
getParent
@Nullable RegistryItem getParent()
-
load
void load(@Nonnull com.composum.sling.core.BeanContext context) throws IOException
Loads all details of this node from the package(s) and makes sure all children (getItems()
) are present, though not necessarily loaded.- Throws:
IOException
-
loadForItems
void loadForItems(@Nonnull com.composum.sling.core.BeanContext context) throws IOException
Makes suregetItems()
are present, though not necessarily loaded. might or might not trigger aload(BeanContext)
if that's necessary for that. (Optimized version ofload(BeanContext)
if we just need thegetItems()
).- Throws:
IOException
-
isLoaded
boolean isLoaded()
-
getItems
@Nonnull Iterable<RegistryItem> getItems()
-
getItem
@Nullable RegistryItem getItem(@Nonnull String name)
-
toTree
void toTree(@Nonnull com.google.gson.stream.JsonWriter writer, boolean children, boolean showRoot) throws IOException
- Throws:
IOException
-
toJson
void toJson(@Nonnull com.google.gson.stream.JsonWriter writer) throws javax.jcr.RepositoryException, IOException
- Throws:
javax.jcr.RepositoryException
IOException
-
compactSubTree
void compactSubTree()
In some cases the tree can contain e.g. a group and a package with the same name. This compacts it and it's subnodes.
-
compactTree
RegistryItem compactTree()
CallscompactSubTree()
(see there for the why) on thegetParent()
, since the compaction might join same named siblings and replace this node for it to have all children.- Returns:
- the new node to use instead of this one (might or might not be the same instance)
-
-