/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type { Node } from "../../types/javax/jcr/Node"; import type { String } from "../../types/java/lang/String"; import type { LinkTarget } from "../../types/senselogic/sitevision/api/webresource/LinkTarget"; import type { Builder } from "../../types/senselogic/sitevision/api/base/Builder"; /** * Builder to create link target instances that can be used to create and update a Link page * via {@link senselogic.sitevision.api.webresource.LinkPageUtil}. * *

* LinkTargetBuilder has one mandatory attribute: *

* *

* LinkTargetBuilder also has some optional attributes: *

* * *

* Using the LinkTargetBuilder is pretty straightforward, if you remember that it is stateful. Conceptually you * would typically use it like this: *

*
    *
  1. Get the LinkTargetBuilder
  2. *
  3. Set the target
  4. *
  5. Possibly set a description
  6. *
  7. Possibly set open in new window
  8. *
  9. Do build
  10. *
*

* When you have built a LinkTarget instance, you can re-use the LinkTargetBuilder to build more instances. Something like: *

*
    *
  1. Set a new target
  2. *
  3. Possibly set a description
  4. *
  5. Possibly set open in new window
  6. *
  7. Do build
  8. *
* *

* Tip! The {@link senselogic.sitevision.api.base.Builder 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 * {@link senselogic.sitevision.api.webresource.WebResourceFactory#getLinkTargetBuilder()}. * See {@link senselogic.sitevision.api.webresource.WebResourceFactory} for how to obtain an instance of the * WebResourceFactory interface. *

* @author Magnus Lövgren * @since Sitevision 4.2 * @see senselogic.sitevision.api.webresource.LinkPageUtil */ export interface LinkTargetBuilder extends Builder { /** * Sets the target. * @param aNode the target, must be a linkable resource (i.e. a page/article/image/file or such) that isn't trashed. * @return this builder * @throws IllegalArgumentException if aNode is null or not a linkable resource. */ setInternalTarget(aNode: Node): LinkTargetBuilder; /** * Sets the target. * @param aURL the link target URL * @return this builder * @throws IllegalArgumentException if aURL is null or whitespace only */ setExternalTarget(aURL: String | string): LinkTargetBuilder; /** * Sets the target. * @param aMailAddress a mail address * @return this builder * @throws IllegalArgumentException if aMailAddress is null, whitespace only or an invalid mail address. * @see senselogic.sitevision.api.mail.MailUtil#isValidAddress(String) */ setMailTarget(aMailAddress: String | string): LinkTargetBuilder; /** * Sets the target. * @param aPhoneNumber a phone number * @return this builder * @throws IllegalArgumentException if aPhoneNumber is null, whitespace only or an invalid phone number. */ setPhoneTarget(aPhoneNumber: String | string): LinkTargetBuilder; /** * Sets the description. * @param aDescription the description * @return this builder */ setDescription(aDescription: String | string): LinkTargetBuilder; /** * Sets open in new window. * @param aOpenInNewWindow whether or not the target should be opened in new window * @return this builder */ setOpenInNewWindow(aOpenInNewWindow: boolean): LinkTargetBuilder; /** * Creates a LinkTarget instance using current state of this builder. * *

* * Note! The 'open in new window' state is ignored when creating a LinkTarget with * a mail or telephone target (these target types can never be opened in a new window). * *

* @return a link target * @throws IllegalStateException if there are no link target. */ build(): LinkTarget; } declare namespace LinkTargetBuilder {} declare var linkTargetBuilder: LinkTargetBuilder; export default linkTargetBuilder;