Interface HstNode
public interface HstNode
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds or replaces a child HST node with the given name.getName()
getNodes()
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.boolean
isStale()
void
marks the HstNode as stale due to node event: The JCRValueProvider might be out-of-date and/or the child nodes.void
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
updates all the HstNode's that need reloading.
-
Method Details
-
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
- 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
- Returns:
List<{@link HstNode}>
of all the child nodes
-
getNodes
- Returns:
List<{@link HstNode}>
of all the child nodes withgetNodeTypeName()
equals tonodeTypeName
-
getNodeTypeName
String getNodeTypeName()- Returns:
- the node type of the backing provider
-
getMixinNames
- Returns:
- immutable list of mixin names and empty list in case no mixins present
-
getParent
HstNode getParent()- Returns:
- the parent of this
orHstNode
null
when there is no parent.
-
addNode
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
removes child node withname
and does nothing if not present- Parameters:
name
-
-
setJCRValueProvider
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
updates all the HstNode's that need reloading.- Parameters:
session
-- Throws:
RepositoryException
-