Apache log4cxx Version 0.10.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
PropertySetter Class Reference

General purpose Object property setter. More...

## Public Member Functions
| PropertySetter (const helpers::ObjectPtr &obj)
| Create a new PropertySetter for the specified Object. More...
void | setProperties (helpers::Properties &properties, const LogString &prefix, log4cxx::helpers::Pool &p)
| Set the properites for the object that match the `prefix` passed as parameter. More...
void | setProperty (const LogString &option, const LogString &value, log4cxx::helpers::Pool &p)
| Set a property on this PropertySetter's Object. More...
void | activate (log4cxx::helpers::Pool &p)

## Static Public Member Functions
static void | setProperties (const helpers::ObjectPtr &obj, helpers::Properties &properties, const LogString &prefix, log4cxx::helpers::Pool &p)
| Set the properties of an object passed as a parameter in one go. More...

## Protected Attributes
helpers::ObjectPtr | obj

## Detailed Description

General purpose Object property setter.

Clients repeatedly invokes setProperty(name,value) in order to invoke setters on the Object specified in the constructor.

Usage:

    PropertySetter ps(anObject);
    ps.set("name", "Joe");
    ps.set("age", "32");
    ps.set("isMale", "true");

will cause the invocations anObject->setOption("name", "Joe"), anObject->setOption("age", "32") and anObject->setOption("isMale", "true") if the spi::OptionHandler interface is supported by anObject.

## Constructor & Destructor Documentation

PropertySetter | ( | const helpers::ObjectPtr & | obj | ) |

Create a new PropertySetter for the specified Object.

This is done in prepartion for invoking setProperty one or more times.

Parameters

  obj | the object for which to set properties

## Member Function Documentation

void activate | ( | log4cxx::helpers::Pool & | p | ) |

static void setProperties | ( | const helpers::ObjectPtr & | obj,
|  | helpers::Properties & | properties,
|  | const LogString & | prefix,
|  | log4cxx::helpers::Pool & | p
| ) |  |
| static

Set the properties of an object passed as a parameter in one go.

The `properties` are parsed relative to a `prefix`.

Parameters

  obj | The object to configure.
  properties | A java.util.Properties containing keys and values.
  prefix | Only keys having the specified prefix will be set.
  p | pool to use for any allocations required during call.

void setProperties | ( | helpers::Properties & | properties,
|  | const LogString & | prefix,
|  | log4cxx::helpers::Pool & | p
| ) |  |

Set the properites for the object that match the `prefix` passed as parameter.

void setProperty | ( | const LogString & | option,
|  | const LogString & | value,
|  | log4cxx::helpers::Pool & | p
| ) |  |

Set a property on this PropertySetter's Object.

If the underlying Object supports the spi::OptionHandler interface, the setOption method is called.

Parameters

  option | name of the property
  value | String value of the property
  p | pool to use for any allocations required during call.

## Member Data Documentation

helpers::ObjectPtr obj
| protected

The documentation for this class was generated from the following file:

- propertysetter.h