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 95679 - autogenerate interfaces
Summary: autogenerate interfaces
Status: NEW
Alias: None
Product: ide
Classification: Unclassified
Component: Schema2Beans (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: schema2beans-issues@ide
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-15 14:04 UTC by maxnitribitt
Modified: 2007-02-15 14:04 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description maxnitribitt 2007-02-15 14:04:07 UTC
In some cases it would be nice if schema2beans would generate interfaces for
common properties in the generated classes:

Example:
8<-----------example dtd----------------->8
<?xml version="1.0" encoding="UTF-8"?>

<!ELEMENT root (image, label)>
<!ELEMENT image(position, path)>
<!ELEMENT label(position, text)>
<!ELEMENT path (#PCDATA)>
<!ELEMENT text (#PCDATA)>
<!ELEMENT position >
<!ATTLIST position 
x NMTOKEN #REQUIRED
y NMTOKEN #REQUIRED>

8<---------------------------->8

In a case like this I usually add an interface (PositionProvider) manually to
the generated classes Image and Label, to ease the access for the position property.

Especially for large dtds I either end up using reflection a lot or I have to
create lots of interfaces to make it easier to work with generated classes, and
- most important - I would rather not tamper with generated classes. 

It would be much nicer if there was a flag for the autogeneration of such
interfaces. 

Would this be feasible?