Package org.patternfly.core


package org.patternfly.core
Core classes and interfaces for PatternFly Java.

This package provides the foundational building blocks used throughout PatternFly Java components and layouts. It includes utilities for ARIA attributes, data attributes, component context management, observable values, and common types.

Key Classes and Interfaces

ARIA and Data Attributes

  • Aria - Constants for ARIA attribute names (aria-label, aria-expanded, etc.)
  • Attributes - Common HTML attribute constants
  • Dataset - Constants for data-* attribute names used in PatternFly components
  • Roles - Constants for ARIA role attribute values
  • Ouia - Open UI Automation (OUIA) data attribute constants for testing

Component Infrastructure

  • ComponentContext - Interface for storing and retrieving arbitrary values within a component
  • ObservableValue - A value wrapper that notifies subscribers when changed, enabling reactive patterns
  • AsyncStatus - Enumeration representing asynchronous operation states

Utilities

  • Tuple and Tuples - Simple key-value pair types
  • Numbers - Numeric utility functions
  • Timeouts - Common timeout constants
  • Validation - Validation helpers for property ranges and enums
  • LanguageDirection - Language direction enumeration (LTR/RTL)
  • Version - Version information for the PatternFly Java library

Integration with Elemento

PatternFly Java builds upon Elemento's builder API, providing a fluent, type-safe approach to creating web components. The ComponentContext interface extends Elemento's TypedBuilder to provide consistent builder patterns across all PatternFly components.

Observable Values

The ObservableValue class enables reactive programming patterns by allowing components to subscribe to value changes. Example usage:

ObservableValue<String> value = ObservableValue.ov("initial");
value.subscribe((current, previous) -> console.log("Value changed: " + current));
value.set("new value"); // Triggers subscriber notification
See Also: