• 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
  • isempty ( ';' STRING )*

    Prev Next
    Macro
    Check if all given strings are empty

    Summary

    The isempty macro checks if all provided arguments are empty strings. Returns true only if all values are empty, false otherwise.

    Syntax

    ${isempty[;<string>...]}
    

    Parameters

    • string (optional) - Zero or more strings to check

    Behavior

    • Returns true if all arguments are empty strings
    • Returns true if no arguments provided
    • Returns false if any argument has content
    • Empty string means zero length

    Examples

    Check if empty:

    ${if;${isempty;${value}};value-empty;value-has-content}
    

    Check multiple values:

    ${isempty;;;;}
    # Returns: true (all empty)
    

    Validate required fields:

    ${if;${isempty;${name};${email}};missing-fields;fields-ok}
    

    No arguments:

    ${isempty}
    # Returns: true
    

    Use Cases

    • Input validation
    • Checking for missing values
    • Required field validation
    • Conditional logic on emptiness
    • Form validation

    Notes

    • All arguments must be empty for true
    • Empty string is “”
    • Whitespace is not empty
    • Returns boolean
    • See also: ${length} to check string size
    • See also: ${def} for default values

    See test cases in MacroTestsForDocsExamples.java

Prev Next
Search
    • Home