Interface HstNode
-
public interface HstNode
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addNode(String name, HstNode hstNode)
Adds or replaces a child HST node with the given name.List<String>
getMixinNames()
String
getName()
HstNode
getNode(String relPath)
List<HstNode>
getNodes()
List<HstNode>
getNodes(String nodeTypeName)
String
getNodeTypeName()
HstNode
getParent()
String
getSubstitutedName()
For example if the HstNode has agetName()
'${environment}', or 'foo-${environment}', then if there is a system property 'environment', the '${environment}' will be replaced with the value of the system property.ValueProvider
getValueProvider()
boolean
isStale()
void
markStaleByNodeEvent()
marks the HstNode as stale due to node event: The JCRValueProvider might be out-of-date and/or the child nodes.void
markStaleByPropertyEvent()
marks the HstNode as stale due to property event: The JCRValueProvider is out-of-date.void
removeNode(String name)
removes child node withname
and does nothing if not presentvoid
setJCRValueProvider(JCRValueProvider valueProvider)
sets the new valueProvidervoid
update(Session session)
updates all the HstNode's that need reloading.
-
-
-
Method Detail
-
getName
String getName()
- Returns:
- name of the hst node
-
getSubstitutedName
String getSubstitutedName()
For example if the HstNode has a
getName()
'${environment}', or 'foo-${environment}', then if there is a system property 'environment', the '${environment}' will be replaced with the value of the system property. If the HstNode has agetName()
with one or more placeholders, then if one of the placeholder cannot be resolved, then anIllegalStateException
is thrown- Returns:
- the substitutedName where property place holders are resolved.
- Throws:
RuntimeException
- If a placeholder cannot be resolved or if the substituted name contains a '.'
-
getValueProvider
ValueProvider getValueProvider()
- Returns:
- the value provider for this
HstNode
-
getNode
HstNode getNode(String relPath) throws IllegalArgumentException
- Parameters:
relPath
- a path that does not start with a slash, for example 'foo' or 'foo/bar'.- Returns:
- the descendant node at
relPath
ornull
if it does not exist - Throws:
IllegalArgumentException
- ifrelPath
is not a valid relPath
-
getNodes
List<HstNode> getNodes(String nodeTypeName)
- Returns:
List<{@link HstNode}>
of all the child nodes withgetNodeTypeName()
equals tonodeTypeName
-
getNodeTypeName
String getNodeTypeName()
- Returns:
- the node type of the backing provider
-
getMixinNames
List<String> getMixinNames()
- Returns:
- immutable list of mixin names and empty list in case no mixins present
-
addNode
void addNode(String name, HstNode hstNode)
Adds or replaces a child HST node with the given name. If an HstNode with the given name already exits, it is replaced with the given HST node. Since the HstNode's are used for the HST config model that does not support same name siblings this is not a problem.- Parameters:
name
- the name for the new HST node.hstNode
- the HST node to add or replace.
-
removeNode
void removeNode(String name)
removes child node withname
and does nothing if not present- Parameters:
name
-
-
setJCRValueProvider
void setJCRValueProvider(JCRValueProvider valueProvider)
sets the new valueProvider- Parameters:
valueProvider
-
-
markStaleByPropertyEvent
void markStaleByPropertyEvent()
marks the HstNode as stale due to property event: The JCRValueProvider is out-of-date.
-
markStaleByNodeEvent
void markStaleByNodeEvent()
marks the HstNode as stale due to node event: The JCRValueProvider might be out-of-date and/or the child nodes.
-
isStale
boolean isStale()
- Returns:
true
when this HstNode is stale
-
update
void update(Session session) throws RepositoryException
updates all the HstNode's that need reloading.- Parameters:
session
-- Throws:
RepositoryException
-
-