History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CARGO-209
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Magnus Grimsell
Reporter: Nigel Magnay
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Cargo

Base classes for wrapping Elements

Created: 16/Nov/05 06:13 AM   Updated: 30/Mar/06 04:25 AM
Component/s: Module API
Affects Version/s: 0.6
Fix Version/s: 0.7

Time Tracking:
Not Specified

File Attachments: 1. Text File abstractnodelist.patch (4 kb)
2. Text File xml.patch (36 kb)



 Description  « Hide
In many places, entities are returned as org.w3c.dom.Elements. For example, in WebXml.getFilter().

It is nice to be able to return something that is-a Element (since it is an interface), but also supports additional java style property accessors. So, instead of returning an Element, it could return a class that implements Element, but also supports something like 'getFilterName' 'setFilterType', etc. This preseves compatibility with clients that want to do DOM type things, but provides an easier interface for code that wants to interrogate / manipulate the state itself.

AbstractElement / Node are base classes for wrapping the dom objects, proxying the Element interface calls.

In addition, it provides a getElementId() method - this is intended for subclasses to override and return some kind of identifier, that can be used to distinguish the element. For example, for a JNDI entry it might be the bound JNDI name. This can be used by processes (merge) that need to identify things that are the same in 2 different descriptors.

One slight trouble is that due to the way the DOM has been extended (I'm baffled as to why it's been done this way), the 1.5 methods must be declared but can't be proxied (otherwise it won't compile correctly) - introspection could be used, but I'm assuming for now we don't want to use DOM level 3 functionality anyway..



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Nigel Magnay - 16/Nov/05 09:58 AM
Also a class for wrapping NodeList that takes advantage of knowing about AbstractElement, has functions for creating iterators and getting elements by Id

Magnus Grimsell - 23/Nov/05 11:51 AM
Applied the patch. Moved the package to api.module.internal since its only used by the module project.

Vincent Massol - 02/Dec/05 03:24 AM
reopening to change the component to "Module API"