[jdom-interest] Important proposal: Element/Document changes

Jason Hunter jhunter at collab.net
Thu Jul 27 12:31:33 PDT 2000


> To get the exact string, I first need to do
> a getMixedContent() and find the one I want.  Once I do this, I 
> might as well modify the list and then call the correct method to 
> replace the entire
> contents of the element, same thing that you suggested for adding 
> content at a specific location.
> 
> If this is correct, why have the method in the first place?
> 
> Chris Atkins

Consistency pretty much.  If you have a removeContent() for the others,
you should have one for String.  But you bring up a good point, do we
need removeContent() methods at all?  We need removeChild() and
removeChildren() but do we have a compelling use case for
removeContent(*)?

-jh-

Received: from slim.silverstream.com ([216.142.115.7])
	by dorothy.denveronline.net (8.9.3/8.9.3) with ESMTP id NAA00281
	for <jdom-interest at jdom.org>; Thu, 27 Jul 2000 13:00:54 -0600 (MDT)
Received: by slim.silverstream.com with Internet Mail Service (5.5.2650.21)
	id <3PRYCT1G>; Thu, 27 Jul 2000 15:00:52 -0400
Received: from arosen (216.142.115.81 [216.142.115.81]) by slim.silverstream.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21)
	id 3PRYCT1C; Thu, 27 Jul 2000 15:00:40 -0400
From: "Rosen, Alex" <arosen at silverstream.com>
To: jdom-interest at jdom.org
Subject: RE: [jdom-interest] Important proposal: Element/Document changes
Date: Thu, 27 Jul 2000 15:02:27 -0400
Message-ID: <000401bff7fd$35ab7980$6401a8c0 at arosen>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Importance: Normal
In-Reply-To: <200007271744.LAA25047 at dorothy.denveronline.net>
Sender: jdom-interest-admin at jdom.org
Errors-To: jdom-interest-admin at jdom.org
X-BeenThere: jdom-interest at jdom.org
X-Mailman-Version: 2.0beta2
Precedence: bulk
List-Id: JDOM Mailing List for General Issues and Updates <jdom-interest.jdom.org>

I think the proposed changes are great. I wholeheartedly believe that getting
the nuances (like method names) right from the beginning is vital. Thanks for
paying attention to the details and doing things right.

I was unsure for a while, but I now strongly favor getChildElement() and the
like. The differences between content/child/text are subtle and easy to get
confused about. This makes it much more obvious, and will reduce the likelihood
of saying one when you mean the other.

I could live without it, but I would like to see add-at functionality. The
alternative of getChildren() + List.add() + setChildren() is OK, but less
intuitive. (The alternative of getChildren() + List.add() is even stranger IMO -
having the List backed by the JDOM tree will be confusing unless
well-documented.) Also, add() is an optional method on the List interface, so
you'd have to specify that this (and other modification operations) is allowed
on the returned list.

Alex

Received: from slim.silverstream.com ([216.142.115.7])
	by dorothy.denveronline.net (8.9.3/8.9.3) with ESMTP id NAA00281
	for <jdom-interest at jdom.org>; Thu, 27 Jul 2000 13:00:54 -0600 (MDT)
Received: by slim.silverstream.com with Internet Mail Service (5.5.2650.21)
	id <3PRYCT1G>; Thu, 27 Jul 2000 15:00:52 -0400
Received: from arosen (216.142.115.81 [216.142.115.81]) by slim.silverstream.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21)
	id 3PRYCT1C; Thu, 27 Jul 2000 15:00:40 -0400
From: "Rosen, Alex" <arosen at silverstream.com>
To: jdom-interest at jdom.org
Subject: RE: [jdom-interest] Important proposal: Element/Document changes
Date: Thu, 27 Jul 2000 15:02:27 -0400
Message-ID: <000401bff7fd$35ab7980$6401a8c0 at arosen>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Importance: Normal
In-Reply-To: <200007271744.LAA25047 at dorothy.denveronline.net>
Sender: jdom-interest-admin at jdom.org
Errors-To: jdom-interest-admin at jdom.org
X-BeenThere: jdom-interest at jdom.org
X-Mailman-Version: 2.0beta2
Precedence: bulk
List-Id: JDOM Mailing List for General Issues and Updates <jdom-interest.jdom.org>

I think the proposed changes are great. I wholeheartedly believe that getting
the nuances (like method names) right from the beginning is vital. Thanks for
paying attention to the details and doing things right.

I was unsure for a while, but I now strongly favor getChildElement() and the
like. The differences between content/child/text are subtle and easy to get
confused about. This makes it much more obvious, and will reduce the likelihood
of saying one when you mean the other.

I could live without it, but I would like to see add-at functionality. The
alternative of getChildren() + List.add() + setChildren() is OK, but less
intuitive. (The alternative of getChildren() + List.add() is even stranger IMO -
having the List backed by the JDOM tree will be confusing unless
well-documented.) Also, add() is an optional method on the List interface, so
you'd have to specify that this (and other modification operations) is allowed
on the returned list.

Alex



More information about the jdom-interest mailing list