This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 61622 - [DevRev] API Changes: naming, remove short classes, make API classes final
Summary: [DevRev] API Changes: naming, remove short classes, make API classes final
Status: CLOSED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: API (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks: 61412
  Show dependency tree
 
Reported: 2005-08-01 18:22 UTC by Andrei Badea
Modified: 2007-09-25 01:29 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Badea 2005-08-01 18:22:48 UTC
This issue resulted from the Tag Editor Support API Inception Review.

The DocumentElementInfo class should be removed, as its method are either not
used or can be replaced by DocumentModel methods.

BaseDocument should not appear in the API. Only javax.swing.text.Document should
be used.

There are several classes in the API which are not final and they have protected
methods, thus it is not clear whether they are intended to be extended. These
classes should be made final.

Listener interfaces should extend EventListener.

The DocumentModelProvider class contains a single method. This method should be
moved to DocumentModel and the class removed.
Comment 1 Marek Fukala 2005-08-03 12:59:02 UTC
1) DocumentElementInfo removal:
The class has been removed and the DocumentModel now has public String getType()
method instead. This method is used to determine the type of the document
element and is mostly used by clients (navigator, folding) to determine the
DocumentElement type (based on the type the client changes its behaviour).
Andrei correctly pointed out, that because of that (not only) there has to be a
dependency between a client and the provider. For example a XML DocumentModel
provider will define XML_TAG, XML_TEXT element types and the client needs to use
it. Of course there always has to be a kind of dependency between the client and
the provider, but at least the compile dependency is eliminated by the "String"
approach. On the other hand this causes that the types has to be defined in both
client and provider and the content (content of the strings) has to be the same.

2) DocumentElementListener and DocumentModelListener now extends EventListener

3) DocumentModelProvider.getDocumentModel() static method moved to DocumentModel
class and the DocumentModelProvider class has been removed.

4) All API classes are now final and do not contain any protected methods.

5) BaseDocument removal has been done in all API classes even there still will
be defacto dependency on that class. So I added a warning message (exception)
saying that currently it is necessary to pass BaseDocument instance into the
DocumentModel.getDocumentProvider(j.s.t.Document) method.
Comment 2 Jiri Kovalsky 2006-03-01 13:20:00 UTC
Closing DevRev issue.