Copyright© 2008-2022 Sitevision AB, all rights reserved.
@Requireable(value="RelatedValueBuilder") public interface RelatedValueBuilder extends Builder<RelatedValue>
RelatedValueBuilder has one mandatory attribute:
Using the RelatedValueBuilder is pretty straightforward, if you remember that it is stateful. Conceptually you would typically use it like this:
When you have built a RelatedValue
instance, you can re-use the RelatedValueBuilder to build more instances. Something like:
Tip! The Builder interface documentation
contains
more information about Builders and how to work with them!
An instance of the Sitevision class implementing this interface can be obtained via
MetadataUtil.getRelatedValueBuilder()
.
See MetadataUtil
for how to obtain an instance of the MetadataUtil
interface.
Modifier and Type | Method and Description |
---|---|
RelatedValueBuilder |
addLinkValue(LinkValue aLinkValue)
Adds a link value.
|
RelatedValueBuilder |
addText(String aText)
Adds a text value.
|
RelatedValueBuilder |
addUser(Node aUserNode)
Adds a user value.
|
RelatedValue |
build()
Creates a RelatedValue instance using current state of this builder.
|
RelatedValueBuilder |
clearValues()
Removes all currently added values.
|
RelatedValueBuilder addLinkValue(LinkValue aLinkValue) throws IllegalArgumentException
aLinkValue
- the link value to addIllegalArgumentException
- if aLinkValue
is null
or not an instance created via
LinkValueBuilder
RelatedValueBuilder addUser(Node aUserNode) throws IllegalArgumentException
aUserNode
- the user node to add (a node with primary node type sv:user or sv:simpleUser)IllegalArgumentException
- if aUserNode
is null
or an invalid user node
(e.g. sv:systemUser - Anonymous, System, Indexer, Validator or Extractor)RelatedValueBuilder addText(String aText)
aText
- the text to add. A null
or whitespace-only value will be completely ignored.RelatedValueBuilder clearValues()
RelatedValue build() throws IllegalStateException
build
in interface Builder<RelatedValue>
IllegalStateException
- if the builder contains no values.Sitevision - Portal and Content Management Made Easy
Sitevision is an advanced Java enterprise portal product and a portlet container (JSR 286) that implements Java Content Repository (JSR 283).
Copyright© 2008-2022 Sitevision AB, all rights reserved.