Up
Authors
- Manuel Guesdon (
mguesdon@orange-concept.com)
-
Date: Generated at 2025-12-01
Copyright: (C) 1999-2004 Free Software Foundation, Inc.
- Declared in:
- WebObjects/GSWAssociation.h
- Conforms to:
- NSCopying
Availability: OpenStep
The main GSWAssociation class that handles value binding
and resolution for GSWeb components. This class serves as
the foundation for all binding operations in the GSWeb
framework, providing mechanisms to get and set
values through key paths, handle constant values, and
manage debugging and logging functionality.
GSWAssociation declares 5 Instance Variables
+ (void)
addLogHandlerClasse: (Class)class;
Availability: OpenStep
Adds a class to the list of log handler
classes. Log handlers can monitor and process
association operations for debugging and
analysis purposes.
+ (
GSWAssociation*)
associationFromString: (
NSString*)string;
Availability: OpenStep
Creates and returns a new association from a
string representation. The
string is parsed to determine whether it
represents a constant value (quoted strings) or
a key path, with appropriate association type created.
+ (
GSWAssociation*)
associationWithKeyPath: (
NSString*)keyPath;
Availability: OpenStep
Creates and returns a new association representing
the specified key path. The association will resolve
the key path within component contexts and may be
settable depending on the key path structure.
+ (
GSWAssociation*)
associationWithValue: (id)value;
Availability: OpenStep
Creates and returns a new association representing
the specified constant value. The
association will always return this
value regardless of component context and
will not be settable.
+ (void)
removeLogHandlerClasse: (Class)class;
Availability: OpenStep
Removes a class from the list of log
handler classes, stopping its participation in
association operation logging.
+ (void)
setClasse: (Class)class
forHandler: (
NSString*)handler;
Availability: OpenStep
Sets the association class to use for a
specific handler type. This allows
customization of association behavior for
different types of bindings or value sources.
+ (void)
setValue: (id)value
inComponent: (
GSWComponent*)component
forKeyPath: (
NSString*)keyPath;
Availability: OpenStep
Class method that directly sets a
value in a component using the
specified key path. This is a convenience method
that performs key path assignment without requiring an
association object.
+ (id)
valueInComponent: (
GSWComponent*)component
forKeyPath: (
NSString*)keyPath;
Availability: OpenStep
Class method that directly
retrieves a value from a component
using the specified key path. This is a convenience
method that performs key path resolution without
requiring an association object.
- (void)
_logPullValue: (id)value
inComponent: (
GSWComponent*)component;
Availability: OpenStep
Internal method to log value retrieval
operations. Records when values are pulled from
this association within a component
context, useful for debugging and performance
analysis.
Warning the underscore
at the start of the name of this method indicates that
it is private, for internal use only, and you should not
use the method in your code.
- (void)
_logPushValue: (id)value
inComponent: (
GSWComponent*)component;
Availability: OpenStep
Internal method to log value assignment
operations. Records when values are pushed to
this association within a component
context, useful for debugging and performance
analysis.
Warning the underscore
at the start of the name of this method indicates that
it is private, for internal use only, and you should not
use the method in your code.
- (
NSString*)
bindingInComponent: (
GSWComponent*)component;
Availability: OpenStep
Returns the binding string representation as it
appears in the.gswd file. This provides the
original declaration syntax for this association,
useful for debugging and development tools.
- (
NSString*)
bindingName;
Availability: OpenStep
Returns the name of the binding attribute that this
association represents within a component
declaration. For example, "value" in a
GSWString's value binding.
- (BOOL)
boolValueInComponent: (
GSWComponent*)component;
Availability: OpenStep
Returns the boolean value represented by this
association within the context of the specified
component. Non-boolean values are
converted to boolean using standard Objective-C
truthiness rules.
- (
NSString*)
debugDescription;
Availability: OpenStep
Returns a detailed debug description of this
association, including its type, key path or
value, and current configuration. More verbose than
the standard description method.
- (
NSString*)
declarationName;
Availability: OpenStep
Returns the name of the declaration that contains
this association. This is typically the identifier
used in the.gswd file for the dynamic element
containing this binding.
- (
NSString*)
declarationType;
Availability: OpenStep
Returns the type of the declaration that contains
this association. This corresponds to the element
class name (e.g., "GSWString", "GSWConditional") in
the component declaration.
- (
NSString*)
description;
Availability: OpenStep
Returns a string description of this association,
typically showing the key path or constant value
it represents. Used for debugging and logging purposes.
- (BOOL)
isImplementedForComponent: (
NSObject*)component;
Availability: OpenStep
Returns whether this association is implemented for
the specified component. This checks if the
association's key path can be resolved within
the component's context, indicating whether the binding
will function correctly.
- (BOOL)
isValueConstant;
Availability: OpenStep
Returns whether this association represents a
constant value rather than a dynamic key path.
Constant associations always return the same value
regardless of component state.
- (BOOL)
isValueConstantInComponent: (
GSWComponent*)comp;
Availability: OpenStep
Returns whether this association represents a
constant value within the context of the specified
component. This provides component-specific
constant checking beyond the general
isValueConstant method.
- (BOOL)
isValueSettable;
Availability: OpenStep
Returns whether this association represents a
settable key path. Only key path associations (not
constant values) are settable, and only if the key
path resolves to a settable property.
- (BOOL)
isValueSettableInComponent: (
GSWComponent*)comp;
Availability: OpenStep
Returns whether this association's value is
settable within the context of the specified
component. This provides component-specific
settability checking beyond the general
isValueSettable method.
- (
NSString*)
keyPath;
Availability: OpenStep
Returns the key path string that this association
represents. For constant value associations,
this may return nil or an internal
representation. For key path associations,
returns the actual key path used for value
resolution.
- (void)
logSynchronizeComponentToParentForValue: (id)value
inComponent: (
GSWComponent*)component;
Availability: OpenStep
Logs synchronization from component to
parent, recording the value being
synchronized and the component
context. Used for debugging bidirectional binding
operations.
- (void)
logSynchronizeParentToComponentForValue: (id)value
inComponent: (
GSWComponent*)component;
Availability: OpenStep
Logs synchronization from parent to
component, recording the value
being synchronized and the component
context. Used for debugging bidirectional binding
operations.
- (BOOL)
negate;
Availability: OpenStep
Returns whether this association negates boolean
results before returning them. This is a GSWeb
extension feature that allows boolean key paths
to be negated by prefixing them with "!" in the
declaration.
- (void)
setDebugEnabledForBinding: (
NSString*)bindingName
declarationName: (
NSString*)declarationName
declarationType: (
NSString*)declarationType;
Availability: OpenStep
Enables debug logging for this association when
used with the specified binding name, declaration
name, and declaration type. When enabled, the
association will log detailed information about
its operations.
- (void)
setNegate: (BOOL)yn;
Availability: OpenStep
Sets whether this association should negate boolean
results before returning them. When enabled,
boolean values returned by valueInComponent: and
boolValueInComponent: will be
logically inverted.
- (void)
setValue: (id)value
inComponent: (
GSWComponent*)component;
Availability: OpenStep
Sets the value represented by this
association within the context of the specified
component. This method is only effective
for settable associations (those representing key paths
rather than constant values).
Instance Variables for GSWAssociation Class
@protected NSString*
_bindingName;
Availability: OpenStep
The name of the binding attribute
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected BOOL
_debugEnabled;
Availability: OpenStep
Enable debug logging for this association
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSString*
_declarationName;
Availability: OpenStep
The name of the declaration containing this association
Warning the underscore at the start
of the name of this instance variable indicates that,
even though it is not technically private, it
is intended for internal use within the package, and you
should not use the variable in other code.
@protected NSString*
_declarationType;
Availability: OpenStep
The type of the declaration (element class name)
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected BOOL
_negate;
Availability: OpenStep
Whether to negate boolean results (GSWeb extension)
Warning the underscore at the start
of the name of this instance variable indicates that,
even though it is not technically private, it
is intended for internal use within the package, and you
should not use the variable in other code.
- Declared in:
- WebObjects/GSWAssociation.h
Availability: OpenStep
Category extending NSArray with association-related
functionality. This category provides methods
for working with arrays that contain string
representations of associations, enabling
conversion from parsed declarations to executable
association objects.
- (
NSArray*)
arrayByReplacingStringsWithAssociations;
Availability: OpenStep
Returns a new array where string elements in this
array are replaced with corresponding association
objects. This is typically used during parsing to
convert string declarations into executable
associations for array-based bindings.
- Declared in:
- WebObjects/GSWAssociation.h
Availability: OpenStep
Category extending NSDictionary with
association-related functionality. This
category provides methods for working with
dictionaries that contain associations as
values, enabling batch operations and debugging
support for association collections commonly used in
component bindings.
- (void)
associationsSetDebugEnabled;
Availability: OpenStep
Enables debug logging for all associations
contained as values in this dictionary. This is a
convenience method for batch enabling debug
mode on multiple associations simultaneously.
- (void)
associationsSetValuesFromObject: (id)from
inObject: (id)to;
Availability: OpenStep
Transfers values from one object
to another using the associations in this
dictionary as the transfer mechanism. Each
association key-value pair defines how values
are copied between objects.
- (
NSDictionary*)
associationsWithoutPrefix: (
NSString*)prefix
removeFrom: (
NSMutableDictionary*)removeFrom;
Availability: OpenStep
Returns a new dictionary containing associations
from this dictionary that do not have keys matching
the specified prefix. Associations with
matching prefixes are removed from the provided
mutable dictionary if specified.
- (
NSDictionary*)
dictionaryByReplacingStringsWithAssociations;
Availability: OpenStep
Returns a new dictionary where string values in
this dictionary are replaced with corresponding
association objects. This is typically used
during parsing to convert string declarations into
executable associations.
- (BOOL)
isAssociationDebugEnabledInComponent: (
GSWComponent*)component;
Availability: OpenStep
Returns whether debug logging is enabled for
associations in this dictionary within the
context of the specified component.
Checks the debug state of association values
contained in the dictionary.
_GSWAssociation_h__
Availability: OpenStep
The GSWAssociation class represents values of GSWeb
attributes specified in declaration files (.gswd).
Association objects serve as binding mechanisms
between component attributes and their values,
handling both constant values and dynamic key paths
that resolve to component properties or methods.
GSWAssociation objects get or set values
according to value keys. For example: MyString1:
GSWString {value = "aLabel"; // Constant string
value}; MyString2: GSWString {value = label; // Dynamic
key path to component property}; MyString3: GSWString {
value = myMember.label; // Nested key path through
component hierarchy}; At runtime, the GSWeb parser
scans HTML templates (.html) and their declarations
(.gswd) to create dynamic element objects. The
association handles value resolution: - Constant
values (quoted strings) are returned as-is - Simple
key paths resolve through the component's valueForKey:
mechanism - Nested key paths traverse object
hierarchies using key-value coding Special
Features: - Negation: Prefix key path with "!" to
negate boolean results - Debug logging: Comprehensive
logging support for binding operations - Type
flexibility: Handles various value types with
appropriate conversions
Up