[jdom-interest] protected ContentList in Document
David D. Lucas
ddlucas at lse.com
Thu May 2 17:39:20 PDT 2002
Also, the Element.clone() method assumes that content and attributes is
only defined in the current class. The constructor for Element also
creates the values for attributes and contentList which would not give
any other class the opportunity to extend and modify the usage of the
protected values.
I agree, it should be private and a getter/setter should be added to
access the values.
Elliotte Rusty Harold wrote:
> The org.jdom.Document class has this protected field:
>
> protected ContentList content = new ContentList(this);
>
> However, the ContentList class is package private so this field isn't
> truly accessible to subclasses. I think we should either
>
> 1. Make the content field private (My preferred option)
> 2. Make ContentList a public class
> 3. Declare the content field to have type List rather than ContentList
>
> The protected attributes and content fields in the Element class have
> the same issues:
>
> /** The attributes of the <code>Element</code>. */
> protected AttributeList attributes = new AttributeList(this);
>
> /** The mixed content of the <code>Element</code>. */
> protected ContentList content = new ContentList(this);
>
--
+------------------------------------------------------------+
| David Lucas mailto:ddlucas at lse.com |
| Lucas Software Engineering, Inc. (740) 964-6248 Voice |
| Unix,Java,C++,CORBA,XML,EJB (614) 668-4020 Mobile |
| Middleware,Frameworks (888) 866-4728 Fax/Msg |
+------------------------------------------------------------+
| GPS Location: 40.0150 deg Lat, -82.6378 deg Long |
| IMHC: "Jesus Christ is the way, the truth, and the life." |
| IMHC: "I know where I am; I know where I'm going." <>< |
+------------------------------------------------------------+
Notes: PGP Key Block=http://www.lse.com/~ddlucas/pgpblock.txt
IMHO="in my humble opinion" IMHC="in my humble conviction"
All trademarks above are those of their respective owners.
More information about the jdom-interest
mailing list