• Intro Headers Instructions Macros Commands
Fork me on GitHub
    • Getting Started
      • Introduction
      • How to install bnd
      • Guided Tour Workspace & Projects
      • bnd / bndlib Features and JAR Wrapping Techniques
      • FAQ - Frequently Asked Questions
    • Concepts and Practices
      • Concepts
      • Background
      • Best practices
    • Build and Development
      • Build
      • Generating JARs
      • Versioning
      • Baselining
      • Service Components
      • Metatype
      • Contracts
      • Bundle Annotations
      • Accessor Properties
      • SPI Annotations
    • Dependency and Launching
      • Resolving Dependencies
      • Launching
      • Startlevels
    • Testing
      • Testing
      • Testing with Launchpad
    • Packaging and Distribution
      • Packaging Applications
      • JPMS Libraries
      • Wrapping Libraries to OSGi Bundles
    • Documentation and Tools
      • Generating Documentation
      • bnd CLI Commands
      • For Developers
      • Templates for Workspaces
      • Tips for Windows users
      • Tools bound to bnd
    • Reference Material
      • Reference
      • Headers
      • Instruction Reference
      • Instruction Index
      • Macro Reference
      • Macro Index
      • Plugins
      • External Plugins
    • Configuration and Troubleshooting
      • Settings
      • Errors
      • Warnings
  • literal ';' STRING

    Prev Next
    Macro
    Prevent macro expansion by wrapping a value with macro delimiters

    Summary

    The literal macro prevents macro expansion by wrapping a value with the macro prefix ${ and suffix }. This effectively creates a literal macro reference that won’t be expanded in the current pass.

    Syntax

    ${literal;<value>}
    

    Parameters

    • value - The string to wrap with macro delimiters

    Behavior

    • Wraps the input value with ${ and }
    • Returns ${<value>}
    • Prevents immediate macro expansion
    • The result can be expanded in a later processing pass

    Examples

    Create a literal macro reference:

    ${literal;version}
    # Returns: "${version}"
    

    Delay macro expansion:

    deferred=${literal;basedir}
    # deferred contains the string "${basedir}", not the actual path
    

    Pass macro syntax as a value:

    template=${literal;project.name}
    # Later: expanded=${template} will evaluate ${project.name}
    

    Store macro patterns:

    pattern=${literal;if;condition;true;false}
    # Returns: "${if;condition;true;false}"
    

    Use Cases

    • Delaying macro expansion to a later processing stage
    • Storing macro patterns as values
    • Generating dynamic macro references
    • Template creation and processing
    • Multi-pass macro processing
    • Escaping macro syntax

    Notes

    • The result is a string, not an expanded macro
    • Useful for meta-programming with macros
    • The wrapped value will be expanded if processed again
    • Does not escape inner content - only wraps it
    • Requires exactly one argument
    • Returns a literal macro syntax string
    • See also: Property substitution and template processing

    See test cases in MacroTestsForDocsExamples.java

Prev Next
Search
    • Home