logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lance Larsen" <llar...@netopia.com>
Subject Re: Making object rendering more extensible
Date Wed, 13 Feb 2002 22:37:01 GMT
> You can have the 'ObjectRenderer' act sort of like a
> 'Hashtable' and have keys for the various 'String(s)' an 'ObjectRenderer'
> exposes. For example, an 'ObjectRenderer' for 'FTPCommandInfo' might
> keys like "Client IP", "Server IP", "Port", etc. that were associated with
> the correspoding values.

I am explaining alot of stuff as text, and I think it may be helpful to at
least show what this might look like to clarify the idea. The
'ObjectRenderer' interface may look like the following:

public interface ObjectRenderer
   // Set the object that will be rendered
   void setObject(Object object);
   // Request one of the values by the appropriate key.
   String renderObjectData(String key);
   // What Strings does this Renderer expose?
   // Get the associated keys.
   String[] getKeys();

There may be a cleaner interface to express this, but this hopefully gets
the idea across. A 'Layout' could check the set of keys that are exposed by
the 'ObjectRenderer' and could extract those values one by one and
incorporate them into the 'format' response appropriately.

-Lance Larsen

To unsubscribe, e-mail:   <mailto:log4j-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-dev-help@jakarta.apache.org>

View raw message